Skip to main content

Radio API

Radio API#

Name RequiredTypeDefault ValueDescription
animationNo"smooth" | "jelly" | "tada" | "rotate" | "pulse"Tne kind of animation to apply to the checkbox or radio.
biggerNobooleanSet true to make the control a little bit larger. For more control, use `font-size` in CSS on `.pretty`.
colorNo"primary" | "success" | "info" | "warning" | "danger" | "primary-o" | "success-o" | "info-o" | "warning-o" | "danger-o"Choose a color (solid or outline) to apply to the control.
hasFocusNobooleanSet true to enable focus styling.
iconNoReactElement<any, "img" | "svg" | "i" | "em">The icon to pass (as JSX) to the checkbox or radio.
lockedNobooleanSet true to enable locked mode.
plainNobooleanSet `true` to enable plain styles when to checkbox or radio is selected.
setStateNoDispatch<SetStateAction<string | boolean>>The state dispatch function either from the `setState` hook or a reference to `this.setState`.
shapeNo"curve" | "round"The shape of the checkbox or radio.
stateNostring | booleanThe state of the control. Typically a boolean, string, or string array.
variantNo"thick" | "fill"The fill, or variant of the checkbox or radio.

useRadioState API#

Name RequiredTypeDefault ValueDescription
onChangeNoChangeEventHandler<HTMLInputElement>
stateNostring | boolean

useRadioState Return#

NameTypeDescription
statestring | booleanThe state object of the radio. This can be a boolean or an array of items.
setStateReact.Dispatch<React.SetStateAction<typeof state>>The React dispatch function from useState or a reference to this.setState
onChangeReact.ChangeEventHandler<HTMLInputElement>The change handler to be called by the input control when a change event fires. This calls setState for you