Back to Twenty

Toggle

packages/twenty-docs/twenty-ui/input/toggle.mdx

2.2.0741 B
Original Source
<Tabs> <Tab title="Usage">
jsx
import { Toggle } from "twenty-ui/input";

export const MyComponent = () => {
  return (
    <Toggle
    value = {true}
    onChange = {()=>console.log('On Change event')}
    color="green"
    toggleSize = "medium"
    />
  );
};
</Tab> <Tab title="Props">
PropsTypeDescriptionDefault
valuebooleanThe current state of the togglefalse
onChangefunctionCallback function triggered when the toggle state changes
colorstringColor of the toggle when it\s blue color
toggleSizestringSize of the toggle, affecting both height and weight. Has two options: small and mediummedium
</Tab> </Tabs>