KasyKasy

Toggle Button Group

Live preview and documentation for the Toggle Button Group component.

Preview

componentPreview.loading

About

Groups several KasyToggleButtons into a single single-select or multi-select control, like a segmented control or a set of separate pills.

  • items: a list of KasyToggleButtonItem (label and/or icon, prefixIcon, suffixIcon, enabled).
  • selected / onChanged: the set (Set<int>) of selected indices and the callback with the new set.
  • selectionMode: single (exclusive selection, default) or multiple.
  • isAttached: true (default) joins the cells into a single rounded container with thin dividers; false separates each toggle into an independent pill.
  • orientation: Axis.horizontal (default) or Axis.vertical.
  • size: sm, md (default), or lg, passed down to each KasyToggleButton.
  • expand: stretches the cells to fill the main axis.

When isAttached is true, each cell uses the ghost variant (transparent, blends into the group's neutral background); when false, it uses filled as a standalone pill.

Last updated on 08/23/2026

On this page