API reference: @salmonui/inputs/switch
SwitchPropsinterface
import type { SwitchProps } from '@salmonui/inputs/switch';interface SwitchProps extends ToggleFieldProps {
readonly thumbIcon?: ReactNode;
}
| Name | Signature | Description |
|---|---|---|
thumbIconoptional | readonly thumbIcon?: ReactNode; | Icon drawn inside the thumb; decorative. |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode; | Error text (or a function of the errors) shown while the field is invalid. |
invalidoptionalinherited | invalid?: boolean; | Forces the error state. |
validationoptionalinherited | validation?: FieldValidation; | Rules in the Data Grid vocabulary. |
validateOnoptionalinherited | validateOn?: ValidateOn; | When errors appear; default the |
sizeoptionalinherited | size?: FieldSize; | Metric set. Default |
checkedoptionalinherited | checked?: boolean; | |
defaultCheckedoptionalinherited | defaultChecked?: boolean; | |
onCheckedChangeoptionalinherited | onCheckedChange?: ((checked: boolean, details: CheckedChangeDetails) => void); | |
valueoptionalinherited | value?: string; | Submitted value when checked (native, default |
childrenoptionalinherited | children?: ReactNode; | Label text (rendered in a real |
labelPlacementoptionalinherited | labelPlacement?: LabelPlacement; | Label before ( |
localeTextoptionalinherited | localeText?: FieldValidationText; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
classNamesoptionalinherited | classNames?: { readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; }; | Part classes: |
refoptionalinherited | ref?: Ref<HTMLInputElement>; | The native |