### Clone and Develop Locally Source: https://github.com/salesforce/design-system-react/blob/master/README.md Commands to clone the repository, install dependencies, and start the local development server with Storybook. ```bash git clone git@github.com:salesforce/design-system-react.git cd design-system-react npm install npm start open http://localhost:9001 http://localhost:8001 ``` -------------------------------- ### Install Dependencies Source: https://github.com/salesforce/design-system-react/blob/master/docs/create-react-app-2x.md Install the necessary packages for running the demo app. ```bash npm install ``` ```bash npm start ``` -------------------------------- ### Example React Component Structure Source: https://github.com/salesforce/design-system-react/blob/master/docs/codebase-overview.md Demonstrates a standard React component setup including prop types, default props, constructor logic, and method definitions. Use this as a template for new components. ```javascript import React from 'react'; import PropTypes from 'prop-types'; import checkProps from './check-props'; import { EXTERNAL_CONSTANT } from '../../utilities/constants'; import generateId from '../../utilities/generate-id'; const propTypes = { /** * The description of this prop (will appear in the documentation site). */ title: PropTypes.string.isRequired, }; // These values will also be visible in the documentation site. const defaultProps = {}; /** * The description of this component (will appear in the documentation site). */ class DemoComponent extends React.Component { static displayName = EXTERNAL_CONSTANT_NAME; static propTypes = propTypes; static defaultProps = defaultProps; constructor(props) { super(props); // useful for unique DOM IDs this.generatedId = this.props.id || generateId(); // initial state this.state = {}; // Not required. This function issues console warnings to developers about props and is helpful in upgrading. All breaking changes to props must have a warning for developers when they upgrade. checkProps(EXTERNAL_CONSTANT, this.props); } // Class property bound to instance. Class methods that are not React lifecycle methods should use "fat-arrow" syntax if `this` binding is needed. toggleOpen = (event, { eventDataKey }) => { // you can use `this` here }; // Minimize use of multiple renders. More HTML-like JSX is preferred with ternary statements renderSubComponent = () => null; // Render should be last render() { return null; } } export default DemoComponent; ``` -------------------------------- ### Install Dependencies Source: https://github.com/salesforce/design-system-react/blob/master/docs/create-react-app.md Install the required Design System packages. ```bash cd my-react-app && npm install @salesforce-ux/design-system @salesforce/design-system-react ``` -------------------------------- ### Install Salesforce Lightning Packages Source: https://github.com/salesforce/design-system-react/blob/master/docs/create-react-app-2x.md Install the Salesforce Design System CSS and React components. ```bash npm install --save @salesforce-ux/design-system @salesforce/design-system-react ``` -------------------------------- ### Bootstrap React App Source: https://github.com/salesforce/design-system-react/blob/master/docs/create-react-app-2x.md Create a new React application and start the development server. ```bash npx create-react-app my-app cd my-app npm start ``` -------------------------------- ### Setup Assistant Component Source: https://github.com/salesforce/design-system-react/blob/master/components/comments.txt The Setup Assistant provides administrators with a centralized list of tasks for onboarding organizations, clouds, or features within the Salesforce Platform. ```jsx

Details about configuring settings.

``` -------------------------------- ### Global Header Example Source: https://github.com/salesforce/design-system-react/blob/master/components/comments.txt Example of how to structure the Global Header component with its children. ```jsx ``` -------------------------------- ### Install Babel Preset Source: https://github.com/salesforce/design-system-react/blob/master/preset/README.md Install the Design System React Babel preset as a development dependency using npm. ```sh $ npm install --save-dev @salesforce/babel-preset-design-system-react ``` -------------------------------- ### Install Design System React Source: https://github.com/salesforce/design-system-react/blob/master/docs/README-dist.md Install the Design System React library and its peer dependency using npm. ```bash $ npm install @salesforce-ux/design-system @salesforce/design-system-react ``` -------------------------------- ### Install ESLint and Plugin Source: https://github.com/salesforce/design-system-react/blob/master/eslint-plugin/README.md Commands to install ESLint and the SLDS React plugin as development dependencies. ```bash $ npm i eslint --save-dev ``` ```bash $ npm install @salesforce/eslint-plugin-slds-react --save-dev ``` -------------------------------- ### Quick Setup with CommonJS Source: https://github.com/salesforce/design-system-react/blob/master/docs/README-dist.md Use this import syntax for CommonJS environments without transpilation. Ensure you use named imports. ```javascript import { Button } from '@salesforce/design-system-react';