Content blocks
Toggle
The toggle list: a disclosure triangle that shows or hides nested blocks. An open toggle with no children shows a clickable “Empty toggle” hint.
Click the triangle
Content inside the toggle.
Empty toggle
Usage
- Use Toggle to hide secondary detail (FAQs, long notes, optional steps) behind a disclosure.
- Control
openwithonOpenChangewhen the state should persist or be shared. - Don’t hide content people need to read first; keep primary content visible.
- Don’t use Toggle for navigation or app sections; use
AccordionorTabsinstead.
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/ToggleExample.tsx
Examples
Closed
Closed toggle
Another closed toggle
API Reference
Toggle
Based on <div> and supports its props. Adds:
| Prop | Type | Default |
|---|---|---|
text | RichText | |
renderLeaf | LeafRenderer | |
open | boolean | false |
onOpenChange | (open: boolean) => void | |
onEmptyClick | () => void | |
depth | number | 0 |
spacing | { top?: boolean; bottom?: boolean; nested?: boolean } | |
color | BlockColor | "default" |
children | ReactNode |
Accessibility
- The triangle is a
buttonwitharia-expanded;Enter/Spacetoggle it. - Hidden content is unmounted while closed, so it is not reachable by keyboard or screen readers.
© 2026 Motion. Internal documentation.