This monorepository contains demo apps showcasing SL Design System (SLDS) components.
- Getting Started
- Prerequisites
- Installation
- Available Scripts
- Running Demos
- Building for Production
- Linting & Formatting
- Testing Local Components
- Resources
Corepack & Yarn version
If you are using Corepack to manage Yarn, enable it with:
corepack enableTo pin or switch Yarn versions (optional):
corepack prepare yarn@4.9.2 --activate
yarn --version # should output 4.x.xNote: Yarn 4.x reads registry settings from
.yarnrc.ymland yourSLDS_PACKAGES_AUTH_TOKENenvironment variable for authenticating private packages — no project-level.npmrcis needed.
- Node.js v18+ LTS (install via https://nodejs.org or nvm)
- Yarn v4+ (enable via Corepack or install from https://yarnpkg.com)
In order to authenticate to SLDS private packages, you must set the SLDS_PACKAGES_AUTH_TOKEN environment variable in your shell. For example:
export SLDS_PACKAGES_AUTH_TOKEN=your_token_hereMore information on how to obtain this token can be found in the SL Design System documentation website.
-
Clone the repository.
-
Install the dependencies by running the following command in the root of the project:
yarn install
Run these commands from the monorepo root:
yarn buildBuilds all demo apps (uses Wireit)yarn formatFormats code via Prettieryarn lintRuns ESLint on all workspacesyarn lint:fixFixes lint errors via ESLintyarn stylelintRuns stylelint on CSS/SCSS
Use yarn workspace <name> <script> to serve or build individual demos:
yarn workspace angular-demo start # ng serve on localhost:4200
yarn workspace lit-demo dev # watch build and preview
yarn workspace svelte-demo dev # watch build and preview
yarn workspace vue-demo dev # watch build and previewyarn workspace angular-demo build
yarn workspace lit-demo build
yarn workspace svelte-demo build
yarn workspace vue-demo buildOr build all at once:
yarn buildyarn lint
yarn lint:fix
yarn formatYou can test a local (unpublished) version of an SLDS component (for example, from your separate components repository) using the built-in portal protocol (in Yarn 2+) or via file protocol.
The example below shows how to set up a local sl-button component (@sl-design-system/button) in demo apps.
-
Using the Portal Protocol (Yarn 2+)
In demos monorepo root
package.json, update the component dependency to point to your local path:"@sl-design-system/button": "portal:../components/packages/components/button"
Then install dependencies:
yarn install
Yarn will create a live symlink into your local component folder. Rebuild or watch your component (
yarn run build --watch) in thecomponentsrepo and restart any demo dev server to pick up changes immediately.For continuous development, we recommend using the portal protocol with the component repo’s own watch/build script so changes propagate faster without reinstalling.
-
Using a File Dependency
If you prefer a file-based dependency, point directly to your local component folder:
- Globally at root:
yarn add @sl-design-system/button file:../components/packages/components/button -W
Then install or reinstall dependencies:
yarn install
Yarn will copy the component code into your workspace at installation time. To pick up later changes in the component repository, re-run
yarn installand restart your demo dev server. - Globally at root:
- SL Design System docs: https://sanomalearning.design/
- Storybook: https://storybook.sanomalearning.design/