Skip to content

Toggle

import '@sbddesign/bui-ui/toggle.js'
<bui-toggle></bui-toggle>
PropertyAttributeTypeRequiredReflectedDescription
activeactivebooleanNoYesWhether the toggle is active/on
sizesizestringNoNoToggle size: “big”, “small”
disableddisabledbooleanNoYesWhether the toggle is disabled
  • big - Large toggle size
  • small - Small toggle size
  • Active State: The active property controls whether the toggle is on or off
  • Size Control: The size property determines the visual size of the toggle
  • Disabled State: When disabled is true, the toggle becomes non-interactive
  • State Management: The active and disabled properties are reflected for reactive updates
  • User Interaction: Users can click to toggle between active/inactive states
  • Validation: The component includes validation rules for proper state management

The toggle component emits a click event when toggled:

  • Click Event: Emitted when the toggle is clicked (unless disabled)
  • State Change: The active property updates when the toggle is clicked
  • Disabled State: No events are emitted when disabled