RadioButton API

API documentation for RadioButton component

RadioButton#

Props#

Defines valid properties in RadioButton component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: RadioButtonInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: RadioButtonInstance) => 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<RadioButtonPassThrough>
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: RadioButtonInstance) => ReactNode)
null
The children to render.
valueunknown
null
Value of the radio button.
namestring
null
The name of the radio button.
size"small" | "large" | "normal"
null
Defines the size of the radio button.
variant"outlined" | "filled"
null
Specifies the input variant of the component.
disabledboolean
false
When present, it specifies that the element should be disabled.
readOnlyboolean
false
When present, it specifies that an input field is read-only.
requiredboolean
false
When present, it specifies that the element is required.
invalidboolean
false
When present, it specifies that the component should have invalid state style.
inputIdstring
null
Identifier of the underlying input element.
inputStyleCSSProperties
null
Inline style of the input field.
inputClassNamestring
null
Style class of the input field.
ariaLabelstring
null
Establishes a string value that labels the component.
ariaLabelledbystring
null
Establishes relationships between the component and label(s) where its value should be one or more element IDs.
onFocus(event: FocusEvent<HTMLInputElement>) => void
null
Callback function that is called when the checkbox is focused.
onBlur(event: FocusEvent<HTMLInputElement>) => void
null
Callback function that is called when the checkbox loses focus.
onCheckedChange(event: RadioButtonChangeEvent) => void
null
Callback fired when the radio button's checked state changes.
checkedboolean
null
When present, it specifies the input's checked state.
defaultCheckedboolean
null
The default value for the input when not controlled by `checked` and `onCheckedChange` .
[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 RadioButton component.

nametypedefaultdescription
checkedboolean
null
The checked state of the useRadioButton.

Exposes#

Defines the methods and properties exposed by RadioButton component.

nametypedefaultdescription
groupRadioButtonGroupInstance
null
The group instance of the radio button.
stateuseRadioButtonState
null
The state of the useRadioButton.
onChange(event: useRadioButtonChangeEvent) => void
null
Callback fired when the useRadioButton's checked state changes.

Events#

Event fired when the radio button's checked state changes.

nametypedescription
valueunknownValue of the radio button.
originalEventChangeEventThe original event that triggered the change.
checkedbooleanThe checked state of the radio button.

Interfaces#

Defines passthrough(pt) options of RadioButton component.

nametypedefaultdescription
rootRadioButtonPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
inputRadioButtonPassThroughType<InputHTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the input's DOM element.
boxRadioButtonPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the box's DOM element.
iconRadioButtonPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the icon's DOM element.

Types#

Instance of RadioButton component.

values
ComponentInstance<RadioButtonProps, RadioButtonState, RadioButtonExposes>

RadioButtonGroup#

Props#

Defines valid properties in RadioButtonGroup component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: RadioButtonGroupInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: RadioButtonGroupInstance) => 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<RadioButtonGroupPassThrough>
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: RadioButtonGroupInstance) => ReactNode)
null
The children to render.
valueunknown
null
Value of the radio button group.
defaultValueunknown
null
The default value of the radio button group.
namestring
null
The name of the radio buttons.
disabledboolean
false
When present, it specifies that the radio button group should be disabled.
invalidboolean
false
When present, it specifies that the radio button group is invalid.
onValueChange(event: RadioButtonGroupValueChangeEvent) => void
null
Callback function that is called when the radio button group value changes.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by RadioButtonGroup component.

nametypedefaultdescription
updateChange(event: RadioButtonGroupUpdateChangeEvent) => void
null
Updates the value of the radio button group.

Events#

Event fired when the radio button group's value changes.

nametypedescription
valueunknownThe value of the radio button group.

Used to update the radio button group value.

nametypedescription
valueunknownValue of the radio button.
originalEventChangeEventThe original event that triggered the change.
checkedbooleanThe checked state of the radio button.

Interfaces#

Defines passthrough(pt) options of RadioButtonGroup component.

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

Types#

Instance of RadioButtonGroup component.

values
ComponentInstance<RadioButtonGroupProps, RadioButtonGroupState, RadioButtonGroupExposes>

useRadioButton#

Props#

Defines valid properties in useRadioButton.

nametypedefaultdescription
checkedboolean
null
When present, it specifies the input's checked state.
defaultCheckedboolean
null
The default value for the input when not controlled by `checked` and `onCheckedChange` .
onCheckedChange(event: useRadioButtonChangeEvent) => void
null
Callback fired when the radio button's checked state changes.

State#

Defines valid state in useRadioButton.

nametypedefaultdescription
checkedboolean
null
The checked state of the useRadioButton.

Exposes#

Defines the methods and properties exposed by useRadioButton.

nametypedefaultdescription
stateuseRadioButtonState
null
The state of the useRadioButton.
onChange(event: useRadioButtonChangeEvent) => void
null
Callback fired when the useRadioButton's checked state changes.

Events#

Event fired when the radio button's checked state changes.

nametypedescription
originalEventEThe original event that triggered the change.
checkedbooleanThe checked state of the radio button.

Types#

Instance of useRadioButton headless.

values
HeadlessInstance<useRadioButtonProps, useRadioButtonState, useRadioButtonExposes>