Expand
A component to expand and collapse content along the width or the height.
It has customisable animation duration, and is SEO friendly (search engines can index collapsed content when forceRender
is true
).
The Expand
component can be used with, or without:
ExpandTab
- the always visible element that triggers expansion/collapsingExpandPanel
- the expanded or collapsed content
Props
Expand Props
Prop | Type | Default | Description |
---|---|---|---|
children | String |Number |Boolean |Function | Required | Expand content (see examples) |
direction | Enum |
| Expand/collapse direction |
duration | Millisecond |
| Animation duration in milliseconds |
forceRender | Boolean | Whether to always render <ExpandPanel> content | |
id | String | Optional unique identifier, will be passed to | |
index | Number | Optional index identifier, will be passed to | |
onChange | Function | Callback(event: Event, open: boolean, id: string, index?: number) when | |
open | Boolean | Whether to expand content | |
asPanel | Boolean | Whether to wrap |
ExpandTab Props
Prop | Type | Default | Description |
---|---|---|---|
children | String |Number |Boolean |Function | Required | Expansion trigger element (see examples) |
onClick | Function | Callback(event: Event, open: boolean, id: string | number, index?: number) when |
ExpandPanel Props
Prop | Type | Default | Description |
---|---|---|---|
children | String |Number |Boolean |Function | Required | Expandable content (see examples) |
forceRender | Boolean | Whether to always render content (for SEO indexing) |