suiss/ui
  • Docs
  • Components
  • Patterns
  • Interactions
  • Charts
  • Blocks

Search

Search documentation

GitHubGet started
DocsComponentsPatternsInteractionsChartsBlocks
Docs4
Get Started
  • Introduction
  • Installation
  • Theming
  • CLI

suiss/ui

CLI

The @esuiss/ui command sets up your project and copies components, patterns, interactions, charts and blocks into it, for React, React Native, SwiftUI and Jetpack Compose.

Overview

@esuiss/ui runs with npx and is never installed in your project. It has two commands: init and add. It detects the project in the current folder: a Next.js or Vite app gets React components, an Expo or React Native app gets React Native components, an Xcode project or Swift package gets SwiftUI views and an Android Gradle module gets Jetpack Compose composables.

Registry CLI

Every React item is also published as a registry under the @esuiss namespace, so any project with a components.json can add it with the registry CLI instead. The item names are the same, without the group:

$ pnpm dlx shadcn@latest add @esuiss/button$ pnpm dlx shadcn@latest add @esuiss/date-picker @esuiss/area-chart-default

Files land in the same folders as below, icons follow the icon library in components.json, and the style there picks the primitive base. See Installation. Until the namespace is listed in the public registry directory, register it once as shown in Installation.

init

Sets up Tailwind CSS, the @/* import alias, the theme stylesheet, the font, the animation and variant stylesheets and the button component. See Installation for every step.

$ pnpm dlx @esuiss/ui@latest init [options]
OptionDescription
-y, --yesSkip confirmation prompts
-b, --base <base|radix|aria>Primitive base of React components, read from the style in components.json when omitted, otherwise base
-p, --platform <web|rn|swift|kotlin>Pick the platform when the folder holds more than one project
-s, --styling <uniwind|nativewind|stylesheet>React Native styling, detected from the project when omitted
--path <dir>Where SwiftUI or Compose files go, relative to the project
-c, --cwd <dir>Run in another project directory
-h, --helpShow help
-v, --versionShow the version

add

Copies components into your project, together with the components and npm packages they depend on.

$ pnpm dlx @esuiss/ui@latest add$ pnpm dlx @esuiss/ui@latest add <component...> [options]$ pnpm dlx @esuiss/ui@latest add patterns <pattern...> [options]$ pnpm dlx @esuiss/ui@latest add interactions <interaction...> [options]$ pnpm dlx @esuiss/ui@latest add charts <chart...> [options]$ pnpm dlx @esuiss/ui@latest add blocks <block...> [options]
OptionDescription
-o, --overwriteReplace local files that differ from the registry
--diffShow how your local files differ from the registry
-a, --allAdd every component except theme, or every pattern, interaction, chart or block with add patterns, add interactions, add charts or add blocks
-y, --yesSkip confirmation prompts
-b, --base <base|radix|aria>Primitive base of React components, read from the style in components.json when omitted, otherwise base
-p, --platform <web|rn|swift|kotlin>Pick the platform when the folder holds more than one project
-s, --styling <uniwind|nativewind|stylesheet>React Native styling, detected from the project when omitted
--path <dir>Where SwiftUI or Compose files go, relative to the project
-c, --cwd <dir>Run in another project directory
-h, --helpShow help
-v, --versionShow the version

Pick from a list

Run add without names to pick from a list. Choose components, patterns, interactions, charts or blocks, type to filter, select with space and press enter. add patterns, or another group, without names opens the list for that group.

$ pnpm dlx @esuiss/ui@latest add$ pnpm dlx @esuiss/ui@latest add patterns

In SwiftUI and Jetpack Compose projects the list only shows what exists for that platform:

$ pnpm dlx @esuiss/ui@latest add --platform swift

Outside an interactive terminal, such as in CI, add without names prints the available names instead.

Patterns

Patterns combine several components into one ready-made piece, such as a date and time picker. The components a pattern uses are added with it.

$ pnpm dlx @esuiss/ui add patterns date-time-picker$ pnpm dlx @esuiss/ui add patterns --all

Interactions

Interactions add a behavior to something you already have, such as swiping a row to reveal actions. The components an interaction uses are added with it.

$ pnpm dlx @esuiss/ui add interactions swipe-actions$ pnpm dlx @esuiss/ui add interactions --all

Charts

Charts are ready-made charts built on the chart component. The chart component and anything else a chart uses are added with it.

$ pnpm dlx @esuiss/ui add charts <name>$ pnpm dlx @esuiss/ui add charts --all

Blocks

Blocks are ready-made sections of a page built from the components. The components a block uses are added with it.

$ pnpm dlx @esuiss/ui add blocks <name>$ pnpm dlx @esuiss/ui add blocks --all

Note

Patterns, interactions, charts and blocks are optional extras. Neither init nor add --all adds them; add them by name, or all at once with --all.

Primitive base

React components come with three primitive bases. init and add use the default base, base, unless the style in components.json is radix-*, new-york or default, which uses radix, or aria-*, which uses aria. --base overrides both, so pass it to every add in a project without a components.json:

$ pnpm dlx @esuiss/ui@latest init --base radix$ pnpm dlx @esuiss/ui@latest add sidebar --base radix$ pnpm dlx @esuiss/ui@latest init --base aria

The files, folders and names are the same for all three. See Installation.

Where files are written

Paths are relative to your @/* alias root.

KindDirectory
Componentscomponents/ui/
Hookshooks/
Patternscomponents/patterns/
Interactionscomponents/interactions/
Chartscomponents/charts/
Blockscomponents/blocks/

In React Native projects the same folders are used. SwiftUI files go to EsuissUI/, or to Sources/<Target>/EsuissUI/ in a Swift package, and Compose files go to src/main/kotlin/com/esuiss/ui/ in your app module. Pass --path to choose another folder.

Missing npm packages are installed with your package manager: npm, pnpm, yarn or bun. In Expo projects they are installed with expo install, so native modules match the Expo SDK. The CLI never edits Xcode or Gradle files: it lists the Swift packages and Gradle dependencies a SwiftUI or Compose component needs.

NextComponentsPreviousTheming

On this page

  1. 01Overview
  2. 02Registry CLI
  3. 03init
  4. 04add
    • Pick from a list
    • Patterns
    • Interactions
    • Charts
    • Blocks
  5. 05Primitive base
  6. 06Where files are written