segmented-control component

Drop-in semantic component. See examples, sizes, variants, and source.

A styled radio-button group built from a segmented-control container with segment children, where exactly one carries active. Layer modifiers for size, color, density (compact, icon-only), shape (pills, basic, outline), and orientation (vertical, fluid, responsive). Selection is plain HTML — wire it up with the on click handlers from the BlueStack framework or by powering it through segmented-control.js.

Segmented Control

Basic Segmented Control

Size Variants

Semantic Color Variants

Extended Color Palette

Segmented Control with Icons

Icons with Text

Icon Only

Layout Variations

Fluid Width

Vertical Orientation

Compact Style

Style Variations

Pills Style

Basic Style

Outline Style

States and Interactions

Disabled Segments

With Data Values

Selected: day

Loading State

Interactive Example

View Switcher

Chart View

Responsive Behavior

Responsive Segmented Control

This control stacks vertically on mobile screens (< 640px)

Class API Reference

Type Class Usage Notes
Base segmented-control Outer container that hosts the segments Always required
segment Individual option button One per choice
active Marks the currently selected segment Modifier on segment — exactly one
Sizes xs 28px tall — tiny Modifier on segmented-control
sm 32px tall — small Modifier on segmented-control
(default) 36px tall — medium No size class needed
xl 40px tall — large Modifier on segmented-control
lg 44px tall — big Modifier on segmented-control
Style Variants (default) Grey track with white pill on the active segment No style class needed
pills Fully rounded track and segments Modifier on segmented-control
basic No background track; standalone bordered buttons Modifier on segmented-control
outline Bordered look — promoted to a Tailwind site override Modifier on segmented-control
Density / Layout icon-only Tighter padding for icon-only segments Modifier on segmented-control
compact Reduced segment padding Modifier on segmented-control
fluid Spans the full container width Modifier on segmented-control
vertical Stack segments vertically Modifier on segmented-control
responsive Stacks vertically on screens < 640px Modifier on segmented-control
Semantic Colors primary Blue active segment Modifier on segmented-control
positive / success Green active segment Modifier on segmented-control
negative / error Red active segment Modifier on segmented-control
warning Yellow active segment Modifier on segmented-control
info Light blue active segment Modifier on segmented-control
orange teal violet purple pink Extended palette accent colors Decorative; prefer semantic names
States / Misc disabled Greyed out and non-interactive HTML attribute on segment
dark Dark grey track for inverted surfaces Modifier on segmented-control