Skip to content

Toggle

Switch control for binary on/off states with optional title and subtitle.

Open in Storybook

Interactive Demo

Dark mode
Use dark theme across the app
Email notifications
Receive updates about your account
Disabled toggle

Usage

vue
<script setup>
import { ref } from 'vue';
import { Toggle } from '@yellowcard/b2b-design-system';

const enabled = ref(false);
</script>

<template>
  <Toggle
    v-model="enabled"
    title="Email notifications"
    subtitle="Receive updates about your account"
  />
</template>

API Reference

Props

PropTypeDefaultDescription
modelValuebooleanToggle state (v-model)
sizestringToggle size
titlestringLabel text
subtitlestringDescription text
disabledbooleanfalseDisabled state
ariaLabelstringAccessible label

Events

EventPayloadDescription
update:modelValuebooleanToggle state changed