# 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 ``` ### 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 {#snippet content()}

All team members will lose database access immediately.

{/snippet} {#snippet footer()} {/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