Switch

A switch control contains a knob that slides along a track. All parts are required to make a switch.

TypeResource
DesignFigma
WebWeb Storybook
CodeGitlab

Usage

import { Switch } from 'bio-bind-ui';
<Switch
  label='Label'
  labelPosition='right'
  mode='light'
  onChange={() => {}}
  size='md'
  variant='primary'
/>

Examples

Label Position

For set label position left or right


Variant

For set variant color primary or secondary


Mode (Optional)

For change light & dark mode


Props

PropsRequiredDefaultTypedescription
variantfalseprimaryprimary secondarySelect variant primary or secondary.
modefalselightlight darkChange mode light or dark.
labelfalselabelstringChange label name.
labelPositionfalserightleft rightSet label position left or right.
isErrorfalsefalsebooleanChange error state.
sizefalsemdsm md lgChange size.
disabledfalsefalsebooleanChange disable state.
onChangetrue-event: React.ChangeEvent<HTMLInputElementCallback function to run when the switch is changed.
checkedtruefalsebooleanChange checked state.
idtrue-stringA unique identifier for the switch.
BIND © Biofarma Innovate Next-level Design .