Skip to content

Switch


View Source 

Usage

css
@import "winduum/src/components/switch/index.css" layer(components);

Variants

  • default 
  • interactive 
  • invalid 

Props

  • default 
  • interactive 

Installation

Follow instructions for individual framework usage below

  • winduum 
  • winduum-vue 
  • winduum-react 

Examples

Basic

html
<div class="x-switch">
    <input type="checkbox">
    Switch
</div>
vue
<script setup lang="ts">
    import { Switch } from '@/components/switch'
</script>

<template>
    <Switch class="x-switch">
        <input type="checkbox">
        Switch
    </Switch>
</template>
jsx
import { Switch } from '@/components/switch'

export function Example() {
    return (
        <Switch class="x-switch">
            <input type="checkbox" />
            Switch
        </Switch>
    )
}

Small

html
<div class="x-switch sm">
    <input type="checkbox">
</div>

Large

html
<div class="x-switch lg">
    <input type="checkbox">
</div>

Disabled

html
<div class="x-switch">
    <input type="checkbox" disabled>
    Switch
</div>

Released under the MIT License.