Panel API

API documentation for Panel component

Panel#

Props#

Defines valid properties in Panel component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelInstance) => 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<PanelPassThrough>
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: PanelInstance) => ReactNode)
null
The children to render.
toggleableboolean
false
When enabled, the content of panel can be expanded and collapsed by clicking the header.
onToggle(event: PanelToggleEvent) => void
null
Callback fired when the panel's toggle state changes.
collapsedboolean
false
Whether the panel is collapsed.
onCollapse(event: SyntheticEvent) => void
null
Callback triggered when the panel is collapsed.
onExpand(event: SyntheticEvent) => void
null
Callback triggered when the panel is expanded.
[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 Panel component.

nametypedefaultdescription
collapsedboolean
null
Whether the panel is collapsed.

Exposes#

Defines the methods and properties exposed by Panel component.

nametypedefaultdescription
stateusePanelState
null
The state of the usePanel.
contentRefRefObject<HTMLDivElement>
null
Reference to the content element of the panel.
toggle(event: SyntheticEvent) => void
null
Toggles the collapsed state of the panel.
expand(event: SyntheticEvent) => void
null
Expands the panel.
collapse(event: SyntheticEvent) => void
null
Collapses the panel.
onButtonClick(event: SyntheticEvent) => void
null
Callback for when the toggle button is clicked.

Events#

Event fired when the panel's toggle state changes.

nametypedescription
originalEventSyntheticEventThe original event that triggered the toggle.
valuebooleanThe new value of the panel's toggle state.

Interfaces#

Defines passthrough(pt) options of Panel component.

nametypedefaultdescription
rootPanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
headerPanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the header's DOM element.
headerActionsPanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the header actions's DOM element.
titlePanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the title's DOM element.
contentPanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the content's DOM element.
collapsePanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the collapse's DOM element.
footerPanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the footer's DOM element.

Types#

Instance of Panel component.

values
ComponentInstance<PanelProps, PanelState, PanelExposes>

PanelHeader#

Props#

Defines valid properties in PanelHeadercomponent.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelHeaderInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelHeaderInstance) => 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<PanelHeaderPassThrough>
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: PanelHeaderInstance) => 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.

Interfaces#

Defines passthrough(pt) options of PanelHeadercomponent.

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

Types#

Instance of PanelHeadercomponent.

values
ComponentInstance<PanelHeaderProps, PanelHeaderState, PanelHeaderExposes>

PanelHeaderActions#

Props#

Defines valid properties in PanelHeaderActions component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelHeaderActionsInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelHeaderActionsInstance) => 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<PanelHeaderActionsPassThrough>
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: PanelHeaderActionsInstance) => 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.

Interfaces#

Defines passthrough(pt) options of PanelHeaderActions component.

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

Types#

Instance of PanelHeaderActions component.

values
ComponentInstance<PanelHeaderActionsProps, PanelHeaderActionsState, PanelHeaderActionsExposes>

PanelTitle#

Props#

Defines valid properties in PanelTitlecomponent.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelTitleInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelTitleInstance) => 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<PanelTitlePassThrough>
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: PanelTitleInstance) => 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.

Interfaces#

Defines passthrough(pt) options of PanelTitlecomponent.

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

Types#

Instance of PanelTitlecomponent.

values
ComponentInstance<PanelTitleProps, PanelTitleState, PanelTitleExposes>

PanelCollapse#

Props#

Defines valid properties in PanelCollapse component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelCollapseInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelCollapseInstance) => 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<PanelCollapsePassThrough>
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: PanelCollapseInstance) => ReactNode)
null
The children to render.
iconOnlyboolean
true
Whether to show the PanelCollapse with a borderless style.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"
'secondary'
Severity type of the PanelCollapse.
variant"link" | "text" | "outlined"
'text'
Variant of the PanelCollapse.
roundedboolean
true
Whether to show the PanelCollapse with a rounded style.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Interfaces#

Defines passthrough(pt) options of PanelCollapse component.

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

Types#

Instance of PanelCollapse component.

values
ComponentInstance<PanelCollapseProps, PanelCollapseState, PanelCollapseExposes>

PanelContent#

Props#

Defines valid properties in PanelContent component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelContentInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelContentInstance) => 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<PanelContentPassThrough>
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: PanelContentInstance) => 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.

Interfaces#

Defines passthrough(pt) options of PanelContent component.

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

Types#

Instance of PanelContent component.

values
ComponentInstance<PanelContentProps, PanelContentState, PanelContentExposes>

PanelFooter#

Props#

Defines valid properties in PanelFooter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PanelFooterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PanelFooterInstance) => 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<PanelFooterPassThrough>
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: PanelFooterInstance) => 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.

Interfaces#

Defines passthrough(pt) options of PanelFooter component.

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

Types#

Instance of PanelFooter component.

values
ComponentInstance<PanelFooterProps, PanelFooterState, PanelFooterExposes>

usePanel#

Props#

Props for the usePanel hook.

nametypedefaultdescription
collapsedboolean
false
Whether the panel is collapsed.
toggleableboolean
false
Indicates if the panel can be toggled.
onCollapse(event: SyntheticEvent) => void
null
Callback triggered when the panel is collapsed.
onExpand(event: SyntheticEvent) => void
null
Callback triggered when the panel is expanded.
onToggle(event: usePanelToggleEvent) => void
null
Callback triggered when the panel's toggle state changes.

State#

Defines valid state in usePanel.

nametypedefaultdescription
collapsedboolean
null
Whether the panel is collapsed.

Exposes#

Defines the methods and properties exposed by usePanel.

nametypedefaultdescription
stateusePanelState
null
The state of the usePanel.
contentRefRefObject<HTMLDivElement>
null
Reference to the content element of the panel.
toggle(event: SyntheticEvent) => void
null
Toggles the collapsed state of the panel.
expand(event: SyntheticEvent) => void
null
Expands the panel.
collapse(event: SyntheticEvent) => void
null
Collapses the panel.
onButtonClick(event: SyntheticEvent) => void
null
Callback for when the toggle button is clicked.

Events#

Event object for the onToggle callback.

nametypedescription
originalEventSyntheticEventThe original event that triggered the toggle.
valuebooleanThe new value of the panel's toggle state.

Types#

Instance of usePanel headless.

values
HeadlessInstance<usePanelProps, usePanelState, usePanelExposes>