Bar
- Recommended for small sized screens (ex: mobile).
 - Ideal for vertical screen layouts.
 - Should be fixed to the bottom of the viewport.
 - Supports 3-5 tiles based on contents and viewport width.
 - Consider progressive enhancement with the Virtual Keyboard API .
 
Contents
Contents
Rail
- Recommended for medium sized screens (ex: tablet).
 - Ideal for horizontal screen layouts.
 - Should be fixed to the left or right of the viewport.
 - Supports 3-7 tiles based on contents and viewport height.
 
Contents
Contents
Sidebar
- Recommended for large sized screens (ex: desktop).
 - Ideal for horizontal screen layouts.
 - Should be fixed to the left or right of the viewport.
 - Supports multiple groups of links for deep navigation.
 - Supports a label field per each group.
 - Can scroll vertically if contents extend beyond the viewport height.
 
Contents
Contents
Toggle Layout
Using reactive state we can dynamically switch between multiple layouts. Tap the double arrow icon to toggle.
Contents
Layout: Rail
API Reference
Root
bg-surface-100-900 overflow-x-hidden transition-[width] duration-200 data-[layout=bar]:w-full data-[layout=bar]:p-2 data-[layout=rail]:w-[100px] data-[layout=rail]:h-full data-[layout=rail]:overflow-y-hidden data-[layout=rail]:p-2 data-[layout=rail]:flex data-[layout=rail]:flex-col data-[layout=rail]:gap-4 data-[layout=sidebar]:w-[280px] data-[layout=sidebar]:h-full data-[layout=sidebar]:overflow-y-auto data-[layout=sidebar]:p-4| Prop | Default | Type | 
|---|---|---|
layout | bar | "bar" | "rail" | "sidebar" | undefined Sets the data-layout attribute, which modifies the visual presentation of the component set.  | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Header
| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"header">) => Element) | undefined Render the element yourself  | 
Content
data-[layout=rail]:contents data-[layout=sidebar]:space-y-4| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Group
data-[layout=rail]:contents data-[layout=sidebar]:flex flex-col gap-2| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Label
text-xs text-surface-700-300| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Menu
flex-1 flex gap-2 data-[layout=bar]:items-stretch data-[layout=rail]:flex-col data-[layout=rail]:justify-center data-[layout=sidebar]:flex-col data-[layout=sidebar]:items-stretch| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Footer
| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"footer">) => Element) | undefined Render the element yourself  | 
Root
bg-surface-100-900 overflow-x-hidden transition-[width] duration-200 data-[layout=bar]:w-full data-[layout=bar]:p-2 data-[layout=rail]:w-[100px] data-[layout=rail]:h-full data-[layout=rail]:overflow-y-hidden data-[layout=rail]:p-2 data-[layout=rail]:flex data-[layout=rail]:flex-col data-[layout=rail]:gap-4 data-[layout=sidebar]:w-[280px] data-[layout=sidebar]:h-full data-[layout=sidebar]:overflow-y-auto data-[layout=sidebar]:p-4| Prop | Default | Type | 
|---|---|---|
layout | bar | "bar" | "rail" | "sidebar" | undefined Sets the data-layout attribute, which modifies the visual presentation of the component set.  | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Header
| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"header">]> | undefined Render the element yourself  | 
Content
data-[layout=rail]:contents data-[layout=sidebar]:space-y-4| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Group
data-[layout=rail]:contents data-[layout=sidebar]:flex flex-col gap-2| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Label
text-xs text-surface-700-300| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Menu
flex-1 flex gap-2 data-[layout=bar]:items-stretch data-[layout=rail]:flex-col data-[layout=rail]:justify-center data-[layout=sidebar]:flex-col data-[layout=sidebar]:items-stretch| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Footer
| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"footer">]> | undefined Render the element yourself  |