🎨 Composable Svelte Components

This skill helps you select and integrate Composable Svelte components with props, state, and accessibility patterns for fast, cohesive UI development.

QUICK INSTALL
npx playbooks add skill jonathanbelolo/composable-svelte --skill composable-svelte-components

Composable Svelte Components instructions

Composable Svelte Components

This skill covers the UI component library for Composable Svelte applications.

For Specialized Components: See dedicated skills for graphics (3D), code (editors/media), charts (data viz), and maps (geospatial).

---

🚨 COMPLETE IMPORTS REFERENCE — ONLY THESE EXIST 🚨

This is the authoritative list of every component exported by the library. If a component or subcomponent is not listed here, it DOES NOT EXIST. Do not invent components. Do not assume subcomponents exist based on other libraries.

From @composable-svelte/core/components/ui

// Buttons
import { Button } from '@composable-svelte/core/components/ui';
import { ButtonGroup } from '@composable-svelte/core/components/ui';
import { IconButton } from '@composable-svelte/core/components/ui';

// Form inputs
import { Input } from '@composable-svelte/core/components/ui';
import { Label } from '@composable-svelte/core/components/ui';
import { Textarea } from '@composable-svelte/core/components/ui';
import { Checkbox } from '@composable-svelte/core/components/ui';
import { Radio, RadioGroup } from '@composable-svelte/core/components/ui';
import { Switch } from '@composable-svelte/core/components/ui';
import { Slider } from '@composable-svelte/core/components/ui';
import { Select } from '@composable-svelte/core/components/ui';       // Single component — NO SelectTrigger/SelectContent/SelectItem
import { Combobox } from '@composable-svelte/core/components/ui';

// Display
import { Badge } from '@composable-svelte/core/components/ui';
import { Avatar } from '@composable-svelte/core/components/ui';       // Single component — NO AvatarImage/AvatarFallback
import { Skeleton } from '@composable-svelte/core/components/ui';
import { Progress } from '@composable-svelte/core/components/ui';
import { Spinner } from '@composable-svelte/core/components/ui';
import { Empty } from '@composable-svelte/core/components/ui';

// Card (HAS subcomponents)
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@composable-svelte/core/components/ui';

// Layout
import { Panel } from '@composable-svelte/core/components/ui';
import { Box } from '@composable-svelte/core/components/ui';
import { AspectRatio } from '@composable-svelte/core/components/ui';
import { Separator } from '@composable-svelte/core/components/ui';

// Typography
import { Heading } from '@composable-svelte/core/components/ui';
import { Text } from '@composable-svelte/core/components/ui';
import { Kbd } from '@composable-svelte/core/components/ui';

// Banner (HAS subcomponents)
import { Banner, BannerTitle, BannerDescription } from '@composable-svelte/core/components/ui';

// Breadcrumb (HAS subcomponents)
import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis } from '@composable-svelte/core/components/ui';

// Accordion (HAS subcomponents)
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@composable-svelte/core/components/ui';

// Collapsible (HAS subcomponents)
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '@composable-svelte/core/components/ui';

// Overlays
import { Tooltip } from '@composable-svelte/core/components/ui';
import { DropdownMenu } from '@composable-svelte/core/components/ui';

// Other
import { Pagination } from '@composable-svelte/core/components/ui';
import { Calendar } from '@composable-svelte/core/components/ui';
import { Carousel } from '@composable-svelte/core/components/ui';
import { TreeView } from '@composable-svelte/core/components/ui';
import { FileUpload } from '@composable-svelte/core/components/ui';

From @composable-svelte/core/components/data-table

import { DataTable, DataTableHeader, DataTablePagination } from '@composable-svelte/core/components/data-table';
import { createTableReducer, createInitialState } from '@composable-svelte/core/components/data-table';

There is no Table component. For sorting/filtering/pagination use DataTable;
for a static list, plain HTML plus Tailwind is fine (see the DataTable section).

From @composable-svelte/core/components/form

import { Form, FormField, FormControl, FormItem, FormLabel, FormMessage, FormDescription } from '@composable-svelte/core/components/form';
import { createFormReducer, createInitialFormState } from '@composable-svelte/core/components/form';

From @composable-svelte/core/components/toast

import { Toaster, Toast, ToastTitle, ToastDescription, ToastAction,
         toastReducer, createInitialToastState } from '@composable-svelte/core/components/toast';

From @composable-svelte/core/components/command

import { Command, CommandInput, CommandList, CommandGroup, CommandItem } from '@composable-svelte/core/components/command';

From @composable-svelte/core/components/image-gallery

import { ImageGallery, ImageLightbox } from '@composable-svelte/core/components/image-gallery';

Navigation Components (from @composable-svelte/core)

import { Modal } from '@composable-svelte/core';
import { Sheet } from '@composable-svelte/core';
import { Alert } from '@composable-svelte/core';
import { Drawer } from '@composable-svelte/core';
import { Popover } from '@composable-svelte/core';
import { Sidebar } from '@composable-svelte/core';
import { Tabs } from '@composable-svelte/core';
import { NavigationStack } from '@composable-svelte/core';
import { AnimatedNavigationStack } from '@composable-svelte/core';

❌ COMPONENTS THAT DO NOT EXIST

These are commonly hallucinated from other libraries. They are NOT available:

  • Table, TableHeader, TableRow, TableHead, TableBody, TableCell — use DataTable from @composable-svelte/core/components/data-table instead
  • AvatarImage, AvatarFallback — Avatar is a single component with src, fallback, and alt props
  • SelectTrigger, SelectContent, SelectItem, SelectValue — Select is a single component with options, value, and onchange props
  • TabsList, TabsTrigger, TabsContent — Tabs is a single component from @composable-svelte/core
  • RadioGroupItem — use Radio from the Radio, RadioGroup export
  • AlertTitle, AlertDescription, AlertActions — Alert is a navigation component from @composable-svelte/core

---

COMPONENT LIBRARY OVERVIEW

Composable Svelte includes 77 components (68 high-level + 9 primitives) for building modern UIs. All components integrate with the Composable Architecture via props and state management.

Integration Pattern:

  • Props for configuration (labels, variants, styles)
  • State from $store (subscription) or $derived(store.state) (rune-based) for reactive data
  • Dispatch actions for user interactions

Icons: Components use inline SVGs for structural icons (chevrons, arrows, checkmarks) — these are not currently configurable via props. For application-level icons, use lucide-svelte (the recommended icon library). Verify icon names against https://lucide.dev/icons/ — do NOT guess icon names.

import { ChevronDown, Plus, Search } from 'lucide-svelte';

Note: The 22 components with hardcoded inline SVGs (accordion chevron, breadcrumb separator, pagination arrows, etc.) cannot currently be swapped for custom icons. This is a known limitation.

Package Organization:

  • @composable-svelte/core - UI components (this skill)
  • @composable-svelte/graphics - 3D graphics (see composable-svelte-graphics skill)
  • @composable-svelte/code - Code editors, media players (see composable-svelte-code skill)
  • @composable-svelte/charts - Data visualization (see composable-svelte-charts skill)
  • @composable-svelte/maps - Interactive maps (see composable-svelte-maps skill)

---

🎨 STYLING SETUP — REQUIRED

These components ship no scoped CSS. Every visual style is a Tailwind utility
class (bg-popover, text-muted-foreground, border-border, …). If the consuming
app has no Tailwind pipeline, or Tailwind cannot resolve the theme tokens,
components render unstyled or transparent — see-through popovers, dropdowns
and select menus. This is the single most common integration bug.

Two things are required in the consuming app:

  1. Import the library stylesheet once, at the app entry.
  2. Let Tailwind scan the library, so its classes are not purged.

Tailwind v4 — one import does both:

@import 'tailwindcss';
@import '@composable-svelte/core/styles/tailwind.css';

Tailwind v3 — preset plus the exported content glob:

import composableSvelte, { contentGlob } from '@composable-svelte/core/tailwind-preset';
export default {
  presets: [composableSvelte],
  content: ['./src/**/*.{html,js,svelte,ts}', contentGlob]
};
@import '@composable-svelte/core/styles/globals.css';

contentGlob must be listed explicitly — Tailwind v3 does not merge a preset's
own content.

Do not hand-author --popover / --color-popover in app CSS to work around a
transparent component, and do not import both styles/globals.css and
styles/theme.css. Dark mode is the dark class on <html>.

👉 Full setup, theme overriding and troubleshooting: the "Styling & Theming"
section of packages/core/README.md. Read it before writing component code in a
new app rather than reconstructing it from memory.

---

NAVIGATION COMPONENTS

Purpose: Overlay-based UI elements for state-driven navigation.

Integration Pattern: State-driven open/close via store, dismiss via PresentationAction.

See composable-svelte-navigation skill for implementation details. This section provides REFERENCE only.

> ⚠️ These are NOT open / onOpenChange components. Each takes a framework-minted
> PresentationView. They render nothing when that view is absent or retired and no
> presentation is mid-flight — a non-idle presentation keeps them mounted so
> the exit animation can finish (ModalPrimitive.svelte:88-91). Any example
> showing <Modal open={true}> is wrong.

Shared props

Modal, Sheet, Drawer, Alert and Popover share one signature
(navigation-components/Modal.svelte:16-66):

  • store?: PresentationView<State, Action> — a managed presentation capability; undefined means absent, and a retired view reads undefined
  • presentation?: PresentationState<any> — omit for instant show/hide
  • onPresentationComplete?: () => void
  • onDismissalComplete?: () => void
  • springConfig?: Partial<SpringConfig>
  • unstyled?: boolean
  • class?: string
  • backdropClass?: string — Modal/Sheet/Drawer/Alert only (Popover has no backdrop)
  • disableClickOutside?: boolean
  • disableEscapeKey?: boolean

The children snippet receives { visible, store } — plus height on Sheet
(Sheet.svelte:151) and side, width on Drawer (Drawer.svelte:155).

Per-component extras:

| Component | Extra props |
|---|---|
| Sheet | side?: 'bottom' \| 'left' \| 'right' (default 'bottom'), height?: string (default '60vh') |
| Drawer | side?: 'left' \| 'right' (default 'left'), width?: string (default '320px') |
| Popover | style?: string — caller supplies absolute positioning |
| Alert | none |
| Modal | none |

import { Modal } from '@composable-svelte/core';

<Modal store={detailStore} ariaLabel="Product details">
  {#if detailStore && detailStore.state !== undefined}
    {@const detail = detailStore}
    <ProductDetail store={detail} onBack={() => detail.dismiss()} />
  {/if}
</Modal>

Receive detailStore from a managed feature view or bind an admitted optional/destination
slot through its managed composition. Its dismiss() requests closure of that exact
owner. Legacy scopeToDestination(...) stores are for reads and dispatch only and
are not valid presentation inputs. The managed feature view also supplies the
surface action for the actual feature content; see the application views guide.
This compact example uses instant show/hide; explicit presentation completion
props remain available for qualified rendering integrations.

Tabs

Props (navigation-components/Tabs.svelte:14-29):

  • store: ChildView<State, Action> | undefined — a managed read/dispatch view; absent or retired views render nothing
  • tabs: string[] — plain strings, not { value, label } objects
  • activeTab: number — a numeric index, not a string key
  • onTabChange: (index: number) => void
  • unstyled?, tabListClass?, tabClass?, class?
<Tabs
  store={scopedStore}
  tabs={['Overview', 'Analytics', 'Reports']}
  activeTab={store.state.activeTabIndex}
  onTabChange={(index) => store.dispatch({ type: 'tabChanged', index })}
/>

See composable-svelte-navigation for the full navigation patterns —
scoping, presentation lifecycle and the destination reducers.

---

FORM COMPONENTS

Purpose: User input elements that integrate with Composable Architecture.

Integration Pattern: Value from $store (subscription) or $derived(store.state) (rune-based), dispatch on change, validation state from store.

See composable-svelte-forms skill for full patterns.

Input

Text input field with variants.

Types (components/ui/input/Input.svelte:46): `'text' | 'email' | 'password' |
'number' | 'tel' | 'url' | 'search'. date and time` render fine at runtime but
are outside the declared union, so they fail svelte-check — use Calendar or a
plain <input type="date">.

Props:

  • type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'
  • value?: string | number — coerced to a number when type="number" (Input.svelte:51)
  • oninput?: (e: Event & { currentTarget: HTMLInputElement }) => void
  • placeholder: string - Placeholder text
  • disabled: boolean - Disabled state
import { Input } from '@composable-svelte/core/components/ui';

<Input
  type="text"
  value={$store.name}
  oninput={(e) => store.dispatch({ type: 'nameChanged', name: e.currentTarget.value })}
  placeholder="Enter name"
  disabled={$store.isSubmitting}
/>

{#if $store.nameError}
  <span class="error">{$store.nameError}</span>
{/if}

> ⚠️ None of these take an onValueChange / onCheckedChange callback. Those
> props do not exist and are silently ignored. See composable-svelte-forms →
> INPUT COMPONENT WIRING REFERENCE for the same table in a form context.

Select

Dropdown selector.

Props (components/ui/select/Select.svelte):

  • options: SelectOption<T>[] — { value, label, disabled?, description? }
  • value?: T | T[] | null — $bindable
  • onchange?: (value: T | T[] | null) => void — not onValueChange
  • placeholder?, searchable?, multiple?, disabled?, class?
import { Select } from '@composable-svelte/core/components/ui';

<Select
  value={store.state.category}
  options={[
    { label: 'Electronics', value: 'electronics' },
    { label: 'Clothing', value: 'clothing' }
  ]}
  onchange={(value) => store.dispatch({ type: 'categoryChanged', category: value })}
  placeholder="Select category"
/>

Checkbox

Boolean toggle. It accepts no children (no children prop, nothing rendered
for one), so the label must be supplied by the caller.

Props (components/ui/checkbox/Checkbox.svelte:25-37):

  • checked?: boolean — $bindable
  • indeterminate?: boolean, disabled?: boolean, class?: string
  • plus arbitrary <input> attributes via restProps (this is how you get onchange)
<label class="flex items-center gap-2">
  <Checkbox
    checked={store.state.agreeToTerms}
    onchange={(e) => store.dispatch({ type: 'toggleTerms', checked: e.currentTarget.checked })}
  />
  <span>I agree to the terms and conditions</span>
</label>

RadioGroup

Mutually exclusive options. No callback prop exists — RadioGroup declares no
restProps, so anything you pass beyond the props below is dropped. Selection is
captured by an internal handler that assigns to the bindable value.

Props (components/ui/radio/RadioGroup.svelte:23-35):

  • value?: string | null — $bindable; the only way to read the selection
  • name?: string, class?: string, children

Radio takes value: string, disabled?, class?, children, and throws if used
outside a RadioGroup.

<script lang="ts">
  let plan = $state(store.state.plan);
  $effect(() => store.dispatch({ type: 'planChanged', plan }));
</script>

<RadioGroup bind:value={plan}>
  <Radio value="free">Free</Radio>
  <Radio value="pro">Pro ($9/mo)</Radio>
</RadioGroup>

If you want a pure dispatch flow with no local mirror, use native
<input type="radio"> instead.

Switch

Toggle switch.

Props (components/ui/switch/Switch.svelte:27, $bindable at :43):

  • checked?: boolean — $bindable
  • disabled?, class?, plus restProps spread onto the <button>

There is no onCheckedChange. The component defines an internal onclick toggle,
but restProps are spread after it, so a caller-supplied onclick replaces that
handler — which is what makes one-way checked + onclick keep the store as the
single source of truth.

<Switch
  checked={store.state.notifications}
  onclick={() => store.dispatch({ type: 'notificationsToggled' })}
/>

Textarea

Multi-line text input.

Props: value, oninput, rows, placeholder.

Combobox

Autocomplete dropdown.

Props (components/ui/combobox/Combobox.svelte):

  • options?: ComboboxOption<T>[]
  • value?: T | null — $bindable
  • onchange?: (value: T | null) => void — not onValueChange
  • loadOptions?: (query: string) => Promise<ComboboxOption<T>[]> — async mode; not onSearchChange
  • debounceDelay?: number (default 300), placeholder?, disabled?, class?

---

DATA DISPLAY COMPONENTS

Purpose: Display data from store.state, often derived/computed.

Integration Pattern: Map from store.state arrays, use $derived for filtering/sorting.

DataTable

Tabular data display with sorting/filtering/pagination.

When to use: Lists of structured data, data grids.

> There is no Table component, and DataTable has no data or columns prop.
> It is store-driven; columns belongs to DataTableHeader.

Props (components/data-table/DataTable.svelte:15-50):

  • store: Store<TableState<T>, TableAction<T>> — required
  • row: Snippet<[T]> — required
  • header?: Snippet, footer?: Snippet
  • emptyMessage?, loadingMessage?, class?, tableClass?
<script lang="ts">
  import { createStore } from '@composable-svelte/core';
  import { DataTable, DataTableHeader, DataTablePagination,
           createTableReducer, createInitialState }
    from '@composable-svelte/core/components/data-table';

  const store = createStore({
    initialState: createInitialState<User>({ initialData: users, pageSize: 10 }),
    reducer: createTableReducer<User>()
  });
</script>

<DataTable {store}>
  {#snippet header()}
    <DataTableHeader {store} columns={[
      { key: 'name', label: 'Name', sortable: true },
      { key: 'email', label: 'Email' }
    ]} />
  {/snippet}
  {#snippet row(user: User)}
    <tr class="border-b">
      <td class="p-4">{user.name}</td>
      <td class="p-4">{user.email}</td>
    </tr>
  {/snippet}
</DataTable>
<DataTablePagination {store} pageSizeOptions={[10, 25, 50]} />

Working reference: examples/data-table/src/App.svelte.

For simple tables with no sorting, filtering or pagination, plain HTML plus
Tailwind is lighter and perfectly acceptable:

<table class="w-full text-sm">
  <thead>
    <tr class="border-b text-left text-muted-foreground">
      <th class="px-4 py-3 font-medium">Name</th>
      <th class="px-4 py-3 font-medium">Email</th>
      <th class="px-4 py-3 font-medium">Status</th>
    </tr>
  </thead>
  <tbody>

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.