# cset-ui Full API Documentation > Complete API reference, prop interfaces, and Svelte 5 examples for all cset-ui primitives. ## 1. Setup & Installation ```bash pnpm add github:cset-cbt/cset-ui#v0.4.0 ``` `src/app.css`: ```css @import "tailwindcss"; @import "cset-ui/styles.css"; ``` All components can be imported from root: ```svelte ``` --- ## 2. Overlays & Actions ### Button Interactive button supporting 3 variants, 3 sizes, and automatic link mode. - Props: - `variant?: 'primary' | 'secondary' | 'danger'` (default: 'primary') - `size?: 'sm' | 'md' | 'lg'` (default: 'md') - `href?: string` (renders `` tag if provided) - `disabled?: boolean` (default: false) - `class?: string` - `onclick?: (event: MouseEvent) => void` - `children?: Snippet` - Example: ```svelte console.log('clicked')}> Save Changes View Dashboard Delete Account ``` ### Toast (Sonner-powered) Stacked toast notification system with automatic dismissal and interactive action buttons. - API: - `toast.success(message: string, options?: ToastOptions)` - `toast.error(message: string, options?: ToastOptions)` - `toast.warning(message: string, options?: ToastOptions)` - `toast.info(message: string, options?: ToastOptions)` - Example: ```svelte ``` ### Dialog (Modal) Accessible modal dialog with backdrop blur, focus trap, and clean snippet slots. - Props: - `bind:open={boolean}` - `title?: string` - `description?: string` - `content?: Snippet` - `footer?: Snippet` - Example: ```svelte isOpen = true}>Open Modal {#snippet content()} All team members will lose database access immediately. {/snippet} {#snippet footer()} isOpen = false}>Cancel Confirm {/snippet} ``` ### Sheet (Drawer) Slide-out drawer panel with full backdrop and direction selection. - Props: - `bind:open={boolean}` - `side?: 'left' | 'right' | 'top' | 'bottom'` (default: 'right') - `title?: string` - `description?: string` - Example: ```svelte ``` --- ## 3. Forms & Controls ### InputField Technical input component with monospace label, error state, and corner accents. - Props: - `label?: string` - `name?: string` - `type?: string` (default: 'text') - `placeholder?: string` - `bind:value={string}` - `error?: string` - `disabled?: boolean` - `required?: boolean` - Example: ```svelte ``` ### Select Dropdown selection component with technical blueprint styling. - Props: - `label?: string` - `items: Array<{ value: string; label: string }>` - `bind:value={string}` - `placeholder?: string` - Example: ```svelte ``` ### DatePicker Calendar date picker supporting ISO 8601 string value binding. - Props: - `label?: string` - `bind:value={string}` - `placeholder?: string` - Example: ```svelte ``` ### Switch (Toggle) Accessible boolean toggle with smooth physical slide motion. - Props: - `label?: string` - `bind:checked={boolean}` - `disabled?: boolean` - Example: ```svelte ``` --- ## 4. Data & Navigation ### Card The signature Blueprint container with corner-ticks and subtle surface glow. - Props: - `class?: string` - `children?: Snippet` - Example: ```svelte METRICS Memory Utilization Active heap: 142MB / 512MB allocated ``` ### Badge Status indicator tag. - Props: - `variant?: 'default' | 'success' | 'warning' | 'danger' | 'outline'` - `class?: string` - Example: ```svelte HEALTHY SYNCING DISCONNECTED ``` ### Avatar User avatar with fallback monogram. - Props: - `src?: string` - `name?: string` - `size?: 'sm' | 'md' | 'lg'` - Example: ```svelte ``` ### Tabs Tabbed navigation switcher. - Props: - `items: Array<{ value: string; label: string }>` - `bind:value={string}` - Example: ```svelte ``` ### Table Technical striped data table. - Props: - `headers: string[]` - `rows: Array>` - Example: ```svelte ``` ### PageHeader Consistent section and page header with eyebrow badge. - Props: - `eyebrow?: string` - `title: string` - `description?: string` - `actions?: Snippet` - Example: ```svelte {#snippet actions()} Export Audit Log {/snippet} ``` ### ThemeToggle Linear / Raycast inspired dark and light mode toggle integrating with W3C View Transitions API. - Props: - `class?: string` - Example: ```svelte ```
All team members will lose database access immediately.
Active heap: 142MB / 512MB allocated