Skip to main content

Switch

 

⚠️ Experimental Component

This component is still being evaluated and may change in future releases.

 

Switch components render a pre-styled switch that can easily be re-style by using props.

Example banner Example banner

Implementation code

import { Switch } from '@nexara/nativeflow';

const Component = () => {
return (
<Switch
checked={true}
size={0.8}
color='#000000'
onChange={(e) => console.log(e)}
/>
);
}
export default Component;

Props

PropTypeDefaultDescription
checkedbooleantrueIndicates whether the switch is on (true) or off (false).
colorstringSets the color of the switch thumb.
disabledbooleanfalseDisables the switch if set to true.
sizenumber0.8Scales the size of the switch using a multiplier.
activeTrackColorstringColor of the track when the switch is checked.
inactiveTrackColorstringColor of the track when the switch is not checked.
onChangefunctionCallback function that is fired when the switch value changes.