Skip to content

V99Switch

I. Props

Name Type Default Description
value boolean false The value boolean of the Switch. If true it will be checked. Default value is false.
disabled boolean false If true the user won't be able to toggle the Switch. Default value is false.
onValueChange (value: boolean) => void - Invoked with the new boolean value when it changes.
size 'small' | 'medium' small Invoked with the new boolean value when it changes.

II. Usage

import { V99Switch } from 'v99-kits'

Example

<V99Box paddingLeft={V99Spacing.s20}>
    <V99Text T1 marginVertical={V99Spacing.s16}>
        Switch small
    </V99Text>
    <V99Switch
        value={value}
        onValueChange={value => setValue(value)}
        size={'small'}
    />

    <V99Text T1 marginVertical={V99Spacing.s16}>
        Switch medium
    </V99Text>
    <V99Switch
        value={value}
        onValueChange={value => setValue(value)}
        size={'medium'}
    />

    <V99Text T1 marginVertical={V99Spacing.s16}>
        Switch small disable
    </V99Text>
    <V99Switch
        value={false}
        onValueChange={value => setValue(value)}
        size={'small'}
        disabled={true}
    />

    <V99Text T1 marginVertical={V99Spacing.s16}>
        Switch medium disable
    </V99Text>
    <V99Switch
        value={false}
        onValueChange={value => setValue(value)}
        size={'medium'}
        disabled={true}
    />
</V99Box>

Demo

Demo