Switch

A toggle switch component with animated color transitions, styled for the SMAC design system.

Usage

import { Switch} from '@smartacteam/react-native-ui';
<Switch
  selected={...}
  onChange={(val) => ...}
/>

Example

Preview

Props

PropTypeRequiredDescription
labelstringNoMain label text displayed next to the switch.
descriptionstringNoSecondary description shown below the label.
selectedbooleanYesWhether the switch is currently active/on.
onChange(value: boolean) => voidNoCallback triggered when the switch toggles.
colorkeyof GlobalColorsTypeNoBackground color when switch is inactive.
activeColorkeyof GlobalColorsTypeNoBackground color when switch is active.
labelFontWeightTextWeightNoFont weight for the label (e.g., semibold, medium).
...TouchableOpacityPropsReact Native touch propsNoAny additional props passed to the underlying Pressable wrapper.
...BaseSmacStylingSMAC utility styling propsNoSupport for margin/padding/styling via design tokens.