# Urbicon UI – Full API Reference for LLMs
> This file is optimized for LLM consumption. It contains everything needed to correctly generate code using Urbicon UI.
## Installation
Urbicon UI packages are published on the public npm registry — no registry configuration needed:
```bash
bun add @urbicon-ui/blocks @urbicon-ui/i18n
```
Requirements: Svelte 5, Vite and Tailwind 4. SvelteKit is **not** required — `blocks`, `table` and
`i18n` import neither `$app/*` nor `@sveltejs/kit`, so a plain Vite + Svelte project runs them
(`@urbicon-ui/auth` and `@urbicon-ui/sveltekit-utils` are the SvelteKit-bound packages).
In a SvelteKit project the `sv` add-on does the packages **and** the CSS wiring below in one step
(non-interactive form — pre-answer Tailwind's plugin prompt so the run never blocks). The add-on is
SvelteKit-only; elsewhere use the install plus the CSS setup below:
```bash
bunx sv add tailwindcss=plugins:none @urbicon-ui
```
CSS setup (in your app's root layout or entry CSS) — already done for you on the add-on path. Your
app owns the Tailwind import and it MUST come first; the Urbicon UI CSS that follows depends on it
and overrides its defaults:
```css
@import 'tailwindcss';
@import '@urbicon-ui/blocks/style/index.css'; /* tokens + @source directives */
@import '@urbicon-ui/table/style/index.css'; /* only if you use @urbicon-ui/table */
@import '@urbicon-ui/auth/style/index.css'; /* only if you use @urbicon-ui/auth */
```
Import the single `style/index.css` — **not** the `foundation`/`semantic`/`interaction`
subfiles. `index.css` ships the design tokens, global classes (`.sr-only`, mint styles),
and the Tailwind `@source` directives that make Tailwind scan the component classes inside
`node_modules`. You do **not** need to add any manual `@source` directives; importing the
subfiles (which omit those directives) is the usual cause of responsive utilities like
`lg:hidden` going missing in production.
## Import Pattern
ALWAYS import from the package root:
```svelte
```
NEVER import from internal paths like `@urbicon-ui/blocks/primitives/Button`.
---
## Shared API Grammar
Every component follows a predictable API. Learn once, apply everywhere.
### `intent` – Semantic Color
Values: `primary` | `secondary` | `success` | `warning` | `danger` | `neutral`
Default: `neutral` (action elements), `primary` (form/decorative elements)
### `variant` – Visual Weight
Values: `filled` | `outlined` | `ghost` | `text` (component-dependent)
- `filled`: Solid background, highest emphasis
- `outlined`: Border only, transparent background
- `ghost`: No border, no background
- `text`: Minimal, text-only (Button only)
### `size` – Dimensions
Standard scale: `xs` | `sm` | `md` | `lg` | `xl`
Default: `md` for all components.
| Size | Height | Font |
|------|--------|----------|
| xs | h-6 | text-xs |
| sm | h-8 | text-sm |
| md | h-10 | text-base|
| lg | h-12 | text-lg |
| xl | h-14 | text-xl |
### `unstyled` – Strip All Default Styles
```svelte
```
### `slotClasses` – Override Specific Slots
Each component documents its slots. Override without losing other styles:
```svelte
...
```
### `mint` – Micro-Interactions (opt-in)
No setup required — unknown names demand-load the built-in set on first use.
Values: `'scale'` | `'translate'` | `'rotate'` | `'glow'` | `'pulse'` | `'wiggle'` (hover, held
while the pointer stays) | `'bounce'` | `'shake'` | `'ripple'` (click, one-shot) | `'none'` |
array of these | `{ name, config }` entries with `duration`/`easing` (`intensity`: scale only).
```svelte
Interactive
```
### `preset` – Apply a Named Project Style
Values: any preset name registered via `` (project-specific).
Presets are the correct escape hatch when you need a look **outside the semantic intent palette**
(`primary | secondary | success | warning | danger | neutral`) — e.g. a dark translucent overlay
button on top of an image, a brand-colored button, or a "glass" surface. They keep hover/active/
dark-mode logic coherent AND make the custom look reusable across the project.
```svelte
...
```
Registration happens once at the app root — see `Customization` → `Level 2: Presets` below.
**DO NOT** reach for `class="bg-…! hover:bg-…! active:bg-…!"` when the intent palette doesn't fit.
That pattern defeats the component's hover/active/dark-mode cascade and leaks visual decisions
into every call site. Register a preset instead.
### `class` – Additional CSS Classes
Merged with variant classes. Always available on every component.
---
## Component Families
Every component belongs to exactly one of the families in the table below. The family decides ARIA role, tier-system membership, and border-token source. Pick the right family up-front to avoid categorical bugs (button that looks like an input, menu that doubles as a listbox, avatar that mutates when commit-radii flatten).
### Family table
| Family | Members | ARIA role | Tier default | Border source |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------ |
| Action | Button, ButtonGroup, Menu, Toolbar, Toggle | `button`, `menu`, `menuitem`, `toolbar`, `switch` | `commit` (tier-aware) | Intent (`border-neutral` etc.) |
| Form | Input, Select, Combobox, Textarea, Checkbox, RadioGroup, Slider, FormField | `textbox`, `listbox`, `combobox`, `checkbox`, `radio`, `slider` | `modify` (tier-aware) | Surface (`border-border-subtle`) |
| Navigation | Breadcrumb, Pagination, SegmentGroup, Stepper, Tab, JourneyTimeline | `navigation`, `tablist`, `tab` | per-component (tier-aware) | mixed |
| Container | Card, Alert, Accordion, Collapsible, Dialog, Drawer, Popover, Tooltip, Sidebar, Separator, ConfirmDialog | `dialog`, `tooltip`, `region`, `aside` | `contain` (tier-aware) | Surface or Hairline |
| Feedback / Ambient | Toast, Spinner, Progress, Skeleton, Badge | `status`, `alert`, `progressbar` | **not tier-aware** (Badge is the documented edge case) | Intent (status-tinted) or none |
| Identity | Avatar | `img` or `button` | **not tier-aware** — own shape axis (`circle` / `rounded` / `square`) | none |
| Conversation | Chat, ChatMessageList, ChatMessage, PromptInput, StreamingMarkdown, CodeBlock, ToolCallCard, ReasoningDisclosure, CitationChip, A2UIView | `log`, `textbox`, `region` | mixed — `bridge` for the bubble, `contain` for the framed blocks, `modify` for the composer | Surface, on the outermost frame only |
### Action — interactive triggers
- ARIA: items dispatch `onSelect` / `onclick`; never hold a value.
- Border: must read as interactive even in `intent="neutral"` — uses Intent tokens (~neutral-500 in light).
- Industry analogue: Radix DropdownMenu, Headless UI Menu.
- Pick `Menu` for one-off action lists; `Button` for single triggers; `ButtonGroup` for grouped triggers; `Toolbar` for free-form bars; `Toggle` for bistable switches.
### Form — value holders
- ARIA: control owns a value, emits `onValueChange` / `bind:value`.
- Border: must read as a container, not a button — uses Surface tokens (~neutral-200 in light).
- Industry analogue: Radix Select / Combobox, Headless UI Listbox / Combobox.
- Pick `Select` for value pickers; `Combobox` for searchable Select; `Select multiple` for multi-select (NOT `Menu multiple`); `Menu` (Action family) for one-off action lists.
### Navigation — section / route selection
- ARIA: `