<Collapse>
Component
<Collapse>
is a non-visual container with dynamic visibility (show/hide) in sliding fashion.
You need to place <YourComponent>
inside the <Collapse>
in order to make the appearance.
Here the demo:
<Collapse>
Component<Collapse>
is a non-visual container with dynamic visibility (show/hide) in sliding fashion.
You need to place <YourComponent>
inside the <Collapse>
in order to make the appearance.
Here the demo:
<Collapse>
ComponentThere are 2 ways to install <Collapse>
component into your react app project:
<Collapse>
Component<Collapse>
Componentexpanded
PropertyExpands/Collapses the <Collapse>
.
The possible values are:
undefined
true
false
Here the preview:
<Collapse expanded={true}>
orientation
PropertySets the orientation of the <Collapse>
.
The possible values are:
undefined
'inline'
'block'
Here the preview:
lazy
PropertyDetermines whenever the <Collapse>
's children
should be rendered or not when the <Collapse expanded={false}>
.
The possible values are:
undefined
false
true
Determines how the <Collapse>
should be floating on the target DOM reference.
floatingOn
PropertyDetermines the target DOM reference where the <Collapse>
should be floating on.
If not set (undefined
), the <Collapse>
becomes a normal element flow.
Here the preview:
floatingPlacement
PropertyDetermines the location where the <Collapse>
should be floating on the target DOM reference.
Here the preview:
floatingPlacement='top'
floatingStrategy
PropertyDetermines the technical strategy how the <Collapse>
can float.
In most cases, you should not worry about the detail mechanism how the <Collapse>
can float.
The possible values are:
undefined
'absolute'
'fixed'
floatingAutoFlip
PropertyAutomatically flips the floatingPlacement
to opposite direction when the <Collapse>
is about to be clipped.
The possible values are:
undefined
true
false
Here the preview:
floatingAutoShift
PropertyAutomatically shifts the floatingPlacement
to nearest safe position when the <Collapse>
is about to be clipped.
The possible values are:
undefined
true
false
Here the preview:
floatingOffset
PropertyThe distance (in pixel) between the <Collapse>
and the target DOM reference.
The possible values are:
undefined
0
Here the preview:
<Collapse floatingOffset={0}>
floatingShift
PropertyThe distance (in pixel) between the <Collapse>
and the default floatingPlacement
location.
The possible values are:
undefined
0
Here the preview:
<Collapse floatingShift={0}>
onFloatingUpdate
PropertySets a callback function to be called when the <Collapse>
updates the position relative to the target DOM reference.
The callback function parameters:
event: FloatingPosition
Because <Collapse>
is made from <Generic>
, so all properties from <Generic>
are inherited.
There are several variables of <Collapse>
you can customize. Changing the variables affects all <Collapse>
instance and other components that depend on <Collapse>
.
Here the exposed variables:
The example of accessing, modifying, & adding variables: