AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Entry

Segmented

Switch between a few mutually-exclusive options inline — labels, leading icons, or icon-only, in three sizes.

Examples

Size
Content
Block
Segmented · leading icons · a disabled option · size medium (default)
Interactive · click to switch
Week
Icon-only (aria-label) · block · whole-control disabled

API

PropTypeDefaultNotes
optionsstring | JSON arrayPipe labels "Day|Week|Month" OR items [{value,label?,icon?,disabled?,ariaLabel?}]
valuestringfirst optionSelected option value
size'small' | 'medium' | 'large'mediumHeight/padding/font/radius scale
blockbooleanfalseFull-width; options flex-equal
disabledbooleanfalseDims and disables the whole control
changeCustomEvent<{value,index}>Composed event; read e.detail.value

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-segmented';   // registers <aha-segmented>

Agent feed for this component (absolute, fetchable anywhere): segmented.agent.json · segmented.md · segmented.llms.txt

When to use

When to use
  • Segmented — 2–4 short, mutually-exclusive views or modes that switch in place
  • Tabs — navigating between larger content panels
  • Select — one option from a longer list that needn't be all visible
Keep labels to one word where possible and the option count small (2–4). Icon-only options MUST carry an aria-label. It is a single-select control — for a magnitude use Rate or a Slider.
Surfaces
editor dashboard settings

Spec

Track gray-20 #F7F7F7, radius 8 (sm 6 · lg 12), pad 2 · Thumb bg-container #FFFFFF, radius 6, slides on select · Segment medium h32 pad 0 16 · small h24 12/12px · large h40 20/16px, SemiBold 600 · Content label · leading icon (16) + label · icon-only (aria-label required) · Selected text-default #1A1A1A over the thumb · Disabled per-option or whole control → text-disabled, not-allowed · Block full-width track, options flex-equal