Child element of the <Layout>
component used only for left or right side areas, with the ability to collapse them. Can be used as a "controlled" component (i.e. by passing the collapsed
boolean prop), or by default it will manage its own (un)collapsed state. It takes a triggerType
prop, allowing you to choose the inbuilt triggers – the side area will include a button which allows the user to collapse the area and then expand it again – or custom, meaning you are using your own UI element elsewhere to control the (un)collapsed state.
See the <Layout>
docs for example usage.
The <Layout>
component only supports one child of each type
, shared between <CollapsibleLayoutItem>
and <LayoutItem>
.
Usage
import { CollapsibleLayoutItem } from 'nr1'
Props
REQUIREDnode | Content to display inside the child item. |
string | Appends class names to the component. |
boolean | Set this prop to control the collapsed state of the split from your own external control. |
boolean | Not actually a "default" – this only sets the initial collapsed state of the split. Defaults to |
function | This function will be called whenever the user clicks the default trigger button to collapse or expand the split. If you are controlling the state of the component, use this to set the value of the function ( |
enum | Determines the width of the layout item. We recommend you use the small size for navigation purposes (ex. sidebars) and the medium size for showing contextualized information (ex. activity stream).Size type only works on SPLIT_LEFT and SPLIT_RIGHT items. <One of |
object | Inline style for custom styling. |
string | Adds a Note: You might not see |
REQUIREDenum | Choose whether to use the inbuilt trigger buttons to allow collapsing/expanding the split, or your own custom ones (e.g. a switch outside the layout or a custom button inside the layout). It is strongly recommended not to mix these patterns, i.e. do not choose <One of |
REQUIREDenum | Type can be: Split left — Render as a fixed area on the left of the layout. Split right — Render as a fixed area on the right of the layout. <One of |