# warcraftcn-ui-svelte > A Svelte 5 UI component library styled after the classic Warcraft III RTS aesthetics — fantasy borders, scroll textures, faction-based color themes, and gold/amber color palettes. - Svelte Port Repository: https://github.com/magooney-loon/warcraftcn-ui-svelte - Original Repository (React/Next.js): https://github.com/TheOrcDev/warcraftcn-ui - Website: https://warcraftcn.com - License: MIT ## Installation ```bash npm install warcraftcn-ui-svelte ``` Requires Svelte 5 as a peer dependency. Designed for Tailwind CSS v4. ## Quick Setup Add the `` to your root layout for toast notifications: ```svelte ``` Import the library's CSS in your app (e.g., `app.html` or root layout): ```ts import 'warcraftcn-ui-svelte/warcraft.css'; ``` ## Faction Theming Many components accept a `faction` prop with unique styling per faction: | Faction | Description | | --------- | ---------------------------------- | | default | Gold/amber — standard Warcraft III | | orc | Red tones — Orcish Horde | | human | Blue tones — Human Alliance | | elf | Green tones — Night Elf | | undead | Purple tones — Undead Scourge | --- ## Components All components are exported from `warcraftcn-ui-svelte`. ### Accordion Expandable/collapsible sections with animated sword/shield/rune icons and scroll textures. ```svelte Section Title Content here ``` **Accordion Props:** - `type?: 'single' | 'multiple'` — Single allows one open item; multiple allows any number. Default: `'multiple'`. - `class?: string` **AccordionItem Props:** - `value: string` — Unique identifier for this item. - `class?: string` **AccordionTrigger Props:** - `value: string` — Must match the parent AccordionItem's value. - `icon?: 'sword' | 'shield' | 'rune-stone'` — Icon displayed on the trigger. Default: `'sword'`. - `class?: string` **AccordionContent Props:** - `value: string` — Must match the parent AccordionItem's value. - `class?: string` --- ### Avatar Faction-themed avatar with image, fallback slot, and frame overlay. ```svelte H ``` **Props:** - `src?: string` — Image URL. If empty, shows the fallback snippet. - `alt?: string` — Image alt text. - `fallback?: Snippet` — Content shown when no `src` is provided. - `faction?: 'default' | 'orc' | 'elf' | 'human' | 'undead'` — Default: `'default'`. - `size?: 'sm' | 'md' | 'lg'` — Default: `'md'`. - `class?: string` --- ### Badge Inline badge with variant, faction, size, and shape options. ```svelte Quest Danger Alliance Horde ``` **Props:** - `variant?: 'default' | 'secondary' | 'destructive' | 'outline'` — Default: `'default'`. - `size?: 'default' | 'sm' | 'lg'` — Default: `'default'`. - `faction?: 'none' | 'alliance' | 'horde'` — Default: `'none'`. - `shape?: 'default' | 'shield' | 'banner'` — Default: `'default'`. - `class?: string` --- ### Button Fantasy-themed button with `border-image` frame styles. ```svelte ``` **Props:** - `variant?: 'default' | 'frame'` — Default uses standard border; frame uses the ornate frame border-image. Default: `'default'`. - `class?: string` - `style?: string` - All native `

Defeat the dragon lord.

3 remaining ``` **Card Props:** - `size?: 'default' | 'sm'` — Controls border thickness and padding. Default: `'default'`. - `class?: string` **CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter Props:** - `class?: string` - All accept `children: Snippet`. --- ### Checkbox Faction-themed checkbox with bindable `checked` state. ```svelte Accept quest terms ``` **Props:** - `checked?: boolean` — Bindable. Default: `false`. - `faction?: 'default' | 'orc' | 'elf' | 'human' | 'undead'` — Default: `'default'`. - `disabled?: boolean` — Default: `false`. - `id?: string` - `class?: string` --- ### Cursor Wraps content with a faction-based custom CSS cursor. ```svelte

This area has the Orc cursor

``` **Props:** - `faction?: 'default' | 'orc' | 'elf' | 'human' | 'undead'` — Default: `'default'`. - `class?: string` --- ### Dropdown Menu Full dropdown menu with fantasy-themed borders, click-outside closing, and keyboard support. ```svelte Actions Edit ⌘E Delete ``` **DropdownMenu Props:** - `class?: string` **DropdownMenuTrigger Props:** - `class?: string` **DropdownMenuContent Props:** - `class?: string` - Uses `clickOutside` action to auto-close. **DropdownMenuItem Props:** - `disabled?: boolean` - `class?: string` - Clicking an item closes the menu. **DropdownMenuLabel Props:** - `class?: string` **DropdownMenuSeparator Props:** - `class?: string` **DropdownMenuShortcut Props:** - `class?: string` --- ### Input Text input with Warcraft-themed `border-image` frame. ```svelte ``` **Props:** - `type?: string` — HTML input type. Default: `'text'`. - `class?: string` - All native `` HTML attributes are forwarded. --- ### Label Fantasy-styled label with required indicator and muted variant. ```svelte ``` **Props:** - `variant?: 'default' | 'muted'` — Default shows amber text with glow; muted shows dimmer text. Default: `'default'`. - `required?: boolean` — Shows a red ✦ indicator. Default: `false`. - `disabled?: boolean` — Adds disabled styling. Default: `false`. - `class?: string` --- ### Modal Modal dialog built on top of Card. Supports backdrop dismiss, Escape key, and two sizes. ```svelte Quest Offer A mysterious task...

Retrieve the enchanted amulet.

``` **Modal Props:** - `open?: boolean` — Bindable. Controls the open/closed state. Default: `false`. - `class?: string` **ModalTrigger Props:** - `class?: string` - All native `