Toggle Switch
Toggle provide users with different selection and activation tools.
install | yarn add @clayui/form |
---|---|
version | 3.122.0 |
Stable3.122.0View in LexiconCHANGELOG
Toggle
Property | Description |
---|---|
containerProps React.HTMLAttributes<HTMLSpanElement> | The default value is {} |
disabled boolean | |
id string | |
label React.ReactText | |
onToggle (val: boolean) => void | |
sizing string | |
spritemap string | |
symbol {on: string; off: string} | |
toggled boolean | |
type 'checkbox' | 'radio' | The default value is 'checkbox' |
value string | |
role
| The default value is 'switch' |
RadioGroup
Property | Description |
---|---|
children Array<
React.ReactElement<IRadioProps> | React.ReactElement<IToggleProps>
> | Takes either Radio or Toggle as a child. |
defaultValue React.ReactText | Property to set the default value (uncontrolled). |
inline boolean | Flag to indicate if radio elements should display inline. |
name string | Form element name that is applied to each radio element. |
onChange InternalDispatch<React.ReactText> | Callback function for whenever a radio element is selected (controlled). |
onSelectedValueChange DeprecatedInternalDispatch<React.ReactText> | Callback function for whenever a radio element is selected.
@deprecated since v3.51.0 - use onChange instead. |
selectedValue DeprecatedReact.ReactText | The value that corresponds to the selected radio element. Leave
undefined if no option is selected.
@deprecated since v3.51.0 - use value instead. |
value React.ReactText | The value property sets the current value (controlled). |