Sidebar
Collapsible side navigation panel
Main content area
Accessibility
- Use concise, descriptive labels so navigation items are understandable when announced out of context.
- Preserve the expected keyboard model and expose current or selected state where relevant.
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' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
Sidebar.Root | |||||
| collapsed | boolean | — | false | — | ✓ |
| side | leftright | Preferred side for overlay placement. | 'left' | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.Header | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.Content | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.Footer | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.Group | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.GroupLabel | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.Item | |||||
| active | boolean | — | false | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Sidebar.Trigger | |||||
| children | Snippet | Content rendered inside the component. | — | — | — |