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
modelValueboolean—Toggle state (v-model)
sizestring—Toggle size
titlestring—Label text
subtitlestring—Description text
disabledbooleanfalseDisabled state
ariaLabelstring—Accessible label

Events ​

EventPayloadDescription
update:modelValuebooleanToggle state changed