Svelte
<!-- Navigation with Buttons -->
<Drawer direction="left" palette="accent" rounded open={open}
onclose={() => { open = false; }}>
{#snippet leading()}
<div style="display:flex; align-items:center; gap:.5rem; width:100%">
<span class="material-symbols-outlined">layers</span>
<strong>My App</strong>
</div>
{/snippet}
<Button variant="ghost" palette="accent" rounded direction="row"
active={active === "Dashboard"}
onclick={() => { active = "Dashboard"; }}>
<span class="nav-icon"><span class="material-symbols-outlined">home</span></span>
<span class="nav-label">Dashboard</span>
</Button>
<Button variant="ghost" palette="accent" rounded direction="row"
active={active === "Settings"}
onclick={() => { active = "Settings"; }}>
<span class="nav-icon"><span class="material-symbols-outlined">settings</span></span>
<span class="nav-label">Settings</span>
</Button>
</Drawer> API
| Prop | Type | Default |
|---|---|---|
| direction | "left" | "right" | "top" | "bottom" | "left" |
| palette | "accent" | "tone" | "accent" |
| open | boolean | false |
| offset_top | string | "0px" |
| offset_bottom | string | "0px" |
| width | string | "260px" |
| height | string | "300px" |
| rounded | boolean | false |
| leading | Snippet | — |
| children | Snippet | — |
| trailing | Snippet | — |
| onclose | () => void | — |
| aria_label | string | "Drawer" |
Prop direction
Type
"left" | "right" | "top" | "bottom"Default
"left"Prop palette
Type
"accent" | "tone"Default
"accent"Prop open
Type
booleanDefault
falseProp offset_top
Type
stringDefault
"0px"Prop offset_bottom
Type
stringDefault
"0px"Prop width
Type
stringDefault
"260px"Prop height
Type
stringDefault
"300px"Prop rounded
Type
booleanDefault
falseProp leading
Type
SnippetDefault
—Prop children
Type
SnippetDefault
—Prop trailing
Type
SnippetDefault
—Prop onclose
Type
() => voidDefault
—Prop aria_label
Type
stringDefault
"Drawer"