<Details>
Component
<Details>
is a foldable content widget. Supports customization of themes, sizes, and other variants.
Here the demo:
<Details>
Component<Details>
is a foldable content widget. Supports customization of themes, sizes, and other variants.
Here the demo:
<Details>
ComponentThere are 2 ways to install <Details>
component into your react app project:
<Details>
Component<Details>
Componentexpanded
PropertyExpands/Collapses the <Details>
.
The possible values are:
undefined
true
false
Here the preview:
defaultExpanded
PropertyDefines the initial expanded
state when the <Details>
is first loaded.
The possible values are:
undefined
true
false
onExpandedChange
PropertySets a callback function to be called when the user opens/closes the <Details>
.
The callback function parameters:
event: ExpandedChangeEvent
lazy
PropertyDetermines whenever the <Details>
's children
should be rendered or not when the <Details expanded={false}>
.
The possible values are:
undefined
false
true
The alternative appearances of the <Details>
layout without changing the <Details>
's functionality.
detailsStyle
PropertySets the alternative appearances of the <Details>
.
The possible values are:
undefined
'regular'
'content'
Here the preview:
size
PropertyDefines the alternative size of the <Details>
.
The possible values are:
undefined
'sm'
'md'
'lg'
Here the preview:
theme
PropertyDefines the contextual theme of the <Details>
.
The possible values are:
undefined
'primary'
'secondary'
'success'
'info'
'warning'
'danger'
'light'
'dark'
Here the preview:
gradient
PropertyActivates a 3D mode of the <Details>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
outlined
PropertyActivates an outlined mode (background-less, contrast foreground, and contrast border) of the <Details>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
mild
PropertyActivates a mild mode (mild background, contrast foreground, and contrast border) of the <Details>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
Overwrites the internal (sub) components used as the composition of <Details>
component.
buttonComponent
PropertyOverwrites the internal <Button>
component used as the composition of <Details>
component.
<Details buttonComponent={
<MyCustomButton />
} />
buttonRef
PropertyGets the DOM reference of the internal <Button>
component used as the composition of <Details>
component.
<Details buttonRef={fooButtonRef} />
is equivalent to:<Details buttonComponent={
<Button elmRef={fooButtonRef} />
} />
buttonOrientation
PropertySets the orientation of the internal <Button>
component used as the composition of <Details>
component.
<Details buttonOrientation='inline' />
is equivalent to:<Details buttonComponent={
<Button orientation='inline' />
} />
buttonStyle
PropertySets the alternative appearances of the <Button>
.
The possible values are:
undefined
'regular'
'link'
'ghost'
buttonChildren
PropertyDefines the nested element of the internal <Button>
component used as the composition of <Details>
component.
<Details buttonChildren={
<span>Hello World</span>
} />
is equivalent to:<Details buttonComponent={
<Button>
<span>Hello World</span>
</Button>
} />
toggleButtonComponent
PropertyOverwrites the internal <ToggleButton>
component used as the composition of <Details>
component.
<Details toggleButtonComponent={
<MyCustomToggleButton />
} />
bodyComponent
PropertyOverwrites the internal <Basic>
component used as the composition of <Details>
component.
<Details bodyComponent={
<MyCustomBasic />
} />
Because <Details>
is made from <Basic>
, so all properties from <Basic>
are inherited.
There are several variables of <Details>
you can customize. Changing the variables affects all <Details>
instance and other components that depend on <Details>
.
Here the exposed variables:
togglerDisplay
The display mode to apply to the <Details>
's <ToggleButton>
.
togglerTextAlign
The text alignment to apply to the <Details>
's <ToggleButton>
.
borderStyle
The shape of border (stroke).
borderWidth
The thickness of border (stroke).
borderColor
The un-themed color of border (stroke).
borderRadius
The default rounded corner radius.
borderRadiusSm
The rounded corner radius when size='sm'
.
borderRadiusLg
The rounded corner radius when size='lg'
.
The example of accessing, modifying, & adding variables: