Accordion API

API documentation for Accordion component

Accordion#

Props#

Defines valid properties in Accordion component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AccordionInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AccordionInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AccordionPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AccordionInstance) => ReactNode)
null
The children to render.
lazyboolean
false
When enabled, hidden tabs are not rendered at all. Defaults to false that hides tabs with css.
tabIndexnumber
0
Index of the element in tabbing order.
defaultValuestring | number | (string | number)[]
null
Default value of the active panel or an array of values in multiple mode.
valuestring | number | (string | number)[]
null
Value of the active panel or an array of values in multiple mode.
multipleboolean
false
When enabled, multiple tabs can be activated at the same time.
selectOnFocusboolean
false
When enabled, the accordion will be selected on focus.
onValueChange(event: useAccordionChangeEvent) => void
null
Callback fired when the accordion's value changes.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Avatar component.

nametypedefaultdescription
valuestring | number | (string | number)[]
null
Value of the active panel or an array of values in multiple mode.

Exposes#

Defines the methods and properties exposed by Avatar component.

nametypedefaultdescription
stateuseAccordionState
null
The state of the useAccordion.
updateValue(key: string | number) => void
null
The method to update the value of the active panel.
isItemActive(key: string | number) => boolean
null
The method to check if the panel is active.
onHeaderClick(event: MouseEvent<HTMLButtonElement>, value: string | number) => void
null
The method to handle the click event of the accordion header.
onHeaderFocus(event: FocusEvent<HTMLButtonElement>, value: string | number) => void
null
The method to handle the focus event of the accordion header.
onHeaderKeyDown(event: KeyboardEvent<HTMLButtonElement>, value: string | number) => void
null
The method to handle the key down event of the accordion header.

Interfaces#

Defines passthrough(pt) options of Accordion component.

nametypedefaultdescription
rootAccordionPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
panelAccordionPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the panel's DOM element.
headerAccordionPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the header's DOM element.
contentAccordionPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the content's DOM element.
headerindicatorAccordionPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the header indicator's DOM element.

Types#

Instance of Avatar component.

values
ComponentInstance<AccordionProps, AccordionState, AccordionExposes>

AccordionPanel#

Props#

Defines valid properties in AccordionPanel component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AccordionPanelInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AccordionPanelInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AccordionPanelPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AccordionPanelInstance) => ReactNode)
null
The children to render.
valuestring | number
null
Unique value of item.
disabledboolean
false
Whether the item is disabled.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AccordionPanel component.

nametypedefaultdescription
accordionAccordionInstance
null
The Accordion component instance.
activeboolean
null
Whether the item is active.

Interfaces#

Defines passthrough(pt) options of AccordionPanel component.

nametypedefaultdescription
rootAccordionPanelPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AccordionPanel component.

values
ComponentInstance<AccordionPanelProps, AccordionPanelState, AccordionPanelExposes>

AccordionHeader#

Props#

Defines valid properties in AccordionHeader component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AccordionHeaderInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AccordionHeaderInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AccordionHeaderPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AccordionHeaderInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AccordionHeader component.

nametypedefaultdescription
accordionAccordionInstance
null
The Accordion component instance.
accordionpanelAccordionPanelInstance
null
The AccordionPanel component instance.

Interfaces#

Defines passthrough(pt) options of AccordionHeader component.

nametypedefaultdescription
rootAccordionHeaderPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AccordionHeader component.

values
ComponentInstance<AccordionHeaderProps, AccordionHeaderState, AccordionHeaderExposes>

AccordionHeaderIndicator#

Props#

Defines valid properties in AccordionHeaderIndicator component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AccordionHeaderIndicatorInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AccordionHeaderIndicatorInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AccordionHeaderIndicatorPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AccordionHeaderIndicatorInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AccordionHeaderIndicator component.

nametypedefaultdescription
accordionAccordionInstance
null
The Accordion component instance.
accordionpanelAccordionPanelInstance
null
The AccordionPanel component instance.

Interfaces#

Defines passthrough(pt) options of AccordionHeaderIndicator component.

nametypedefaultdescription
rootAccordionHeaderIndicatorPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AccordionHeaderIndicator component.

values
ComponentInstance<AccordionHeaderIndicatorProps, AccordionHeaderIndicatorState, AccordionHeaderIndicatorExposes>

AccordionContent#

Props#

Defines valid properties in AccordionContent component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AccordionContentInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AccordionContentInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AccordionContentPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AccordionContentInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AccordionContent component.

nametypedefaultdescription
accordionAccordionInstance
null
The Accordion component instance.

Types#

Instance of AccordionContent component.

values
ComponentInstance<AccordionContentProps, AccordionContentState, AccordionContentExposes>