# SwitchProps (@salmonui/inputs/switch)

> The SwitchProps interface of @salmonui/inputs/switch.

Canonical: https://salmonui.dev/docs/reference/inputs/switch/SwitchProps

```ts
import type { SwitchProps } from '@salmonui/inputs/switch';
```

Entry index: https://salmonui.dev/docs/reference/inputs/switch (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/inputs/switch.md).

## Reference

Kind: interface

```ts
interface SwitchProps extends ToggleFieldProps {
    readonly thumbIcon?: ReactNode;
}
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `thumbIcon` | `readonly thumbIcon?: ReactNode;` | optional | Icon drawn inside the thumb; decorative. |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) \| ReactNode;` | optional, inherited | Error text (or a function of the errors) shown while the field is invalid. |
| `invalid` | `invalid?: boolean;` | optional, inherited | Forces the error state. |
| `validation` | `validation?: FieldValidation;` | optional, inherited | Rules in the Data Grid vocabulary. |
| `validateOn` | `validateOn?: ValidateOn;` | optional, inherited | When errors appear; default the `Form`'s, else `'blur'`. |
| `size` | `size?: FieldSize;` | optional, inherited | Metric set. Default `'md'`. |
| `checked` | `checked?: boolean;` | optional, inherited |  |
| `defaultChecked` | `defaultChecked?: boolean;` | optional, inherited |  |
| `onCheckedChange` | `onCheckedChange?: ((checked: boolean, details: CheckedChangeDetails) => void);` | optional, inherited |  |
| `value` | `value?: string;` | optional, inherited | Submitted value when checked (native, default `'on'`). |
| `children` | `children?: ReactNode;` | optional, inherited | Label text (rendered in a real `<label for>`). |
| `labelPlacement` | `labelPlacement?: LabelPlacement;` | optional, inherited | Label before (`'start'`) or after (`'end'`, default) the control. |
| `localeText` | `localeText?: FieldValidationText;` | optional, inherited |  |
| `className` | `className?: string;` | optional, inherited |  |
| `style` | `style?: CSSProperties;` | optional, inherited |  |
| `classNames` | `classNames?: { readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; };` | optional, inherited | Part classes: `root` is `className`; `input`, `label`, `description`, `error`. |
| `ref` | `ref?: Ref<HTMLInputElement>;` | optional, inherited | The native `<input type="checkbox">`. |
