Add SDAIA UI components to a Next.js or Vite + React project with the sdaia-ui command-line tool. Each component is copied into your project as source files, so you can read and change it like the rest of your code.
Quick start
Run init in the root folder of an existing Next.js or Vite + React project:
npx sdaia-ui@latest init
Then add the components you need. Use the name from the component page address (for example button, alerts or file-upload), or several names at once:
npx sdaia-ui@latest add button
Import each component from the folder the CLI created for it:
import { Button } from '@/components/ui/Button';What init does
- Detects Next.js (with or without a
src/folder) or Vite + React. - Asks where to install components (
src/components/uiorcomponents/ui) and utilities (src/liborlib), which CSS file is your global stylesheet, and which brand to use. Every answer is pre-filled for your project; press Enter to accept it. - Checks for Tailwind CSS v4 and offers to install it if it is missing.
- Installs the design tokens (
@sdaia-ds/tokens), icons (@platformscode/icons),clsx,tailwind-merge,class-variance-authorityand the brand font.
Command options
init --yesskips the questions and uses the detected answers.init --brand <name>picks the brand: sdaia-dga, spectrum, canvas, dessert, dune, carbon. The default is sdaia-dga.add --alladds every component.add --overwritereplaces components that are already installed.
Updating components
Installed components are your files, so new releases do not change them on their own. diff shows what changed in the design system for the components you installed:
npx sdaia-ui@latest diff
update applies those changes. Name the components, or use --all:
npx sdaia-ui@latest update button
update asks before writing and keeps the files you edited yourself. Add --dry-run to preview the changes, --yes to skip the question, or --force to also replace files you edited.
Set up your project with sdaia-ui 1.6.6 or earlier? Those versions kept no install record, so update can't tell your own edits from design-system changes and keeps every component file. Upgrade in three steps:
npx sdaia-ui@latest update --all --yes npx sdaia-ui@latest diff npx sdaia-ui@latest update --all --force
The first command adds the IBM Plex Sans Arabic font and the SDAIA core styles that older versions did not set up. diff shows the component changes to review. update --all --force applies them and replaces files you edited, so copy out any changes you want to keep first. After that, update works as described above.
Step-by-step guides
Starting from scratch? Follow the guide for your setup. It covers creating the project, running init and using your first component.