Button API

API documentation for Button component

Button#

Props#

Defines valid properties in Button component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: ButtonInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: ButtonInstance) => 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<ButtonPassThrough>
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: ButtonInstance) => ReactNode)
null
The children to render.
size"small" | "large" | "normal"
null
Size of the Button.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"
null
Severity type of the Button.
variant"link" | "text" | "outlined"
null
Variant of the Button.
plainboolean
null
Whether to show the Button with a plain style.
roundedboolean
null
Whether to show the Button with a rounded style.
raisedboolean
null
Whether to show the Button with a raised style.
iconOnlyboolean
null
Whether to show the Button with a borderless style.
fluidboolean
null
Whether to show the Button with a fluid width.
[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 Button component.

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

Types#

Instance of Button component.

values
ComponentInstance<ButtonProps, ButtonState, ButtonExposes>

ButtonGroup#

Props#

Defines valid properties in ButtonGroup component.

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

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

Types#

Instance of ButtonGroup component.

values
ComponentInstance<ButtonGroupProps, ButtonGroupState, ButtonGroupExposes>

useButton#

Types#

Instance of useButton headless.

values
HeadlessInstance<useButtonProps, useButtonState, useButtonExposes>