Skip to content

Toggles - AvToggle

✨ Introduction

The AvToggle is a versatile Vue component, designed to allow the user to choose between two opposite states (active/inactive).

🏗️ Structure

None.

🏷️ Props

NameTypeDefaultMandatoryDescription
modelValuebooleanundefinedBoolean value linked to the input.
descriptionstringIndicates the purpose of the toggle.
idstringtoggle-${crypto.randomUUID()}Unique id for the toggle. Used for accessibility.
disabledbooleanundefinedIndicates if the toggle is disabled.
activeTextstring'On'Text to display next to the toggle (right) when it is active.
inactiveTextstring'Off'Text to display next to the toggle (right) when it is inactive.
namestringundefinedname attribute of the input.

🔊 Events

None.

🎨 Slots

None.

🚀 Storybook demos

You can find examples of use and demo of the component on its dedicated Storybook page.

💡 Examples of use

vue
<script>
const state = ref(false)
</script>

<template>
  <AvToggle
    v-model="state"
    description="Awesome toggle"
  />
</template>