Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { Sidebar } from '@dryui/ui';
</script>

<Sidebar.Root>
  <Sidebar.Header>...</Sidebar.Header>
  <Sidebar.Content>...</Sidebar.Content>
  <Sidebar.Footer>...</Sidebar.Footer>
  <Sidebar.Group>...</Sidebar.Group>
  <Sidebar.GroupLabel>...</Sidebar.GroupLabel>
  <Sidebar.Item>...</Sidebar.Item>
  <Sidebar.Trigger>...</Sidebar.Trigger>
</Sidebar.Root>

Import options

Root package

ts
import { Sidebar } from '@dryui/ui'

Per-component subpath

ts
import { Sidebar } from '@dryui/ui/sidebar'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Default

svelte
<script lang="ts">
  let collapsed = $state(false);
</script>
<Sidebar.Root bind:collapsed>
  <Sidebar.Header>
    <strong>MyApp</strong>
  </Sidebar.Header>
  <Sidebar.Content>
    <Sidebar.Group>
      <Sidebar.GroupLabel>Navigation</Sidebar.GroupLabel>
      <Sidebar.Item active>Dashboard</Sidebar.Item>
      <Sidebar.Item>Projects</Sidebar.Item>
      <Sidebar.Item>Settings</Sidebar.Item>
    </Sidebar.Group>
  </Sidebar.Content>
  <Sidebar.Footer>
    <Sidebar.Trigger />
  </Sidebar.Footer>
</Sidebar.Root>

Structure

Compound components always start with Sidebar.Root. Use this structure block to understand required wrappers before you wire state or styling.

Sidebar.Root
  Sidebar.Header
  Sidebar.Content
  Sidebar.Footer
  Sidebar.Group
  Sidebar.GroupLabel
  Sidebar.Item
  Sidebar.Trigger
Sidebar.Root Sidebar.HeaderSidebar.ContentSidebar.FooterSidebar.GroupSidebar.GroupLabelSidebar.ItemSidebar.Trigger

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with Sidebar.Root, then add only the parts you need.

Sidebar.HeaderSidebar.ContentSidebar.FooterSidebar.GroupSidebar.GroupLabelSidebar.ItemSidebar.Trigger

Sidebar.Root

Prop Type Default Required Bindable
collapsed
boolean
false
side
leftright
'left'
children
Snippet

Forwards <element> attributes via rest props. Common examples: id, class, aria-label.

Sidebar.Header

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Sidebar.Content

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Sidebar.Footer

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Sidebar.Group

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Sidebar.GroupLabel

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Sidebar.Item

Prop Type Default Required Bindable
active
boolean
false
children
Snippet

Forwards <a> attributes via rest props. Common examples: href, target, rel.

Sidebar.Trigger

Prop Type Default Required Bindable
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.