@create-ui/cli 0.5.8 → 0.5.9

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.
Files changed (74) hide show
  1. package/dist/{chunk-RMTTHCB3.js → chunk-2ELKDGGM.js} +3 -3
  2. package/dist/{chunk-RMTTHCB3.js.map → chunk-2ELKDGGM.js.map} +1 -1
  3. package/dist/chunk-643QI2I2.js +102 -0
  4. package/dist/chunk-643QI2I2.js.map +1 -0
  5. package/dist/{chunk-NQFMXHMH.js → chunk-KQTXDVKV.js} +3 -3
  6. package/dist/chunk-KQTXDVKV.js.map +1 -0
  7. package/dist/index.d.ts +360 -360
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp/index.js +1 -1
  11. package/dist/registry/index.d.ts +2 -2
  12. package/dist/registry/index.js +1 -1
  13. package/dist/schema/index.d.ts +715 -715
  14. package/dist/skills/createui/SKILL.md +201 -177
  15. package/dist/skills/createui/agents/openai.yml +1 -1
  16. package/dist/skills/createui/cli.md +42 -42
  17. package/dist/skills/createui/customization.md +20 -15
  18. package/dist/skills/createui/evals/evals.json +68 -5
  19. package/dist/skills/createui/mcp.md +14 -5
  20. package/dist/skills/createui/reference/accordion.md +127 -0
  21. package/dist/skills/createui/reference/app-store-badge.md +88 -0
  22. package/dist/skills/createui/reference/aspect-ratio.md +52 -0
  23. package/dist/skills/createui/reference/avatar.md +230 -0
  24. package/dist/skills/createui/reference/badge.md +110 -0
  25. package/dist/skills/createui/reference/breadcrumb.md +153 -0
  26. package/dist/skills/createui/reference/button-group.md +116 -0
  27. package/dist/skills/createui/reference/button.md +104 -0
  28. package/dist/skills/createui/reference/checkbox-group.md +118 -0
  29. package/dist/skills/createui/reference/checkbox.md +79 -0
  30. package/dist/skills/createui/reference/chip.md +115 -0
  31. package/dist/skills/createui/reference/close-button.md +83 -0
  32. package/dist/skills/createui/reference/command.md +69 -0
  33. package/dist/skills/createui/reference/country-flag.md +109 -0
  34. package/dist/skills/createui/reference/credit-card-input.md +76 -0
  35. package/dist/skills/createui/reference/date-input.md +71 -0
  36. package/dist/skills/createui/reference/dropdown-menu.md +164 -0
  37. package/dist/skills/createui/reference/field.md +186 -0
  38. package/dist/skills/createui/reference/info-tooltip.md +110 -0
  39. package/dist/skills/createui/reference/inline-alert.md +146 -0
  40. package/dist/skills/createui/reference/input-group.md +171 -0
  41. package/dist/skills/createui/reference/input-otp.md +130 -0
  42. package/dist/skills/createui/reference/input-stepper.md +120 -0
  43. package/dist/skills/createui/reference/input.md +118 -0
  44. package/dist/skills/createui/reference/label.md +121 -0
  45. package/dist/skills/createui/reference/pagination.md +157 -0
  46. package/dist/skills/createui/reference/password-strength.md +70 -0
  47. package/dist/skills/createui/reference/phone-input.md +77 -0
  48. package/dist/skills/createui/reference/progress.md +158 -0
  49. package/dist/skills/createui/reference/radio-group.md +133 -0
  50. package/dist/skills/createui/reference/radio.md +79 -0
  51. package/dist/skills/createui/reference/scroll-area.md +212 -0
  52. package/dist/skills/createui/reference/segmented-control.md +146 -0
  53. package/dist/skills/createui/reference/select.md +204 -0
  54. package/dist/skills/createui/reference/separator.md +99 -0
  55. package/dist/skills/createui/reference/social-login-button.md +130 -0
  56. package/dist/skills/createui/reference/spinner.md +68 -0
  57. package/dist/skills/createui/reference/status-badge.md +89 -0
  58. package/dist/skills/createui/reference/switch-group.md +122 -0
  59. package/dist/skills/createui/reference/switch.md +75 -0
  60. package/dist/skills/createui/reference/tab-menu.md +165 -0
  61. package/dist/skills/createui/reference/text-link.md +84 -0
  62. package/dist/skills/createui/reference/textarea.md +50 -0
  63. package/dist/skills/createui/reference/toast.md +162 -0
  64. package/dist/skills/createui/reference/tooltip.md +63 -0
  65. package/dist/skills/createui/rules/composition.md +41 -25
  66. package/dist/skills/createui/rules/design.md +266 -0
  67. package/dist/skills/createui/rules/forms.md +44 -15
  68. package/dist/skills/createui/rules/icons.md +64 -18
  69. package/dist/skills/createui/rules/styling.md +53 -14
  70. package/dist/utils/index.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunk-M5DYT2NE.js +0 -64
  73. package/dist/chunk-M5DYT2NE.js.map +0 -1
  74. package/dist/chunk-NQFMXHMH.js.map +0 -1
@@ -1,210 +1,234 @@
1
1
  ---
2
2
  name: createui
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
- user-invocable: false
3
+ description: Create UI component library and design system. Use whenever writing or editing ANY React/JSX UI - pages, views, components, layouts, styling - in a project that uses Create UI (has a components.json, the @createui registry, or @create-ui/* packages), and for createui CLI or MCP operations (init/add/create/diff/view/search/migrate/mcp). Provides per-component API references (reference/<component>.md), composition rules, semantic tokens, and design recipes.
4
+ user-invocable: true
5
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
- 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.
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. It is its own system - its own CLI (`npx @create-ui/cli`), its own registry (`@createui` - the only registry, never configure another), and its own component APIs. **Do not assume shadcn/ui conventions: the APIs differ.**
11
+
12
+ ## Non-negotiable workflow
13
+
14
+ 1. **Get project context** - `npx @create-ui/cli info` (prints components.json: aliases, `rsc`, `tailwind.css` path, `iconLibrary`). Use the real aliases in imports.
15
+ 2. **Check installed components** - list the `ui` alias directory (e.g. `components/ui/`). Never import a component that hasn't been added; never re-add installed ones.
16
+ 3. **Before the FIRST use of any component, read [`reference/<component>.md`](./reference/) in this skill folder.** It is generated from the component source and is the API authority (props, variants, defaults, icon usage, canonical example). If you cannot read it, fetch real usage instead: MCP `get_item_examples_from_registries` with `"<name>-demo"`, or `npx @create-ui/cli view <name>`.
17
+ 4. **Add what's missing** - `npx @create-ui/cli add <name>`.
18
+ 5. **Compose per the invariants below.** Never hand-roll a pattern listed in "Never hand-roll".
19
+ 6. **Exercise the component API - never ship bare defaults.** Pick `variant` / `appearance` / `size` / `state` / `orientation` to fit each element's role on every build (see "Use the full component API" below). For marketing / landing / showcase, also read [`rules/design.md`](./rules/design.md) first (section recipes, spacing rhythm, anti-patterns); for any other rich UI, skim its richness checklist + anti-patterns. Build to the user's brand and request; never clone the Create UI site.
20
+
21
+ ## Component inventory
22
+
23
+ Every item below ships in `@createui` - and nothing else does. There is **no card, table, tabs, sheet, drawer, skeleton, sidebar, dialog/modal, popover, or alert-banner component**; the only modal surface is `CommandDialog` (part of `command`). Build other layouts from semantic-token markup and these primitives - don't invent lookalikes.
24
+
25
+ <!-- MAINTENANCE: if modal/popover/alert-banner ever get registered in ui/_registry.ts, update the sentence above and the matching negations in rules/composition.md and the notes files - the generator does not maintain hand-written prose. -->
26
+
27
+ <!-- BEGIN GENERATED:INVENTORY -->
28
+
29
+ | Item | Exports | Key props (defaults starred) |
30
+ | --- | --- | --- |
31
+ | accordion | Accordion, AccordionItem, AccordionTrigger, AccordionContent | appearance: ghost-default*\|ghost-underline\|ghost-rounded\|outline-rounded\|outline-sharp\|filled-rounded |
32
+ | app-store-badge | AppStoreBadge | variant: black*\|white · appearance: filled*\|outline · iconOnly · brand (required) |
33
+ | aspect-ratio | AspectRatio | |
34
+ | avatar | Avatar, AvatarImage, AvatarText, AvatarIcon, AvatarRing, AvatarBadge, +8 more | variant: {gradient\|strong\|base\|weak\|alpha}-{inverse\|neutral\|red\|green\|orange\|blue\|sky\|indigo\|fuchsia\|yellow\|stable} (55 values) · size: 2xs\|xs\|sm\|md*\|lg\|xl\|2xl · shape: circle*\|rounded · background · stroke |
35
+ | badge | Badge | variant: primary*\|neutral\|neutral-static\|danger\|success\|warning\|info\|verified\|highlighted\|away\|inverse\|inverse-static · appearance: solid\|outline\|soft*\|ghost · size: xs\|sm*\|md · shape: rounded*\|pill · leadingIcon/trailingIcon · iconOnly · numberOnly · disabled |
36
+ | breadcrumb | Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbSeparator | variant: primary\|neutral · appearance: solid\|outline\|ghost · size: xs\|sm\|md · shape: rounded\|pill · separator: chevron\|slash\|dot |
37
+ | button | Button | variant: primary*\|neutral-solid\|neutral-light\|danger\|success\|inverse-solid\|inverse-light · appearance: solid*\|outline\|ghost\|soft · size: xs\|sm\|md\|lg*\|xl · shape: rounded*\|pill\|square · leadingIcon/trailingIcon · iconOnly · loading |
38
+ | button-group | ButtonGroup, ButtonGroupItem | variant: primary*\|neutral\|soft · size: xs\|sm\|md*\|lg\|xl · shape: rounded*\|pill\|square |
39
+ | checkbox | Checkbox | variant: primary*\|neutral\|inverse\|danger\|success\|info · size: xs\|sm*\|md · shape: rounded*\|pill\|square |
40
+ | checkbox-group | CheckboxGroup | variant: primary*\|danger · size: xs\|sm\|md* · placement: left*\|right |
41
+ | chip | Chip | variant: neutral*\|info\|danger\|success · appearance: outline*\|soft · size: xs\|sm\|md\|lg*\|xl · shape: pill\|rounded* · selected · disabled · dragging · closable |
42
+ | close-button | CloseButton | variant: neutral*\|inverse · appearance: solid\|outline\|ghost*\|soft · size: xs\|sm\|md*\|lg\|xl\|2xl · shape: rounded*\|pill\|square |
43
+ | command | Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, +13 more | CommandDialog: showCloseButton |
44
+ | country-flag | CountryFlag, CurrencyFlag, FlagFallback | code (required) |
45
+ | credit-card-input | CreditCardInput | size: xs\|sm\|md · leadingIcon · invalid · disabled · loading · showLeadingIcon · showBadge · showValidationIcon |
46
+ | date-input | DateInput | size: xs\|sm\|md · leadingIcon · invalid · disabled · loading · showLeadingIcon |
47
+ | dropdown-menu | DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, +2 more | size: xs\|sm*\|md |
48
+ | field | Field, FieldLabel, FieldTitle, FieldContent, FieldDescription, FieldError, +6 more | size: xs\|sm*\|md · orientation: vertical*\|horizontal\|responsive · invalid · disabled · loading |
49
+ | info-tooltip | InfoTooltip, InfoTooltipContent, InfoTooltipProvider, InfoTooltipTrigger | variant: primary\|neutral\|inverse\|danger\|info · size: sm\|md\|lg · side: top\|bottom\|left\|right · align: start\|center\|end · showArrow |
50
+ | inline-alert | InlineAlert, InlineAlertIcon, InlineAlertContent, InlineAlertHeading, InlineAlertTitle, InlineAlertDescription, +2 more | variant: primary*\|neutral\|danger\|success\|warning\|info\|away · appearance: solid\|soft\|outline\|default* · layout: horizontal*\|vertical |
51
+ | input | Input, InputProvider, InputShell | size: xs\|sm*\|md |
52
+ | input-group | InputGroup, InputGroupProvider, InputGroupShell, InputGroupSlot, InputGroupControl, InputGroupTextarea, +9 more | invalid · disabled · loading · multiline |
53
+ | input-otp | InputOTP | variant: outline*\|filled · size: lg*\|md\|sm · shape: rounded*\|pill\|square\|underline · invalid |
54
+ | input-stepper | InputStepper | variant: connected\|separated · size: xs\|sm\|md · value/onValueChange · defaultValue · min · max · step · invalid · disabled |
55
+ | label | Label, LabelBlock, LabelMain, LabelIcon, LabelRequired, LabelOptional, +4 more | size: xs\|sm\|md |
56
+ | pagination | Pagination, PaginationContent, PaginationLink, PaginationFirst, PaginationPrevious, PaginationNext, +2 more | variant: compact\|compact-grouped* · shape: rounded*\|pill |
57
+ | password-strength | PasswordStrength | size: xs\|sm\|md* |
58
+ | phone-input | PhoneInput | size: xs\|sm\|md · invalid · disabled · loading · showHelperIcon |
59
+ | progress | Progress | variant: primary*\|info\|success\|warning\|danger\|away\|neutral\|neutral-static\|neutral-soft\|inverse\|inverse-static\|inverse-soft · appearance: solid*\|gradient · size: xs\|sm\|md*\|lg · shape: sharp\|pill* · type: line*\|circle · value · max · duration |
60
+ | radio | Radio | variant: primary*\|neutral\|danger\|success\|inverse · size: xs\|sm\|md* |
61
+ | radio-group | RadioGroup | variant: primary*\|neutral\|danger · size: xs\|sm\|md* · placement: left*\|right · disabled · invalid |
62
+ | scroll-area | ScrollArea, ScrollBar | appearance: filled*\|ghost · size: sm\|md*\|lg · orientation: vertical*\|horizontal\|both · fade |
63
+ | segmented-control | SegmentedControl, SegmentedControlItem | variant: primary*\|neutral · appearance: flat*\|grouped · size: xs\|sm\|md*\|lg\|xl · shape: rounded*\|pill · value/onValueChange |
64
+ | select | Select, SelectProvider, SelectShell, SelectContent, SelectGroup, SelectItem, +4 more | variant: default*\|compact · size: xs\|sm\|md · loading · invalid |
65
+ | separator | Separator | align: start\|center*\|end |
66
+ | social-login-button | SocialLoginButton | appearance: colorful\|black\|white · size: lg*\|md · shape: rounded*\|pill\|square · iconOnly · brand (required) · config (required) |
67
+ | spinner | Spinner | variant: primary*\|info\|success\|warning\|danger\|away\|neutral\|neutral-static\|neutral-soft\|inverse\|inverse-static\|inverse-soft · appearance: solid\|gradient* · size: xs\|sm*\|md\|lg · cap: sharp\|rounded* · line: short\|long* · animation: spin\|pulse*\|tick |
68
+ | status-badge | StatusBadge | variant: primary*\|danger\|success\|warning\|info\|highlighted\|away\|verified\|cyan\|lime\|neutral\|white · size: xs\|sm\|md* |
69
+ | switch | Switch | variant: primary*\|info\|neutral\|inverse\|semantic · size: md*\|sm\|xs · shape: pill*\|rounded · thumbType: short*\|long · ioTrigger · thumbIcon |
70
+ | switch-group | SwitchGroup | size: xs\|sm\|md* · ioTrigger · placement: left*\|right |
71
+ | tab-menu | TabMenu, TabMenuItem | variant: vertical-button*\|vertical-line\|horizontal-line\|horizontal-button · size: sm\|md*\|lg · value/onValueChange · indicator: left\|top\|bottom |
72
+ | text-link | TextLink | variant: primary*\|neutral\|inverse\|danger\|success\|info · size: xs\|sm\|md*\|lg · leadingIcon/trailingIcon · visited · disabled · underline |
73
+ | textarea | Textarea | size: xs\|sm*\|md · resizable: x\|y\|both · loading |
74
+ | toast | Toast, ToastBody, ToastIcon, ToastContent, ToastTitle, ToastDescription, +3 more | variant: primary*\|neutral\|danger\|success\|warning\|info\|away · appearance: solid*\|soft\|outline\|default |
75
+ | tooltip | Tooltip, TooltipContent, TooltipProvider, TooltipTrigger | TooltipContent: variant: primary*\|neutral\|inverse\|danger\|info · showArrow · side: top\|bottom*\|left\|right · sideOffset |
76
+
77
+ <!-- END GENERATED:INVENTORY -->
78
+
79
+ > 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`) - installed automatically as dependencies of the components that need them.
80
+
81
+ ## Icons
82
+
83
+ **Icons go through props, never as children next to text.** The component sizes the icon per its `size` - never add `size-4` / `w-4 h-4` to an icon inside a component. Import UI icons from `@create-ui/assets/icons` (Remix `Ri*`, e.g. `RiSearchLine`) - **never `lucide-react`**. Brand / flag / payment / social marks come from `@create-ui/assets/{social,flags,payments,brands,badges,banks,crypto}`.
11
84
 
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
-
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.
17
-
18
- ## Current Project Context
19
-
20
- Run the `info` command to read the project's config and installed components:
85
+ ```tsx
86
+ // Correct - icon props
87
+ <Badge variant="success" leadingIcon={<RiCheckLine />}>Verified</Badge>
88
+ <Button appearance="outline" trailingIcon={<RiArrowRightLine />}>Docs</Button>
21
89
 
22
- ```bash
23
- npx @create-ui/cli info
90
+ // Incorrect - NEVER put the icon in children next to text
91
+ <Badge variant="success"><RiCheckLine /> Verified</Badge>
24
92
  ```
25
93
 
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.)
27
-
28
- ## Principles
29
-
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`.
32
- 3. **Use built-in props before custom classes.** `variant`, `appearance`, `size`, `shape` on `Button`; `size` on `Field` — reach for these before `className`.
33
- 4. **Use semantic tokens, never raw values.** `bg-static`, `text-body`, `bg-primary-base` — never `bg-blue-500` or hardcoded hex.
34
-
35
- ## Critical Rules
36
-
37
- These rules are **always enforced**. Each links to a file with Incorrect/Correct code pairs.
38
-
39
- ### Styling & Tailwind [styling.md](./rules/styling.md)
40
-
41
- - **Use Create UI semantic tokens.** Surfaces `bg-static` / `bg-weak`, text `text-body` / `text-placeholder`, primary `bg-primary-base`. Never raw colors.
42
- - **`className` for layout, not styling.** Don't override a component's colors or typography.
43
- - **No `space-x-*` / `space-y-*`.** Use `flex` + `gap-*` (`flex flex-col gap-4` for vertical stacks).
44
- - **Use `size-*` when width equals height.** `size-10`, not `w-10 h-10`.
45
- - **Focus is `outline-*`, never `ring-*`.** Components use `outline-2 outline-transparent` + `focus-visible:outline-primary-700`.
46
- - **Semantic spacing classes only when Figma references a token.** `var(--component/sm,8px)` `gap-component-sm`; a static `space-space-4` `gap-4`.
47
- - **Use `cn()` for conditional classes.** Not manual template-literal ternaries.
48
-
49
- ### Forms & Inputs → [forms.md](./rules/forms.md)
50
-
51
- - **Forms use `FieldGroup` + `Field`.** Never raw `div` + `space-y-*` for form layout.
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.
53
- - **`InputGroup` uses `InputGroupControl` / `InputGroupTextarea`.** Never a raw `Input` / `Textarea` inside `InputGroup`.
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`.
55
- - **`FieldSet` + `FieldLegend` group related checkboxes/radios.** Not a `div` with a heading.
56
- - **Validation: `data-invalid` on `Field`, `aria-invalid` on the control.** Disabled: `data-disabled` on `Field`, `disabled` on the control.
57
-
58
- ### Component Structure [composition.md](./rules/composition.md)
59
-
60
- - **Items always inside their Group.** `SelectItem` `SelectGroup`; `DropdownMenuItem` → `DropdownMenuGroup`; `CommandItem` → `CommandGroup`.
61
- - **Use `asChild` for custom triggers.** Polymorphism is `asChild` + Radix `Slot` `<Button asChild><Link href="/x">Docs</Link></Button>`.
62
- - **`Button` HAS a real `loading` prop.** `<Button loading>Saving…</Button>` renders a Spinner and blocks interaction don't compose your own.
63
- - **Use the right `Button` API.** `variant` (`primary` / `danger` / `success` / `neutral-solid` / …) + `appearance` (`solid` / `outline` / `ghost` / `soft`). There is no `variant="outline"`/`"destructive"`/`"secondary"`.
64
- - **`Avatar` always needs `AvatarFallback`.**
65
- - **Prefer components over custom markup.** Callouts → `InlineAlert`; toasts → `Toast`; dividers → `Separator`; tags → `Badge`; removable tags → `Chip`; loading → `Spinner`.
66
-
67
- ### Icons → [icons.md](./rules/icons.md)
68
-
69
- - **Icons in `Button` go through props.** `leadingIcon` / `trailingIcon` (and `iconOnly` for icon-only buttons) — no `data-icon`.
70
- - **No sizing classes on icons inside components.** The component sets icon size via CVA no `size-4` / `w-4 h-4`.
71
- - **Pass icons as components, not string keys.** `icon={CheckIcon}`, never `icon="check"`.
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,…}`.
73
-
74
- ## Key Patterns
75
-
76
- The most common idioms that differentiate correct Create UI code. For edge cases, see the linked rule files above.
94
+ <!-- BEGIN GENERATED:ICON-MATRIX -->
95
+
96
+ | Component | leadingIcon | trailingIcon | iconOnly |
97
+ | --- | --- | --- | --- |
98
+ | AppStoreBadge | - | - | yes |
99
+ | Badge | yes | yes | yes |
100
+ | BreadcrumbItem | yes | yes | - |
101
+ | Button | yes | yes | yes |
102
+ | ButtonGroupItem | yes | yes | yes |
103
+ | CreditCardInput | yes | - | - |
104
+ | DateInput | yes | - | - |
105
+ | SegmentedControlItem | yes | yes | yes |
106
+ | SocialLoginButton | - | - | yes |
107
+ | TabMenuItem | yes | yes | - |
108
+ | TextLink | yes | yes | - |
109
+
110
+ Components NOT in this table take no leadingIcon/trailingIcon props:
111
+
112
+ - `Chip` takes its icon or `Avatar` as the FIRST CHILD (auto-slotted into the lead slot). No icon props.
113
+ - `InlineAlert` and `Toast` use dedicated icon subcomponents (`InlineAlertIcon`, `ToastIcon`); `FieldHelper` and `AccordionTrigger` take an `icon` prop; `InputGroupKbd` inherits Badge's icon props.
114
+ - Everything else: icons are not part of the component's API - put the icon next to it in your own markup.
115
+
116
+ <!-- END GENERATED:ICON-MATRIX -->
117
+
118
+ ## Cross-cutting invariants
119
+
120
+ - **Prop taxonomy**: `variant` = color intent (`primary`, `danger`, `success`, `neutral-*`, ...) · `appearance` = fill weight (`solid` / `outline` / `soft` / `ghost`) · `size` · `shape`. **There is no `variant="outline"`, `variant="secondary"`, or `variant="destructive"`** - an outline style is `appearance="outline"`, a destructive action is `variant="danger"`.
121
+ - **`Field` owns size; children inherit it.** Set `size` (`xs` | `sm` | `md`) once on `Field`; `Input`, `Select`, `Textarea`, labels and helpers read it via context. Never re-set or downgrade size on a child.
122
+ - **Validation**: `data-invalid` on `Field`, `aria-invalid` on the control. Disabled: `data-disabled` on `Field`, `disabled` on the control.
123
+ - **`Button` has a real `loading` prop** - `<Button loading>Saving...</Button>`. Don't compose spinners into buttons.
124
+ - **Use `asChild` for custom triggers/links** - `<Button asChild><Link href="/x">Docs</Link></Button>`.
125
+ - **Items live inside their Group**: `SelectItem` → `SelectGroup` and `CommandItem` → `CommandGroup` are structural (always wrap); `DropdownMenuGroup` is semantic grouping - a lone `DropdownMenuItem` may sit directly in `DropdownMenuContent`.
126
+ - **Semantic tokens only, never raw colors.** Surfaces `bg-static` / `bg-weak` / `bg-light`, text `text-strongest` / `text-body` / `text-placeholder` / `text-disabled` / `text-static`, borders `border-weak` / `border-light`, primary `bg-primary-base` / `text-primary-base` / `bg-primary-weakest`, status `{error,success,warning,info,away,verified,highlighted}-{base,weak,weakest}`. Never `bg-blue-500`, never hex.
127
+ - **The theme is already chosen - never ask for or re-pick the brand color.** The project's primary and neutral colors were selected at `init` (primary: `indigo`* / `blue` / `lime` / `green` / `red` / `orange` / `yellow` / `cyan`; neutral: `gray`* / `slate` / `zinc` / `base` / `stone`) and live as tokens in the global CSS. Use `bg-primary-base` / `text-primary-base` / `border-primary-*` for any accent - they already render that choice. Do NOT ask the user "what color/theme", do NOT offer or invent a color (there is no `violet` etc. - the set above is fixed), and do NOT rewrite the theme token values in the CSS to "apply" a color. Switching the whole project's theme is `npx @create-ui/cli init --theme <name>` / `--neutral <name>` - only when the user explicitly asks for it.
128
+ - **Focus is `outline-*`, never `ring-*`.**
129
+ - **Spacing**: vertical stacks are `flex flex-col gap-*` (never `space-y-*`); `size-10` not `w-10 h-10`; semantic spacing classes (`gap-component-sm`) only when a Figma design references a token - otherwise standard Tailwind (`gap-4`).
130
+ - **`className` is for layout, not restyling** - don't override a component's colors or typography; reach for `variant`/`appearance` first.
131
+
132
+ ## Use the full component API
133
+
134
+ Every component exposes many axes - `variant`, `appearance`, `size`, `shape`, state flags, often `orientation` / `layout` / `placement`, and more - and the set differs per component. **Defaults are a baseline, not the answer**; one size and one variant everywhere reads as a wireframe. Before building with a component, read its `reference/<component>.md` prop table and deliberately use the axes that fit the design. The heuristics below show the *kind* of judgment, not a closed list - `shape` and any component-specific axis count just as much:
135
+
136
+ - **`size`** tracks density / prominence: small for dense or secondary chrome, the default for standard body UI, large for the primary CTA or hero.
137
+ - **`appearance`** tracks hierarchy: exactly one `solid` (primary) action per group, secondary `soft` / `outline`, tertiary or dismiss `ghost`.
138
+ - **`variant`** tracks intent: `primary` for the main action, `neutral-*` for neutral chrome, semantic (`danger` / `success` / `warning` / `info`) only for real meaning - status on Badge / InlineAlert / Toast rides `variant`, never raw color.
139
+ - **State is a prop, not markup**: reach for built-in `loading` / `invalid` (+ `aria-invalid`) / `disabled` / `selected` / `checked` / `readOnly` when context implies them.
140
+ - **Everything else is a real choice too** - `shape`, `orientation` / `layout` (e.g. `Field orientation="horizontal"`, `InlineAlert layout="vertical"`, `TabMenu variant="horizontal-line"` vs `"vertical-button"`), `placement`, and whatever else the component's reference lists. Match it to the design; don't leave it at default out of habit.
141
+
142
+ Each `reference/<component>.md` canonical example already spans its component's axes - mirror that range, don't collapse to defaults. `rules/design.md` has the per-component richness checklist and anti-patterns.
143
+
144
+ ## Never hand-roll
145
+
146
+ | You need | Use (never raw markup) |
147
+ | --- | --- |
148
+ | Tabs | `TabMenu` + `TabMenuItem` + your own value-keyed panels (recipe below) |
149
+ | Toggle between 2-7 options | `SegmentedControl` + `SegmentedControlItem` (`value`/`onValueChange`) - never a row of `Button`s with manual active state |
150
+ | Tag / label | `Badge` (icons via `leadingIcon`/`trailingIcon`) |
151
+ | Removable / interactive tag | `Chip` (icon or `Avatar` as FIRST CHILD, `closable`/`onClose`) |
152
+ | Status dot | `StatusBadge` (dot only - label goes next to it) |
153
+ | Callout / inline banner | `InlineAlert` (+`InlineAlertIcon`/`Title`/`Description`) |
154
+ | Notification | `Toast` (+`ToastIcon`/`ToastTitle`/`ToastAction`) |
155
+ | Avatar initials | `Avatar` + `AvatarText` (**`AvatarFallback` does not exist**) |
156
+ | Loading state | `Spinner`, or `Button loading` |
157
+ | Divider | `Separator` |
158
+ | Menu | `DropdownMenu` family |
159
+ | Command palette | `Command` (inline) / `CommandDialog` (modal) |
160
+
161
+ ## Recipes
162
+
163
+ **Tabs with content panels** - `TabMenu` renders the tab list only; you render the panels, keyed by value:
77
164
 
78
165
  ```tsx
79
- import { Button } from "@/components/ui/button"
80
- import { Field, FieldGroup, FieldLabel, FieldDescription } from "@/components/ui/field"
81
- import { Input } from "@/components/ui/input"
82
- import { RiArrowRightLine, RiSearchLine } from "@create-ui/assets/icons"
83
- import Link from "next/link"
84
-
85
- // Button: appearance + icon props + loading. No variant="outline", no data-icon.
86
- <Button appearance="outline" leadingIcon={<RiSearchLine />}>Search</Button>
87
- <Button loading>Saving…</Button>
88
- <Button asChild appearance="ghost" trailingIcon={<RiArrowRightLine />}>
89
- <Link href="/docs">Docs</Link>
90
- </Button>
91
-
92
- // Forms: FieldGroup + Field. Field owns size; Input inherits it.
93
- <FieldGroup>
94
- <Field size="md">
95
- <FieldLabel htmlFor="email">Email</FieldLabel>
96
- <Input id="email" type="email" />
97
- <FieldDescription>We'll never share it.</FieldDescription>
98
- </Field>
99
- </FieldGroup>
100
-
101
- // Spacing: gap-component-sm only when Figma uses a token; otherwise gap-4.
102
- <div className="flex flex-col gap-4">…</div>
103
-
104
- // Conditional classes via cn().
105
- <div className={cn("rounded-lg p-4", isActive && "bg-weak")} />
166
+ const [tab, setTab] = React.useState("overview")
167
+
168
+ <TabMenu variant="horizontal-line" indicator="bottom" value={tab} onValueChange={setTab}>
169
+ <TabMenuItem value="overview" label="Overview" />
170
+ <TabMenuItem value="billing" label="Billing" leadingIcon={<RiBankCardLine />} />
171
+ </TabMenu>
172
+ {tab === "overview" && <OverviewPanel />}
173
+ {tab === "billing" && <BillingPanel />}
106
174
  ```
107
175
 
108
- ## Component Selection
109
-
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.
132
-
133
- ## Key Fields (components.json)
134
-
135
- `info` surfaces these fields — read them before writing imports or advising on directives:
136
-
137
- - **`aliases`** — the import prefixes (`components`, `utils`, `ui`, `lib`, `hooks`). Use the actual aliases (e.g. `@/components/ui`, `@/lib/utils`), never hardcode.
138
- - **`rsc`** — when `true`, components using `useState`, `useEffect`, event handlers, or browser APIs need `"use client"` at the top.
139
- - **`tsx`** — whether components are emitted as `.tsx` (default `true`).
140
- - **`tailwind.css`** — the global CSS file where tokens are defined. Edit this file; never create a new one.
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.
142
- - **`menuColor`** (`default` | `inverted`) / **`menuAccent`** (`subtle` | `bold`) — menu surface treatment.
176
+ **Billing / pricing toggle** - the active pill slides between items in both appearances; `appearance="grouped"` adds the padded `bg-weak` container (the classic pricing-toggle look):
143
177
 
144
- **`@createui` is the only registry.** There is no `registries` field to configure — never add one or point the project at another registry.
178
+ ```tsx
179
+ const [billing, setBilling] = React.useState("monthly")
145
180
 
146
- See [cli.md `info`](./cli.md) and [customization.md](./customization.md) for the full reference.
181
+ <SegmentedControl appearance="grouped" variant="neutral" value={billing} onValueChange={setBilling}>
182
+ <SegmentedControlItem value="monthly">Monthly</SegmentedControlItem>
183
+ <SegmentedControlItem value="yearly">Yearly</SegmentedControlItem>
184
+ </SegmentedControl>
185
+ ```
147
186
 
148
- ## Workflow
187
+ **Showcase-quality switch** - bare `<Switch />` is for dense forms; showcases should exercise the richer API (see `reference/switch.md`). Labelled apply-immediately rows use `SwitchGroup`; the `Field` composition below is for submit-to-save forms:
149
188
 
150
- 1. **Get project context** — `npx @create-ui/cli info`.
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.
152
- 3. **Find components** — `npx @create-ui/cli search @createui -q "<query>"`.
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.
154
- 5. **Add** — `npx @create-ui/cli add <name>`.
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.
189
+ ```tsx
190
+ <Field size="md" orientation="horizontal">
191
+ <FieldContent>
192
+ <FieldLabel htmlFor="2fa">Enforce two-factor auth</FieldLabel>
193
+ </FieldContent>
194
+ <Switch id="2fa" thumbIcon defaultChecked />
195
+ </Field>
196
+ <Switch variant="semantic" thumbType="long" ioTrigger aria-label="Accept" />
197
+ ```
157
198
 
158
- ## Updating Components
199
+ (`Field` size does not cascade to `Switch` - pair them explicitly, or use `SwitchGroup` which pairs both automatically.)
159
200
 
160
- To keep local edits while pulling upstream changes, use the `diff` command — **never fetch raw files manually.**
201
+ ## components.json keys
161
202
 
162
- 1. `npx @create-ui/cli diff` list installed components that have updates.
163
- 2. `npx @create-ui/cli diff <name>` show what changed upstream for that component.
164
- 3. Decide per component: no local changes re-add; has local changes read the local file, study the diff, apply upstream changes while preserving your edits.
165
- 4. `npx @create-ui/cli add <name> --overwrite` replaces files **only with the user's explicit approval.**
203
+ - **`aliases`** - import prefixes (`ui`, `components`, `utils`, `lib`, `hooks`). Use the project's actual aliases, never hardcode.
204
+ - **`rsc`** - when `true`, components using state/effects/events need `"use client"`. Keep the boundary tight: isolate the interactive piece in its own file rather than hoisting the directive over a whole static section.
205
+ - **`tailwind.css`** - the global CSS file where tokens live. Edit it; never create a new one. Never rewrite the primary/neutral theme token values here to change the brand color - that is an `init` choice (see invariants above).
206
+ - **`iconLibrary`** - `createui` (`@create-ui/assets`). Never swap registry imports to another icon package.
207
+ - **`menuColor`** (`default` | `inverted`) / **`menuAccent`** (`subtle` | `bold`) - menu surface treatment.
166
208
 
167
- ## Quick Reference
209
+ ## CLI quick reference
168
210
 
169
211
  ```bash
170
- # Initialize an existing project (writes components.json, installs deps).
171
- npx @create-ui/cli init
172
- npx @create-ui/cli init --theme indigo --neutral gray --font-variant v1
173
-
174
- # Scaffold a new project (missing name/template/theme are prompted interactively).
175
- npx @create-ui/cli create my-app --template next
176
- npx @create-ui/cli create
177
-
178
- # Add components (items are always bare names).
179
- npx @create-ui/cli add button select dropdown-menu
180
- npx @create-ui/cli add --all
181
-
182
- # Inspect the registry (@createui is the registry argument for search/list only).
212
+ npx @create-ui/cli init # existing project (writes components.json)
213
+ npx @create-ui/cli create my-app --template next # new project (next | start | vite)
214
+ npx @create-ui/cli add button select # add components (bare names)
183
215
  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
186
- npx @create-ui/cli diff button
187
-
188
- # Migrate (e.g. consolidate radix imports, or switch icon library).
189
- npx @create-ui/cli migrate --list
190
-
191
- # Set up the MCP server for your client.
192
- npx @create-ui/cli mcp init --client claude
216
+ npx @create-ui/cli view button # item metadata + files
217
+ npx @create-ui/cli diff button # upstream changes for installed items
218
+ npx @create-ui/cli mcp init --client claude # set up the MCP server
193
219
  ```
194
220
 
195
- **Primary themes:** indigo (default), blue, lime, green, red, orange, yellow, cyan
196
- **Neutral themes:** gray (default), slate, zinc, base, stone
197
- **Templates:** `next`, `start`, `vite` (plus `next-monorepo` for `init`)
221
+ `add --overwrite` replaces files - only with the user's explicit approval. To update, prefer `diff` and merge upstream changes while preserving local edits. Primary themes: indigo (default), blue, lime, green, red, orange, yellow, cyan. Neutrals: gray (default), slate, zinc, base, stone.
198
222
 
199
- ## Detailed References
223
+ ## Detailed references
200
224
 
201
- - [cli.md](./cli.md) every command and flag (init, create, add, diff, view, search, migrate, info, mcp, skill).
202
- - [mcp.md](./mcp.md) the MCP server, `mcp init` clients, and the available MCP tools.
203
- - [customization.md](./customization.md) theming, the `--color-*` / semantic tokens, radius, and dark mode.
204
- - [rules/styling.md](./rules/styling.md) semantic tokens, `className` scope, spacing, `size-*`, `outline-*` focus, `cn()`.
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.
207
- - [rules/icons.md](./rules/icons.md) `leadingIcon` / `trailingIcon`, icon sizing, passing icons as components.
225
+ - [reference/](./reference/) - **per-component API (generated from source - read before first use)**.
226
+ - [rules/design.md](./rules/design.md) - design taste: hero/CTA/footer/pricing recipes, richness checklist, anti-patterns.
227
+ - [rules/icons.md](./rules/icons.md) - icon props per component, sizing, assets packages.
228
+ - [rules/composition.md](./rules/composition.md) - groups, overlays, TabMenu, Avatar, InlineAlert, Toast.
229
+ - [rules/forms.md](./rules/forms.md) - FieldGroup/Field, size cascade, InputGroup, SegmentedControl, validation.
230
+ - [rules/styling.md](./rules/styling.md) - semantic tokens, className scope, spacing, focus.
231
+ - [cli.md](./cli.md) - every command and flag. [mcp.md](./mcp.md) - MCP tools and workflow. [customization.md](./customization.md) - theming and tokens.
208
232
 
209
233
  ## Resources
210
234
 
@@ -1,5 +1,5 @@
1
1
  interface:
2
2
  display_name: "Create UI"
3
- short_description: "Manages Create UI components adding, searching, updating, styling, and composing UI from the @createui registry."
3
+ short_description: "Create UI component library: per-component API references, composition rules, semantic tokens, and design recipes for building UI with the @createui registry."
4
4
  icon_small: "./assets/createui-small.png"
5
5
  icon_large: "./assets/createui.png"