# 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 to a private registry. Create a `bunfig.toml` in your project root: ```toml # bunfig.toml [install.scopes] "@urbicon-ui" = { url = "https://npm.urbicon.de/" } ``` Then install the packages: ```bash bun add @urbicon-ui/blocks @urbicon-ui/i18n ``` CSS setup (in your app's root layout or entry CSS). 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 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) Requires `registerDefaultMints()` call at app startup. Values: `'scale'` | `'ripple'` | `'translate'` | `'glow'` | `'none'` | array ```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 primitive belongs to exactly one of six families. 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 | `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 | ### 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: `