Switch

An accessible toggle switch.

Use Switch to toggle a boolean setting on or off.

import { defineComponent, ref } from 'vue';
import { Switch } from '@tile-ui/vue';
 
export default defineComponent({
	name: 'SwitchDemo',
	setup() {

Registry install

pnpm dlx shadcn@latest add @tile-ui/switch

Package usage

import { Switch } from '@tile-ui/vue';
 
<Switch />

Highlights

  • Two sizes
  • Accessible switch role
  • Pairs with Field and Form

Registry dependencies

Item Purpose
switch Component source and module styles
core Framework-agnostic logic helpers
styles Shared SCSS tokens and globals

API reference

Switch

Prop Type Default
size 'default' | 'sm'