Resizable
Panels people resize by dragging the line between them.
Left out of Content first Resizable panels are for desktop tools, not phones. Content first readers arrive on phones and laptops alike, and it avoids data-heavy tools. Use instead: Sheet
See it live
npm run storybookWhen to use it
- Use it when: Desktop tools where people choose how much space each panel gets.
- Not when: Phones, or layouts with one obvious shape.
Instead:
- Sidebar: Fixed app navigation.
Words
- Write to one person: "you", not "users".
- Short sentences with room to breathe.
- Explain why before asking for anything.
- Use: Read, Save for later, You, Next issue. Avoid: Click here, Submit, Users, Content.
The labels components use, from the voice tokens:
content.action.commit: Savecontent.action.cancel: Not nowcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Browse guides
See Voice and tone for the whole voice.
Accessibility and keyboard
| Keyboard | What happens | Not |
|---|---|---|
| undefined | The handle can be focused and moved with arrow keys. | undefined |
Use it in code
npx open-ds add resizable
The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.
Tokens it reads
Resizable reads 7 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Resizable's tokens to change Resizable alone.
Content first decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Handle | ||
| Fill Changes with theme | component.resizable.handle.backgroundcolor.border.defaultvar(--resizable-handle-background) | Lightstone.light.200:#E4DDD0Darkstone.dark.100:#2E2A24 |
| Focus on focus | component.resizable.handle.focusborder-width.focusvar(--resizable-handle-focus) | border-width.2:2px |
| Focus ring focus Changes with theme on focus | component.resizable.handle.focus-ring-focuscolor.border.focusvar(--resizable-handle-focus-ring-focus) | Lightnavy.light.600:#1E3A5FDarknavy.dark.600:#8FA6C4 |
| Focus ring offset focus Changes with theme on focus | component.resizable.handle.focus-ring-offset-focuscolor.surface.canvasvar(--resizable-handle-focus-ring-offset-focus) | Lightstone.light.50:#FFFDF8Darkstone.dark.0:#14110D |
| Resizable | ||
| Height | component.resizable.heightsize.iconvar(--resizable-height) | size.16:1rem |
| Corner | component.resizable.radiusradius.badgevar(--resizable-radius) | radius.999:9999px |
| Fill Changes with theme | component.resizable.backgroundcolor.border.defaultvar(--resizable-background) | Lightstone.light.200:#E4DDD0Darkstone.dark.100:#2E2A24 |
| From the system | ||
| Edge Changes with theme | color.border.default straight from the system, through --border | Lightstone.light.200 · #E4DDD0Darkstone.dark.100 · #2E2A24 |