# SwitchProps

Props for [`Switch`](https://docs.mapcairn.com/api/map/Switch.md).

This is an interface exported by `@mapcairn/map`, checked against version 0.2.0.

## Signature

```ts
import type { SwitchProps } from "@mapcairn/map";
 
interface SwitchProps
```

## Properties

### "data-testid"

```ts
readonly "data-testid"?: string;
```

Applied to the control. The row gets the same id with a `-row` suffix.

### checked

```ts
readonly checked: boolean;
```

Whether the switch is on. The component is controlled.

### className

```ts
readonly className?: string;
```

Applied to the row element.

### description

```ts
readonly description?: string;
```

Optional supporting text, announced as the control's description.

### disabled

```ts
readonly disabled?: boolean;
```

Stops the switch from being toggled and dims it.

### label

```ts
readonly label: string;
```

The visible label. Required: a switch is never unnamed or named only by an icon.

### onCheckedChange

```ts
readonly onCheckedChange: (checked: boolean) => void;
```

Called with the next state when the user toggles the switch.

Source: [packages/map/src/ui/Switch/Switch.tsx:10](https://github.com/MapCairn/mapcairn/blob/main/packages/map/src/ui/Switch/Switch.tsx#L10)
