• Docs
  • Components
  • Toggle Button

ToggleButton - Aspect UI

The ToggleButton component switches between active/inactive states. Useful for toggling filters, views, or modes, it supports icons, accessibility, and group behavior.

Table of Contents#

Toggle Props#


PropTypeDefaultDescription
valuestring-The value associated with the toggle, passed to onChange when clicked.
childrenReact.ReactNode-Content to be displayed inside the toggle.
classNamestring''Additional CSS class for the toggle element.
defaultSelectedbooleanfalseWhether the toggle is initially selected.
outlinebooleanfalseWhether the toggle has an outline style.
disabledbooleanfalseWhether the toggle is disabled.
sizesmall medium large'medium'Size of the toggle button.
onChange(value: string, selected: boolean) => void-Callback when the toggle selection state changes.

Toggle Button Props#


PropTypeDefaultDescription
valuestring-The value associated with the toggle button.
childrenReact.ReactNode-Content to be displayed inside the toggle button.
classNamestring''Additional CSS class for the toggle button element.

Toggle Button Group Props#


PropTypeDefaultDescription
childrenReact.ReactNode-Toggle buttons to be rendered inside the group.
typesingle multiple-Defines whether one or multiple toggles can be selected at once.
defaultValuestring string[]-Initial selected value(s) for the group.
onChange(value: string string[]) => void-Callback when the selected value(s) change.
classNamestring''Additional CSS class for the toggle button group element.
outlinebooleanfalseWhether the toggle buttons in the group use the outline style.
disabledbooleanfalseWhether the toggle button group is disabled.