Switch
An on/off setting, tinted with your accent.
Import
import {Switch} from '@hzblj/kara-ui'Props
SwiftUI Toggle / Compose Switch, tinted fill.accent.primary.
| Prop | Type | Default | Description |
|---|---|---|---|
| value* | boolean | — | Whether it is on. Controlled: pass back what |
| disabled | boolean | false | Stops the user flipping it, and dims it. |
| label | string | — | Shown beside the switch. On Android it makes a full-width row — label at the start, switch at the end — that toggles wherever it is tapped. |
| onValueChange | (value: boolean) => void | — | Called with the new value when the user flips it. On Android a flip plays |
Whether it is on. Controlled: pass back what onValueChange reports.
Stops the user flipping it, and dims it.
Shown beside the switch. On Android it makes a full-width row — label at the start, switch at the end — that toggles wherever it is tapped.
Called with the new value when the user flips it. On Android a flip plays toggleOn / toggleOff.
Platform notes
- With a
label, the whole row toggles. - Android plays
toggleOn/toggleOff, which Compose’s switch does not; iOS’s own switch keeps its own feedback.