@create-ui/cli 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-22VYY2DL.js +3 -0
- package/dist/{chunk-MK3CCMH4.js.map → chunk-22VYY2DL.js.map} +1 -1
- package/dist/{chunk-UVIUVCLG.js → chunk-TGYTOZ2K.js} +6 -6
- package/dist/{chunk-UVIUVCLG.js.map → chunk-TGYTOZ2K.js.map} +1 -1
- package/dist/chunk-ZI2BN2TD.js +18 -0
- package/dist/chunk-ZI2BN2TD.js.map +1 -0
- package/dist/icons/index.d.ts +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +360 -360
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry/index.js +1 -1
- package/dist/schema/index.d.ts +715 -715
- package/dist/skills/createui/SKILL.md +54 -53
- package/dist/skills/createui/agents/openai.yml +1 -1
- package/dist/skills/createui/cli.md +25 -93
- package/dist/skills/createui/customization.md +48 -31
- package/dist/skills/createui/evals/evals.json +12 -11
- package/dist/skills/createui/mcp.md +6 -32
- package/dist/skills/createui/rules/composition.md +112 -101
- package/dist/skills/createui/rules/forms.md +31 -24
- package/dist/skills/createui/rules/icons.md +41 -25
- package/dist/skills/createui/rules/styling.md +5 -9
- package/dist/utils/index.d.ts +1 -3
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-EWAP55CF.js +0 -18
- package/dist/chunk-EWAP55CF.js.map +0 -1
- package/dist/chunk-MK3CCMH4.js +0 -3
- package/dist/skills/createui/contributing.md +0 -213
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: createui
|
|
3
|
-
description: Manages Create UI components and projects — adding, searching, viewing, theming,
|
|
3
|
+
description: Manages Create UI components and projects — adding, searching, viewing, theming, and composing UI. Provides project context, component patterns, and Create UI semantic tokens. Use when working with the createui CLI (init/add/create/diff/view/search/migrate/mcp), a components.json file, the @createui registry, or authoring UI with Create UI tokens and themes.
|
|
4
4
|
user-invocable: false
|
|
5
|
-
allowed-tools: Bash(npx @create-ui/cli *), Bash(pnpm
|
|
5
|
+
allowed-tools: Bash(npx @create-ui/cli *), Bash(pnpm dlx @create-ui/cli *)
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Create UI
|
|
9
9
|
|
|
10
10
|
Create UI is a design code system: **one unified styling system + many themes**. Components are added as source code into the user's project via the `createui` CLI, and styled with Create UI's own semantic tokens.
|
|
11
11
|
|
|
12
|
-
Components are delivered as source code through a registry (registry + components-as-source). Create UI is its own system — its own CLI (`createui`), its own registry (`@createui`), and its own tokens and themes. There is no style/base split.
|
|
12
|
+
Components are delivered as source code through a registry (registry + components-as-source). Create UI is its own system — its own CLI (`createui`), its own registry (`@createui`), and its own tokens and themes. There is no style/base split, and **`@createui` is the only registry** — never configure, suggest, or default to another one.
|
|
13
13
|
|
|
14
|
-
> **IMPORTANT:** Run
|
|
14
|
+
> **IMPORTANT:** Run CLI commands with `npx @create-ui/cli <command>` (or `pnpm dlx @create-ui/cli <command>`).
|
|
15
|
+
|
|
16
|
+
This skill is for **using Create UI in your app**: install components with the CLI, then compose them with the patterns and rules below.
|
|
15
17
|
|
|
16
18
|
## Current Project Context
|
|
17
19
|
|
|
@@ -21,17 +23,12 @@ Run the `info` command to read the project's config and installed components:
|
|
|
21
23
|
npx @create-ui/cli info
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
`info` prints project info plus the contents of `components.json` (config, aliases, `tailwind.css` path, `iconLibrary
|
|
25
|
-
|
|
26
|
-
## Two Audiences
|
|
27
|
-
|
|
28
|
-
- **Using Create UI in your app** — install components with the CLI, then compose them with the patterns and rules below.
|
|
29
|
-
- **Contributing to this monorepo** — authoring components, the registry build, dev/test scripts → see [contributing.md](./contributing.md).
|
|
26
|
+
`info` prints project info plus the contents of `components.json` (config, aliases, `tailwind.css` path, `iconLibrary`). Run it before adding or editing components so imports, the icon library, and `"use client"` advice match the real project. (There is no `--json` flag.)
|
|
30
27
|
|
|
31
28
|
## Principles
|
|
32
29
|
|
|
33
|
-
1. **Use existing components first.** Search the registry before writing custom UI: `npx @create-ui/cli search @createui -q "
|
|
34
|
-
2. **Compose, don't reinvent.** Settings page =
|
|
30
|
+
1. **Use existing components first.** Search the registry before writing custom UI: `npx @create-ui/cli search @createui -q "toast"`.
|
|
31
|
+
2. **Compose, don't reinvent.** Settings page = `TabMenu` + `FieldGroup` + `Field` controls. Checkout = `Field` + `PhoneInput` + `CreditCardInput` + `Button`.
|
|
35
32
|
3. **Use built-in props before custom classes.** `variant`, `appearance`, `size`, `shape` on `Button`; `size` on `Field` — reach for these before `className`.
|
|
36
33
|
4. **Use semantic tokens, never raw values.** `bg-static`, `text-body`, `bg-primary-base` — never `bg-blue-500` or hardcoded hex.
|
|
37
34
|
|
|
@@ -54,7 +51,7 @@ These rules are **always enforced**. Each links to a file with Incorrect/Correct
|
|
|
54
51
|
- **Forms use `FieldGroup` + `Field`.** Never raw `div` + `space-y-*` for form layout.
|
|
55
52
|
- **`Field` owns size; children inherit it.** Set `size` on `Field` (`xs` | `sm` | `md`); `Input`, `Select`, etc. read it via context — never downgrade a child.
|
|
56
53
|
- **`InputGroup` uses `InputGroupControl` / `InputGroupTextarea`.** Never a raw `Input` / `Textarea` inside `InputGroup`.
|
|
57
|
-
- **Option sets (2–7 choices) use `
|
|
54
|
+
- **Option sets (2–7 choices) use `SegmentedControl`** (single-select via `value` / `onValueChange`). Don't loop `Button` with manual active state; multi-select belongs to `CheckboxGroup`.
|
|
58
55
|
- **`FieldSet` + `FieldLegend` group related checkboxes/radios.** Not a `div` with a heading.
|
|
59
56
|
- **Validation: `data-invalid` on `Field`, `aria-invalid` on the control.** Disabled: `data-disabled` on `Field`, `disabled` on the control.
|
|
60
57
|
|
|
@@ -64,17 +61,15 @@ These rules are **always enforced**. Each links to a file with Incorrect/Correct
|
|
|
64
61
|
- **Use `asChild` for custom triggers.** Polymorphism is `asChild` + Radix `Slot` — `<Button asChild><Link href="/x">Docs</Link></Button>`.
|
|
65
62
|
- **`Button` HAS a real `loading` prop.** `<Button loading>Saving…</Button>` renders a Spinner and blocks interaction — don't compose your own.
|
|
66
63
|
- **Use the right `Button` API.** `variant` (`primary` / `danger` / `success` / `neutral-solid` / …) + `appearance` (`solid` / `outline` / `ghost` / `soft`). There is no `variant="outline"`/`"destructive"`/`"secondary"`.
|
|
67
|
-
- **Dialog / Sheet / Drawer need a Title.** `DialogTitle` etc. for accessibility (`className="sr-only"` if hidden).
|
|
68
|
-
- **Use full Card composition.** `CardHeader` / `CardTitle` / `CardDescription` / `CardContent` / `CardFooter`.
|
|
69
64
|
- **`Avatar` always needs `AvatarFallback`.**
|
|
70
|
-
- **Prefer components over custom markup.** Callouts → `
|
|
65
|
+
- **Prefer components over custom markup.** Callouts → `InlineAlert`; toasts → `Toast`; dividers → `Separator`; tags → `Badge`; removable tags → `Chip`; loading → `Spinner`.
|
|
71
66
|
|
|
72
67
|
### Icons → [icons.md](./rules/icons.md)
|
|
73
68
|
|
|
74
69
|
- **Icons in `Button` go through props.** `leadingIcon` / `trailingIcon` (and `iconOnly` for icon-only buttons) — no `data-icon`.
|
|
75
70
|
- **No sizing classes on icons inside components.** The component sets icon size via CVA — no `size-4` / `w-4 h-4`.
|
|
76
71
|
- **Pass icons as components, not string keys.** `icon={CheckIcon}`, never `icon="check"`.
|
|
77
|
-
- **
|
|
72
|
+
- **Import icons from `@create-ui/assets/icons`** (Remix `Ri*`, e.g. `RiSearchLine`). Registry components already ship these imports — never swap them. Brand / flag / payment / social marks come from `@create-ui/assets/{social,flags,payments,brands,…}`.
|
|
78
73
|
|
|
79
74
|
## Key Patterns
|
|
80
75
|
|
|
@@ -84,13 +79,13 @@ The most common idioms that differentiate correct Create UI code. For edge cases
|
|
|
84
79
|
import { Button } from "@/components/ui/button"
|
|
85
80
|
import { Field, FieldGroup, FieldLabel, FieldDescription } from "@/components/ui/field"
|
|
86
81
|
import { Input } from "@/components/ui/input"
|
|
87
|
-
import {
|
|
82
|
+
import { RiArrowRightLine, RiSearchLine } from "@create-ui/assets/icons"
|
|
88
83
|
import Link from "next/link"
|
|
89
84
|
|
|
90
85
|
// Button: appearance + icon props + loading. No variant="outline", no data-icon.
|
|
91
|
-
<Button appearance="outline" leadingIcon={<
|
|
86
|
+
<Button appearance="outline" leadingIcon={<RiSearchLine />}>Search</Button>
|
|
92
87
|
<Button loading>Saving…</Button>
|
|
93
|
-
<Button asChild appearance="ghost" trailingIcon={<
|
|
88
|
+
<Button asChild appearance="ghost" trailingIcon={<RiArrowRightLine />}>
|
|
94
89
|
<Link href="/docs">Docs</Link>
|
|
95
90
|
</Button>
|
|
96
91
|
|
|
@@ -112,22 +107,28 @@ import Link from "next/link"
|
|
|
112
107
|
|
|
113
108
|
## Component Selection
|
|
114
109
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
110
|
+
Every name below ships in `@createui` — and nothing else does. If a component isn't in this table (there is no card, table, tabs, sheet, drawer, skeleton, sidebar, dialog/modal, popover, or alert-banner component), build the layout from semantic-token markup and these primitives instead. The only modal surface is `CommandDialog` (part of `command`).
|
|
111
|
+
|
|
112
|
+
| Need | Use |
|
|
113
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
114
|
+
| Button / action | `Button` (`variant` + `appearance`), `ButtonGroup`, `CloseButton`, `SocialLoginButton`, `AppStoreBadge` |
|
|
115
|
+
| Form layout | `Field` + `FieldGroup` (+ `FieldSet` / `FieldLegend`), `Label` |
|
|
116
|
+
| Form inputs | `Input`, `Textarea`, `Select`, `Checkbox`, `Radio` / `RadioGroup`, `Switch`, `InputOTP` |
|
|
117
|
+
| Grouped on/off controls | `CheckboxGroup`, `SwitchGroup` |
|
|
118
|
+
| Formatted inputs | `DateInput`, `PhoneInput`, `CreditCardInput`, `InputStepper`, `PasswordStrength` |
|
|
119
|
+
| Toggle between 2–7 options | `SegmentedControl` + `SegmentedControlItem` |
|
|
120
|
+
| Inputs with affordances | `InputGroup` + `InputGroupAddon` / `InputGroupButton` |
|
|
121
|
+
| Data display | `Badge`, `StatusBadge` (dot), `Chip`, `Avatar`, `CountryFlag` / `CurrencyFlag` (both from the `country-flag` item), `Progress` |
|
|
122
|
+
| Navigation | `Breadcrumb`, `Pagination`, `TabMenu`, `TextLink` |
|
|
123
|
+
| Menus | `DropdownMenu` |
|
|
124
|
+
| Command palette | `Command` (inline) / `CommandDialog` (modal) |
|
|
125
|
+
| Feedback | `Toast`, `InlineAlert` (inline callout), `Progress`, `Spinner` |
|
|
126
|
+
| Tooltips / info | `Tooltip`, `InfoTooltip` |
|
|
127
|
+
| Layout | `Accordion`, `AspectRatio`, `ScrollArea`, `Separator` |
|
|
128
|
+
|
|
129
|
+
> **Icons & assets** all come from `@create-ui/assets`: UI icons at `@create-ui/assets/icons` (Remix `Ri*`), plus `social` / `flags` / `payments` / `brands` / `badges` / `banks` / `crypto` marks (these back `CountryFlag`, `SocialLoginButton`, …). Never import from `lucide-react`. See [rules/icons.md](./rules/icons.md).
|
|
130
|
+
|
|
131
|
+
> The registry also ships **hooks** (`use-mobile`, `use-credit-card-input`, `use-date-input`, `use-phone-input`) and **lib utilities** (`utils`, `country-flags`, `currency-flags`) — these appear in `search` results as `registry:hook` / `registry:lib` items and are installed automatically as dependencies of the components that need them.
|
|
131
132
|
|
|
132
133
|
## Key Fields (components.json)
|
|
133
134
|
|
|
@@ -137,21 +138,22 @@ import Link from "next/link"
|
|
|
137
138
|
- **`rsc`** — when `true`, components using `useState`, `useEffect`, event handlers, or browser APIs need `"use client"` at the top.
|
|
138
139
|
- **`tsx`** — whether components are emitted as `.tsx` (default `true`).
|
|
139
140
|
- **`tailwind.css`** — the global CSS file where tokens are defined. Edit this file; never create a new one.
|
|
140
|
-
- **`iconLibrary`** —
|
|
141
|
+
- **`iconLibrary`** — Create UI's icon library, `createui`. Icons (and all marks) come from `@create-ui/assets`; UI icons are `@create-ui/assets/icons` (Remix `Ri*`). Never import from `lucide-react` or another package.
|
|
141
142
|
- **`menuColor`** (`default` | `inverted`) / **`menuAccent`** (`subtle` | `bold`) — menu surface treatment.
|
|
142
|
-
|
|
143
|
+
|
|
144
|
+
**`@createui` is the only registry.** There is no `registries` field to configure — never add one or point the project at another registry.
|
|
143
145
|
|
|
144
146
|
See [cli.md — `info`](./cli.md) and [customization.md](./customization.md) for the full reference.
|
|
145
147
|
|
|
146
148
|
## Workflow
|
|
147
149
|
|
|
148
150
|
1. **Get project context** — `npx @create-ui/cli info`.
|
|
149
|
-
2. **Check installed components first** — before `add`,
|
|
151
|
+
2. **Check installed components first** — before `add`, list the `ui` alias directory (e.g. `components/ui/`); `info` prints the config and aliases but not an installed-components list. Don't import un-added components, and don't re-add installed ones.
|
|
150
152
|
3. **Find components** — `npx @create-ui/cli search @createui -q "<query>"`.
|
|
151
|
-
4. **Inspect before adding** — `npx @create-ui/cli view
|
|
153
|
+
4. **Inspect before adding** — `npx @create-ui/cli view <name>` to see an item's metadata and files; `npx @create-ui/cli diff <name>` to see what changed upstream for an installed one.
|
|
152
154
|
5. **Add** — `npx @create-ui/cli add <name>`.
|
|
153
|
-
6. **Review added files** — read them and verify composition (e.g. `SelectItem` inside `SelectGroup`), imports, and adherence to the Critical Rules.
|
|
154
|
-
7. **
|
|
155
|
+
6. **Review added files** — read them and verify composition (e.g. `SelectItem` inside `SelectGroup`), imports, and adherence to the Critical Rules. Registry components import icons from `@create-ui/assets/icons` — keep them as-is; never rewrite them to `lucide-react` or another package.
|
|
156
|
+
7. **Components come from `@createui`** — always. Never configure another registry or suggest one.
|
|
155
157
|
|
|
156
158
|
## Updating Components
|
|
157
159
|
|
|
@@ -169,18 +171,18 @@ To keep local edits while pulling upstream changes, use the `diff` command — *
|
|
|
169
171
|
npx @create-ui/cli init
|
|
170
172
|
npx @create-ui/cli init --theme indigo --neutral gray --font-variant v1
|
|
171
173
|
|
|
172
|
-
# Scaffold a new project (
|
|
174
|
+
# Scaffold a new project (missing name/template/theme are prompted interactively).
|
|
173
175
|
npx @create-ui/cli create my-app --template next
|
|
174
176
|
npx @create-ui/cli create
|
|
175
177
|
|
|
176
|
-
# Add components.
|
|
177
|
-
npx @create-ui/cli add button
|
|
178
|
-
npx @create-ui/cli add @createui/select
|
|
178
|
+
# Add components (items are always bare names).
|
|
179
|
+
npx @create-ui/cli add button select dropdown-menu
|
|
179
180
|
npx @create-ui/cli add --all
|
|
180
181
|
|
|
181
|
-
# Inspect the registry.
|
|
182
|
-
npx @create-ui/cli search @createui -q "
|
|
183
|
-
npx @create-ui/cli
|
|
182
|
+
# Inspect the registry (@createui is the registry argument for search/list only).
|
|
183
|
+
npx @create-ui/cli search @createui -q "toast"
|
|
184
|
+
npx @create-ui/cli search @createui -l 500 # full listing — the default limit is 100, the registry has more items
|
|
185
|
+
npx @create-ui/cli view button
|
|
184
186
|
npx @create-ui/cli diff button
|
|
185
187
|
|
|
186
188
|
# Migrate (e.g. consolidate radix imports, or switch icon library).
|
|
@@ -196,13 +198,12 @@ npx @create-ui/cli mcp init --client claude
|
|
|
196
198
|
|
|
197
199
|
## Detailed References
|
|
198
200
|
|
|
199
|
-
- [cli.md](./cli.md) — every command and flag (init, create, add, diff, view, search, migrate, info,
|
|
201
|
+
- [cli.md](./cli.md) — every command and flag (init, create, add, diff, view, search, migrate, info, mcp, skill).
|
|
200
202
|
- [mcp.md](./mcp.md) — the MCP server, `mcp init` clients, and the available MCP tools.
|
|
201
203
|
- [customization.md](./customization.md) — theming, the `--color-*` / semantic tokens, radius, and dark mode.
|
|
202
|
-
- [contributing.md](./contributing.md) — working inside the monorepo: dev/test scripts, the registry build, authoring components.
|
|
203
204
|
- [rules/styling.md](./rules/styling.md) — semantic tokens, `className` scope, spacing, `size-*`, `outline-*` focus, `cn()`.
|
|
204
|
-
- [rules/forms.md](./rules/forms.md) — `FieldGroup`, `Field` size cascade, `InputGroup`, `
|
|
205
|
-
- [rules/composition.md](./rules/composition.md) — Groups, overlays,
|
|
205
|
+
- [rules/forms.md](./rules/forms.md) — `FieldGroup`, `Field` size cascade, `InputGroup`, `SegmentedControl`, `FieldSet`, validation states.
|
|
206
|
+
- [rules/composition.md](./rules/composition.md) — Groups, overlays, `TabMenu`, `Avatar`, `InlineAlert`, `Toast`, `Separator`, `Badge`, `Button` loading.
|
|
206
207
|
- [rules/icons.md](./rules/icons.md) — `leadingIcon` / `trailingIcon`, icon sizing, passing icons as components.
|
|
207
208
|
|
|
208
209
|
## Resources
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Create UI"
|
|
3
3
|
short_description: "Manages Create UI components — adding, searching, updating, styling, and composing UI from the @createui registry."
|
|
4
|
-
icon_small: "./assets/createui-
|
|
4
|
+
icon_small: "./assets/createui-small.png"
|
|
5
5
|
icon_large: "./assets/createui.png"
|
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Configuration is read from `components.json`.
|
|
4
4
|
|
|
5
|
-
The CLI is published as **`@create-ui/cli`** and exposes the **`createui`** bin.
|
|
6
|
-
|
|
7
|
-
- **In a user project (published):** `npx @create-ui/cli <command>` — or install it globally with `pnpm add -g @create-ui/cli` and then run `createui <command>`.
|
|
8
|
-
- **Inside this monorepo (contributors):** `pnpm createui <command>`, which runs the local build against `http://localhost:4000/r` and requires `pnpm v4:dev` to be running. To test against a target app, use `pnpm createui add -c ~/path/to/app`.
|
|
9
|
-
|
|
10
|
-
Examples below use `npx @create-ui/cli <command>`; substitute `pnpm createui <command>` when working in the monorepo.
|
|
5
|
+
The CLI is published as **`@create-ui/cli`** and exposes the **`createui`** bin. Run it with `npx @create-ui/cli <command>` — or install it globally with `pnpm add -g @create-ui/cli` and then run `createui <command>`.
|
|
11
6
|
|
|
12
7
|
> **IMPORTANT:** Only use the flags documented below. Do not invent or guess flags — if a flag isn't listed here, it doesn't exist.
|
|
13
8
|
|
|
14
9
|
## Contents
|
|
15
10
|
|
|
16
|
-
- Commands: init, create, add, diff, view, search, migrate, info,
|
|
17
|
-
- The three "build" things: `create` vs `build` vs `pnpm registry:build`
|
|
11
|
+
- Commands: init, create, add, diff, view, search, migrate, info, mcp, skill
|
|
18
12
|
- Templates: next, vite, start, next-monorepo
|
|
19
|
-
- Registry & namespaces:
|
|
13
|
+
- Registry & namespaces: the built-in `@createui` (the only registry)
|
|
14
|
+
|
|
15
|
+
(The CLI also has `build` / `registry:build` commands for registry authors publishing their own items — not needed for using Create UI in an app.)
|
|
20
16
|
|
|
21
17
|
---
|
|
22
18
|
|
|
@@ -58,7 +54,7 @@ Pick a theme with `--theme` and `--neutral`; these are swappable token sets laye
|
|
|
58
54
|
npx @create-ui/cli create [name] [options]
|
|
59
55
|
```
|
|
60
56
|
|
|
61
|
-
Scaffolds a brand-new project.
|
|
57
|
+
Scaffolds a brand-new project. Anything not passed as a flag is prompted interactively: project name, template, then the theme choices (primary / neutral / font). `--preset` skips the theme prompts — bare `--preset` shows an interactive preset list, or pass a preset name/URL directly.
|
|
62
58
|
|
|
63
59
|
| Flag | Short | Description | Default |
|
|
64
60
|
| ----------------------- | ----- | --------------------------------------------- | ------- |
|
|
@@ -77,7 +73,7 @@ Scaffolds a brand-new project. With no arguments it prints "Build your own creat
|
|
|
77
73
|
npx @create-ui/cli add [components...] [options]
|
|
78
74
|
```
|
|
79
75
|
|
|
80
|
-
Accepts bare names (`button`), namespaced
|
|
76
|
+
Accepts bare names (`button`), full URLs, and local paths. There is no namespaced item form — `add @createui/button` does not resolve; always use the bare name.
|
|
81
77
|
|
|
82
78
|
| Flag | Short | Description | Default |
|
|
83
79
|
| --------------------- | ----- | -------------------------------------- | ------- |
|
|
@@ -96,9 +92,6 @@ Accepts bare names (`button`), namespaced names (`@createui/button`), full URLs,
|
|
|
96
92
|
# Add by name.
|
|
97
93
|
npx @create-ui/cli add button
|
|
98
94
|
|
|
99
|
-
# Add a namespaced item.
|
|
100
|
-
npx @create-ui/cli add @createui/select
|
|
101
|
-
|
|
102
95
|
# Add from a URL or a local path.
|
|
103
96
|
npx @create-ui/cli add https://createui.co/r/button.json
|
|
104
97
|
```
|
|
@@ -124,7 +117,7 @@ With no argument, lists the components that have updates available. With a compo
|
|
|
124
117
|
npx @create-ui/cli view <items...> [options]
|
|
125
118
|
```
|
|
126
119
|
|
|
127
|
-
Prints item metadata plus file contents (as JSON). Items are names or URLs, e.g.
|
|
120
|
+
Prints item metadata plus file contents (as JSON). Items are bare names or URLs, e.g. `button`.
|
|
128
121
|
|
|
129
122
|
| Flag | Short | Description | Default |
|
|
130
123
|
| ------------- | ----- | ----------------- | ------- |
|
|
@@ -151,7 +144,7 @@ Searches one or more registries. Registry names must start with `@` (e.g. `@crea
|
|
|
151
144
|
npx @create-ui/cli search @createui
|
|
152
145
|
|
|
153
146
|
# Fuzzy search.
|
|
154
|
-
npx @create-ui/cli search @createui -q
|
|
147
|
+
npx @create-ui/cli search @createui -q select
|
|
155
148
|
```
|
|
156
149
|
|
|
157
150
|
### `migrate` — Run a migration
|
|
@@ -162,7 +155,7 @@ npx @create-ui/cli migrate [migration] [options]
|
|
|
162
155
|
|
|
163
156
|
Available migrations:
|
|
164
157
|
|
|
165
|
-
- `icons` — migrate
|
|
158
|
+
- `icons` — migrate a project from a legacy icon library (lucide / radix) to Create UI's `@create-ui/assets/icons` (Remix `Ri*`).
|
|
166
159
|
- `radix` — migrate to `radix-ui`, consolidating `@radix-ui/react-*` imports into the unified `radix-ui` package.
|
|
167
160
|
|
|
168
161
|
| Flag | Short | Description | Default |
|
|
@@ -183,21 +176,6 @@ Prints project information plus the contents of `components.json`. Run this firs
|
|
|
183
176
|
| ------------- | ----- | ----------------- | ------- |
|
|
184
177
|
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
185
178
|
|
|
186
|
-
### `build` — Build components for a Create UI registry [EXPERIMENTAL]
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
npx @create-ui/cli build [registry] [options]
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
For users **publishing their own registry**: compiles a `registry.json` into individual JSON files for distribution. Default input `./registry.json`, default output `./public/r`.
|
|
193
|
-
|
|
194
|
-
| Flag | Short | Description | Default |
|
|
195
|
-
| ----------------- | ----- | ----------------- | ------------ |
|
|
196
|
-
| `--output <path>` | `-o` | Output directory | `./public/r` |
|
|
197
|
-
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
198
|
-
|
|
199
|
-
This is distinct from the monorepo's `pnpm registry:build` — see the note below.
|
|
200
|
-
|
|
201
179
|
### `mcp` — MCP server and configuration commands
|
|
202
180
|
|
|
203
181
|
```bash
|
|
@@ -217,36 +195,23 @@ Running `createui mcp` starts the stdio MCP server. The `mcp init` subcommand wr
|
|
|
217
195
|
|
|
218
196
|
See [mcp.md](./mcp.md) for the MCP server details, the available tools, and per-client config paths.
|
|
219
197
|
|
|
220
|
-
### `
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
npx @create-ui/cli registry add [registries...] [options]
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
The `registry add` subcommand adds registries to `components.json`. Pass a name (`@acme`) or a `name=url` pair where the URL contains `{name}`.
|
|
227
|
-
|
|
228
|
-
| Flag | Short | Description | Default |
|
|
229
|
-
| ------------- | ----- | ----------------- | ------- |
|
|
230
|
-
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
231
|
-
| `--silent` | `-s` | Mute output | `false` |
|
|
198
|
+
### `skill` — Install the Create UI agent skill
|
|
232
199
|
|
|
233
200
|
```bash
|
|
234
|
-
npx @create-ui/cli
|
|
201
|
+
npx @create-ui/cli skill
|
|
202
|
+
npx @create-ui/cli skill --client claude --project
|
|
235
203
|
```
|
|
236
204
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## The three "build" things
|
|
205
|
+
Installs this skill into the agent's skills directory (personal home directory by default; `--project` installs into the project).
|
|
242
206
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
| `
|
|
207
|
+
| Flag | Short | Description | Default |
|
|
208
|
+
| ------------------- | ----- | -------------------------------------------------------------------- | -------- |
|
|
209
|
+
| `--client <client>` | | Agent to install for: `claude`, `gemini`, `codex`, `agents` | `claude` |
|
|
210
|
+
| `--project` | | Install into the project instead of the home directory | `false` |
|
|
211
|
+
| `--path <path>` | `-p` | Install into an explicit skills directory (for other agents) | — |
|
|
212
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
213
|
+
| `--force` | `-f` | Overwrite an existing skill installation | `false` |
|
|
214
|
+
| `--yes` | `-y` | Skip the overwrite confirmation prompt | `false` |
|
|
250
215
|
|
|
251
216
|
---
|
|
252
217
|
|
|
@@ -265,45 +230,12 @@ The `init` `--template` option accepts:
|
|
|
265
230
|
|
|
266
231
|
## Registry & namespaces
|
|
267
232
|
|
|
268
|
-
|
|
233
|
+
**`@createui` is the only registry.** It is built in — nothing to configure — and resolves item names to:
|
|
269
234
|
|
|
270
235
|
```
|
|
271
236
|
https://createui.co/r/{name}.json
|
|
272
237
|
```
|
|
273
238
|
|
|
274
|
-
So
|
|
275
|
-
|
|
276
|
-
### Overriding the base registry URL
|
|
239
|
+
So `add button` fetches `https://createui.co/r/button.json`. Items are always referenced by **bare name**; the `@createui` name itself is only used as the registry argument to `search` / `list`. Never prefix item names with it — `view @createui/button` resolves to the literal path `…/r/@createui/button.json` and 404s.
|
|
277
240
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
```bash
|
|
281
|
-
REGISTRY_URL=https://staging.example.com/r npx @create-ui/cli add button
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### Custom registries in `components.json`
|
|
285
|
-
|
|
286
|
-
Configure additional registries under the `"registries"` key. Names must start with `@`, and every URL must contain `{name}`.
|
|
287
|
-
|
|
288
|
-
```json
|
|
289
|
-
{
|
|
290
|
-
"registries": {
|
|
291
|
-
"@acme": "https://acme.com/r/{name}.json",
|
|
292
|
-
"@private": {
|
|
293
|
-
"url": "https://registry.internal.example.com/r/{name}.json",
|
|
294
|
-
"headers": { "Authorization": "Bearer ${MY_TOKEN}" },
|
|
295
|
-
"params": { "team": "${TEAM_ID}" }
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
- **String form** (`@acme`) is a bare templated URL.
|
|
302
|
-
- **Object form** (`@private`) adds `headers` and/or `params`.
|
|
303
|
-
- `${VAR}` placeholders in the URL, headers, and params are resolved from environment variables.
|
|
304
|
-
|
|
305
|
-
Once configured, add items by namespace:
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
npx @create-ui/cli add @acme/marketing-hero
|
|
309
|
-
```
|
|
241
|
+
Never configure additional registries, add a `registries` field to `components.json`, or point the CLI at another registry host.
|
|
@@ -55,7 +55,7 @@ Create UI uses **semantic** token names. Backgrounds, borders, and text share a
|
|
|
55
55
|
|
|
56
56
|
### Status families
|
|
57
57
|
|
|
58
|
-
Each of `error`, `success`, `warning`, `info` has a `-base` plus a `-weakest` … `-strongest` scale, e.g. `bg-error-base`, `text-error-base`, `outline-error-strongest`, `bg-success-base`, `bg-info-base
|
|
58
|
+
Each of `error`, `success`, `warning`, `info`, and `away` has a `-base` plus a `-weakest` … `-strongest` scale, e.g. `bg-error-base`, `text-error-base`, `outline-error-strongest`, `bg-success-base`, `bg-info-base`, `bg-away-base` (`away` backs the `variant="away"` of `Toast` / `InlineAlert` / `StatusBadge`). **Prefer the semantic status tokens** in your own code. The shipped Button implements its danger/success variants with the raw `red-*` / `green-*` scales (e.g. `bg-red-600`, `bg-red-alpha-16`) — that is the implementation detail, not a pattern you need to copy.
|
|
59
59
|
|
|
60
60
|
### Shadows
|
|
61
61
|
|
|
@@ -207,9 +207,9 @@ Use `className` for layout and spacing, not for re-coloring the variant:
|
|
|
207
207
|
|
|
208
208
|
```tsx
|
|
209
209
|
import { cn } from "@/lib/utils"
|
|
210
|
-
import {
|
|
210
|
+
import { Button } from "@/components/ui/button"
|
|
211
211
|
|
|
212
|
-
<
|
|
212
|
+
<Button className={cn("w-full")}>Continue</Button>
|
|
213
213
|
```
|
|
214
214
|
|
|
215
215
|
### 3. Add a CVA variant in the source
|
|
@@ -226,37 +226,54 @@ warning: "bg-warning-base text-static-white hover:bg-warning-strong",
|
|
|
226
226
|
Compose Create UI primitives into higher-level components. Verify each primitive's props (`Button` has `variant="danger"`, not `variant="destructive"`):
|
|
227
227
|
|
|
228
228
|
```tsx
|
|
229
|
+
import { RiLogoutBoxLine, RiSettingsLine, RiUserLine } from "@create-ui/assets/icons"
|
|
230
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
|
|
229
231
|
import { Button } from "@/components/ui/button"
|
|
230
232
|
import {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export function ConfirmDialog({ title, description, onConfirm, children }) {
|
|
233
|
+
DropdownMenu,
|
|
234
|
+
DropdownMenuContent,
|
|
235
|
+
DropdownMenuGroup,
|
|
236
|
+
DropdownMenuItem,
|
|
237
|
+
DropdownMenuSeparator,
|
|
238
|
+
DropdownMenuTrigger,
|
|
239
|
+
} from "@/components/ui/dropdown-menu"
|
|
240
|
+
|
|
241
|
+
export function UserMenu({ name, avatarSrc, onSignOut, children }) {
|
|
242
242
|
return (
|
|
243
|
-
<
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
243
|
+
<DropdownMenu>
|
|
244
|
+
<DropdownMenuTrigger asChild>
|
|
245
|
+
<Button
|
|
246
|
+
appearance="ghost"
|
|
247
|
+
variant="neutral-solid"
|
|
248
|
+
shape="pill"
|
|
249
|
+
iconOnly
|
|
250
|
+
aria-label="Open account menu"
|
|
251
|
+
>
|
|
252
|
+
<Avatar>
|
|
253
|
+
<AvatarImage src={avatarSrc} alt={name} />
|
|
254
|
+
<AvatarFallback>{name.slice(0, 2)}</AvatarFallback>
|
|
255
|
+
</Avatar>
|
|
256
|
+
</Button>
|
|
257
|
+
</DropdownMenuTrigger>
|
|
258
|
+
<DropdownMenuContent align="end">
|
|
259
|
+
<DropdownMenuGroup>
|
|
260
|
+
<DropdownMenuItem>
|
|
261
|
+
<RiUserLine />
|
|
262
|
+
Profile
|
|
263
|
+
</DropdownMenuItem>
|
|
264
|
+
<DropdownMenuItem>
|
|
265
|
+
<RiSettingsLine />
|
|
266
|
+
Settings
|
|
267
|
+
</DropdownMenuItem>
|
|
268
|
+
{children}
|
|
269
|
+
</DropdownMenuGroup>
|
|
270
|
+
<DropdownMenuSeparator />
|
|
271
|
+
<DropdownMenuItem onSelect={onSignOut}>
|
|
272
|
+
<RiLogoutBoxLine />
|
|
273
|
+
Sign out
|
|
274
|
+
</DropdownMenuItem>
|
|
275
|
+
</DropdownMenuContent>
|
|
276
|
+
</DropdownMenu>
|
|
260
277
|
)
|
|
261
278
|
}
|
|
262
279
|
```
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"evals": [
|
|
4
4
|
{
|
|
5
5
|
"id": 1,
|
|
6
|
-
"prompt": "I'm building a Next.js app with Create UI
|
|
6
|
+
"prompt": "I'm building a Next.js app with Create UI. Create a settings form component with fields for: full name, email address, and notification preferences (email, SMS, push notifications as on/off toggles). Add validation states for required fields.",
|
|
7
7
|
"expected_output": "A React component using FieldGroup, Field, Switch, data-invalid/aria-invalid validation, gap-* spacing, and Create UI semantic tokens.",
|
|
8
8
|
"files": [],
|
|
9
9
|
"expectations": [
|
|
@@ -17,27 +17,28 @@
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"id": 2,
|
|
20
|
-
"prompt": "Create
|
|
21
|
-
"expected_output": "A React component with
|
|
20
|
+
"prompt": "Create an account menu component for the app header. The trigger is the user's avatar; the menu shows Profile, Billing, and Settings items with appropriate icons, then a separated Sign out item. Below the menu component, also add a Save changes button that shows a pending state while saving. Using Create UI.",
|
|
21
|
+
"expected_output": "A React component with DropdownMenu (trigger via asChild wrapping a Button + Avatar with AvatarFallback), DropdownMenuGroup/DropdownMenuSeparator structure, icons from @create-ui/assets/icons without sizing classes, and a Button using the loading prop.",
|
|
22
22
|
"files": [],
|
|
23
23
|
"expectations": [
|
|
24
|
-
"
|
|
24
|
+
"Uses DropdownMenu with DropdownMenuTrigger asChild (Radix Slot) instead of hand-rolling a menu or using a popover (no popover component exists in Create UI)",
|
|
25
25
|
"Avatar component includes AvatarFallback",
|
|
26
|
-
"
|
|
26
|
+
"Menu items are wrapped in DropdownMenuGroup, with DropdownMenuSeparator before Sign out",
|
|
27
|
+
"Icons are imported from @create-ui/assets/icons (Remix Ri*), never from lucide-react or another icon package",
|
|
27
28
|
"No sizing classes on icons inside components (no size-4, w-4, h-4, etc.) — the component sizes icons via CVA",
|
|
28
29
|
"Uses the Button loading prop for the pending Save state instead of manually composing a Spinner",
|
|
29
|
-
"
|
|
30
|
+
"Button icons (if any) are passed via the leadingIcon/trailingIcon props (never a data-icon attribute, which does not exist in Create UI)"
|
|
30
31
|
]
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
"id": 3,
|
|
34
|
-
"prompt": "Create a dashboard
|
|
35
|
-
"expected_output": "A React component with
|
|
35
|
+
"prompt": "Create a dashboard stats section that shows 4 stat tiles in a grid. Each tile has a label, a large number, and a percentage-change indicator, plus a loading state while the data is being fetched. Using Create UI.",
|
|
36
|
+
"expected_output": "A React component with stat tiles built from semantic-token markup (bg-static/border-light surfaces, text-placeholder label, text-strongest number), a Badge for the percentage change, a Spinner for the loading state, and gap-* spacing.",
|
|
36
37
|
"files": [],
|
|
37
38
|
"expectations": [
|
|
38
|
-
"
|
|
39
|
-
"Uses the
|
|
40
|
-
"Uses a Badge
|
|
39
|
+
"Builds the stat tiles from semantic-token markup (e.g. bg-static or bg-weakest surface, border-light, text-placeholder for the label, text-strongest for the number) — there is no Card component in Create UI",
|
|
40
|
+
"Uses the Spinner component for the loading state instead of a skeleton placeholder (no skeleton component exists in Create UI) or custom animate-pulse/animate-spin divs",
|
|
41
|
+
"Uses a Badge (e.g. variant=\"success\" / \"danger\") for the percentage change instead of custom styled spans",
|
|
41
42
|
"Uses Create UI semantic tokens (e.g. text-body, text-strongest, text-success-base) instead of foreign tokens or raw colors like bg-green-500",
|
|
42
43
|
"Uses gap-* instead of space-y-* or space-x-* for spacing",
|
|
43
44
|
"Uses size-* when width and height are equal instead of separate w-* h-*"
|