JSPM

cra-template-slds

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q13592F
  • License MIT

The SLDS template for Create React App.

Package Exports

  • cra-template-slds
  • cra-template-slds/template.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cra-template-slds) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cra-template-slds

This is a Create React App template with the Salesforce Lightning Design System (SLDS)

Features

  • Cleaner imports by using absolute imports (doc)

Requirements

  • Node version >= 16

Usage

To use this template, follow the steps below:

  1. Create and initialize the app my-app:

    nvm use v16
    yarn create react-app my-app --template=slds

    or

    npx create-react-app my-app --template=slds
  2. Setup SLDS:

    cd my-app
    yarn setup-slds
  3. Run the app by running yarn start. It should open the browser on localhost:3000 that looks like this:

    Browser Screenshot

Development

To test your CRA template locally, run this command:

yarn create react-app my-app --template=slds --template file:<filepath to this repo>

where filepath to this repo is the file path to this template repo.

For instance,

yarn create react-app my-app --template=slds --template file:./cra-template-slds/

This will create a folder called my-app containing the React app with SLDS