How to use @salesforce/design-system-react - 6 common examples

To help you get started, we’ve selected a few @salesforce/design-system-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SFDO-Tooling / MetaCI / src / js / index.tsx View on Github external
);

    // Get JS globals
    let GLOBALS = {};
    try {
      const globalsEl = document.getElementById('js-globals');
      if (globalsEl) {
        GLOBALS = JSON.parse(globalsEl.textContent);
      }
    } catch (err) {
      logError(err);
    }
    window.GLOBALS = GLOBALS;

    // Set App element (used for react-SLDS modals)
    settings.setAppElement(el);

    ReactDOM.render(
      
        
          
            
          
        
      ,
      el,
github quip / quip-apps / examples / salesforce-lightning-design-system / src / Modals.jsx View on Github external
onSelect={item => {
                                    console.log(item, " Selected");
                                }}
                                options={[
                                    {type: "section", label: "SECTION 1"},
                                    {label: "Paddy's Pub"},
                                    {label: "Tyrell Corp"},
                                    {type: "section", label: "SECTION 2"},
                                    {label: "Paper St. Soap Company"},
                                    {label: "Nakatomi Investments"},
                                    {label: "Acme Landscaping"},
                                    {type: "section", label: "SECTION 3"},
                                    {label: "Acme Construction"},
                                ]}
                                sectionDividerRenderer={
                                    Lookup.DefaultSectionDivider
                                }
                            />
                        
                        <div>
                             {
                                        const selection =
                                            data.selection.length === 0
                                                ? this.state.leadSourceSelection
                                                : data.selection;
                                        console.log(
                                            "selected: ",
                                            selection[0].label
                                        );
                                        this.setState({</div>
github quip / quip-apps / examples / salesforce-list-ui / src / ListView.jsx View on Github external
const ClickableDataTableCell = ({children, ...props}) =&gt; {
    return (
        
            <div>
                <a> {
                        props.onClick(props.item);
                    }}
                    style={{cursor: "pointer"}}&gt;
                    {children}
                </a>
            </div>
        
    );
};
ClickableDataTableCell.displayName = DataTableCell.displayName;

const ImageDataTableCell = ({children, ...props}) =&gt; {
    return (
        
            <img style="{{maxWidth:" alt="" src="{props.item[props.property]}">
        
    );
};
ImageDataTableCell.displayName = DataTableCell.displayName;
github quip / quip-apps / examples / salesforce-list-ui / src / ListView.jsx View on Github external
<div style="{{alignItems:">
                <div>{children}</div>
                <div> commentableRecord.setDom(c)}
                    style={{marginLeft: 5}}&gt;
                    
                </div>
            </div>
        
    );
};
CommentableDataTableCell.displayName = DataTableCell.displayName;

const ClickableDataTableCell = ({children, ...props}) =&gt; {
    return (
        
            <div>
                <a> {
                        props.onClick(props.item);
                    }}
                    style={{cursor: "pointer"}}&gt;
                    {children}
                </a>
            </div>
        
    );
};
github quip / quip-apps / examples / einstein-analytics / src / DashboardPicker.jsx View on Github external
DataTableCell,
    DataTableColumn,
    Spinner,
} from "@salesforce/design-system-react";

const ClickableDataTableCell = ({children, ...props}) =&gt; 
    <div> {
            props.onClick(props.item);
        }}
        style={{cursor: "pointer"}}&gt;
        <a>{children}</a>
    </div>
;
ClickableDataTableCell.displayName = DataTableCell.displayName;

const LabelDataTableCell = ({children, ...props}) =&gt; 
    <div> {
            props.onClick(props.item);
        }}
        style={{cursor: "pointer"}}&gt;
        <a>{decode(props.item.label)}</a>
    </div>
;
LabelDataTableCell.displayName = DataTableCell.displayName;

const MomentDataTableCell = ({children, ...props}) =&gt;
github quip / quip-apps / examples / einstein-analytics / src / DashboardPicker.jsx View on Github external
<a>{decode(props.item.label)}</a>
    
;
LabelDataTableCell.displayName = DataTableCell.displayName;

const MomentDataTableCell = ({children, ...props}) =&gt; 
    <div> {
            props.onClick(props.item);
        }}
        style={{cursor: "pointer"}}&gt;
        <a>{decode(moment(props.item.lastModifiedDate).fromNow())}</a>
    </div>
;
MomentDataTableCell.displayName = DataTableCell.displayName;

const FolderDataTableCell = ({children, ...props}) =&gt; 
    <a>{decode(props.item.folder.label)}</a>
;
FolderDataTableCell.displayName = DataTableCell.displayName;

const HEIGHT = 500;

export default class DashboardPicker extends React.Component {
    static propTypes = {
        dashboards: PropTypes.array,
        totalDashboardLength: PropTypes.number,
        isFiltering: PropTypes.bool,

@salesforce/design-system-react

Salesforce Lightning Design System for React

BSD-3-Clause
Latest version published 8 months ago

Package Health Score

83 / 100
Full package analysis