All Projects → salesforce → Design System React

salesforce / Design System React

Licence: bsd-3-clause
Salesforce Lightning Design System for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Design System React

Purealoe
Salesforce Sample App part of the sample gallery. Agriculture and retail use case. Get inspired and learn best practices.
Stars: ✭ 65 (-90.38%)
Mutual labels:  salesforce, lightning
Salesforcedx Vscode
Salesforce Extensions for VS Code
Stars: ✭ 653 (-3.4%)
Mutual labels:  salesforce, lightning
Sfdc Ui Lookup
Salesforce Lookup Component (Aura version, maintenance only, see LWC version for updates)
Stars: ✭ 94 (-86.09%)
Mutual labels:  salesforce, lightning
Viewui
A high quality UI Toolkit built on Vue.js 2.0
Stars: ✭ 2,487 (+267.9%)
Mutual labels:  design-systems, frontend
lwc-redux
Integrate Redux with Lightning Web Component
Stars: ✭ 35 (-94.82%)
Mutual labels:  lightning, salesforce
Awesome Design Systems
A curated list of bookmarks, resources and articles about design systems focused on developers.
Stars: ✭ 222 (-67.16%)
Mutual labels:  design-systems, frontend
Haoide
Stop upgrade, most of features were delivered in https://github.com/xjsender/haoide-vscode
Stars: ✭ 194 (-71.3%)
Mutual labels:  salesforce, lightning
Create Lwc App
Quickstart command line interface for scaffolding your Lightning Web Components projects
Stars: ✭ 144 (-78.7%)
Mutual labels:  salesforce, lightning
SF-Lightning-Lookup
Salesforce lightning dynamic lookup component.
Stars: ✭ 15 (-97.78%)
Mutual labels:  lightning, salesforce
lwc-modules
Build any LWC you want without ever having to touch Apex
Stars: ✭ 20 (-97.04%)
Mutual labels:  lightning, salesforce
Tachyons
Functional css for humans
Stars: ✭ 11,057 (+1535.65%)
Mutual labels:  design-systems, frontend
Related-List-LWC
My first real foray into Lightning Web Components - an sobject / list view driven lightning data table
Stars: ✭ 21 (-96.89%)
Mutual labels:  lightning, salesforce
Tachyons Verbose
Functional CSS for humans. Verbose edition.
Stars: ✭ 102 (-84.91%)
Mutual labels:  design-systems, frontend
Lightning Data Grid
A data grid for Lightning Component Framework
Stars: ✭ 24 (-96.45%)
Mutual labels:  salesforce, lightning
Iview
A high quality UI Toolkit built on Vue.js 2.0
Stars: ✭ 23,930 (+3439.94%)
Mutual labels:  design-systems, frontend
sfdc-error-playground
Lightning & Apex Error Playground
Stars: ✭ 30 (-95.56%)
Mutual labels:  lightning, salesforce
vuetning
Salesforce Lightning Design System framework for Vue.js 2
Stars: ✭ 21 (-96.89%)
Mutual labels:  lightning, salesforce
server-action-service
Generic and reusable Lightning service component that calls server-side actions
Stars: ✭ 19 (-97.19%)
Mutual labels:  lightning, salesforce
Programming Challenges
Algorithmic, Data Structures, Frontend and Pentest - Programming challenges and competitions to improve knowledge.
Stars: ✭ 592 (-12.43%)
Mutual labels:  frontend
Html Sketchapp Cli
Quickly generate Sketch libraries from HTML documents and living style guides, powered by html-sketchapp
Stars: ✭ 631 (-6.66%)
Mutual labels:  design-systems

Lightning Design System for React

Accessible, localization-friendly, presentational React components

Build Status DeepScan grade Known Vulnerabilities Join the chat at https://gitter.im/salesforce/design-system-react Monthly NPM downloads

Install

$ npm install @salesforce-ux/design-system @salesforce/design-system-react

Getting Started

Welcome to this community-supported project! 👋 This library is the React implementation of the Salesforce Lightning Design System. This library has a peer dependency on @salesforce-ux/design-system, react, and react-dom. It is tested with React 16 and has a stable API despite its version number. Please polyfill this library in order to meet your target environment needs.

Usage

Quick Setup (ES6 and CJS modules)

For a no hassle setup and compatibility with Create React App, transpiled ES6 and CommonJS module versions have been included within the NPM package. If using this setup, please re-write the import statement in the documentation site examples. Use the following named import syntax to access the transpiled components from /lib/index.js:

import { Button } from '@salesforce/design-system-react';

<Button label="Hello Button" />

Please view Create React App Setup for more information on using this library with Create React App.

Advanced (Source code)

Advanced usage requires that your babel presets are set up correctly. create-react-app and environments that do not transpile code within node_modules are not compatible with the component import below. All the examples on the documentation site use this syntax. You can use the Babel preset, @salesforce/babel-preset-design-system-react, to get started. This preset will keep Babel compatible with Design System React and allow ES6 module benefits such as tree-shaking. This library is not browser-ready and should be polyfilled to your target environment.

import Button from '@salesforce/design-system-react/components/button';

<Button label="Hello Button" />

Transpile with .babelrc settings

{
	"presets": ["@salesforce/babel-preset-design-system-react"]
}

The current preset version is only compatible with Babel 6. Please see this issue comment for Babel 7.

Styling

This library does not contain any Cascading Style Sheets (CSS). You will need to add <link rel="stylesheet" type="text/css" href="/node_modules/@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css" /> to your page and serve that file from a publicly available folder.

Serve icons publicly

Typically, scripts should be downloaded in the background without blocking the DOM. With React, this works best with server side rendering. SLDS recommends placeholder stencils while scripts are initializing if the HTML cannot be served immediately. If you can serve the HTML, then icon SVGs should not be bundled and served like any other file. Set a path context for all child components with <IconSettings> at the top of your render tree:

import IconSettings from '@salesforce/design-system-react/components/icon-settings';

ReactDOM.render(
  <IconSettings iconPath="/assets/icons">
    <MyApp />
  </IconSettings>,
  document.getElementById('app')
)

// `/assets/icons` will be prepended to `/standard-sprite/svg/symbols.svg#account` within the SVG path
<svg aria-hidden="true" class="slds-icon">
  <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:></use>
</svg>
// ExpressJS example
app.use('/assets/icons', express.static('node_modules/@salesforce-ux/design-system/assets/icons/'));

Bundle icons

If you use a module bundler, like Webpack, you can let your module bundler manage SVG sprite file paths and send that path into <IconSettings>. This requires configuring your module bundler to manage your public assets.

import IconSettings from '@salesforce/design-system-react/components/icon-settings';
import standardSprite from '@salesforce-ux/design-system/assets/icons/standard-sprite/svg/symbols.svg';
...
...

ReactDOM.render(
  <IconSettings standardSprite={standardSprite}>
    <MyApp />
  </IconSettings>,
  document.getElementById('app')
)

Icon Usage

Prior to v0.7.0, SLDS icons were bundled with the JavaScript. The 400KB+ icons bundle from SLDS is no longer included. You will need to download the SLDS CSS and icons separately.

Bundled script files are provided only for convenience. Do not use in production.

  • design-system-react.min.js (700KB+) - includes icons in the JavaScript
  • design-system-react-components.min.js (~400KB) - no icons.

Contributing to the code base

Clone and develop locally with Storybook and in-browser tests

git clone [email protected]:salesforce/design-system-react.git
cd design-system-react
npm install
npm start
open http://localhost:9001 http://localhost:8001

Please read the CONTRIBUTING.md and Test README first. Then, create an issue to tell others you are working on a bug. If you would like to contribute a new component, create an issue with a list of proposed props to discuss with maintainers. Issues not addressed with pull requests may be closed eventually. Check out who's contributing to the project.

Accessibility

Audit conducted in November, 2019 on all current component examples not intended solely for testing by Salesforce Marketing Cloud (MC) Accessibility Specialist and project team.

  • Methods: Automated testing with axe; Manual testing with keyboard, JAWS, and NVDA
  • Results: 100% accessibility

Quarterly audits will be conducted beginning Feb 1, 2020 on any new or updated components by MC Accessibility Specialist.

  • Methods: Automated testing with axe; Manual testing with keyboard, JAWS, and NVDA
  • Goal: 100% accessibility

Project team will conduct internal accessibility testing in development process for new and updated components.

Got feedback?

If you have support questions, please post a question to StackOverflow and tag with design-system-react. If you find any bugs, create a GitHub Issue.

Security

Please report any security issue to [email protected] as soon as it is discovered. This library limits its runtime dependencies in order to reduce the total cost of ownership as much as can be, but all consumers should remain vigilant and have their security stakeholders review all third-party dependencies.

Contributors

Thank you to all the contributors to this one of many open source projects at Salesforce, but special thanks to the following:

Active Key Contributors

Former Key Contributors

Licenses

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].