Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Segmented Button

    Two to five related options in one connected control. Use it to switch a view or set a filter: choices that apply right away, with no submit step.

    Install

    npx shadcn@latest add @nelumbo/segmented-button

    Single select

    Exactly one option stays selected, like a radio group. The check mark grows in on the selected segment; arrow keys move between options.

    Showing the week view.

    Multiple select

    Any combination, including none. With an icon, the check mark replaces the icon instead of adding width, so the segments don't shift.

    2 filters on

    Sizes and options

    Usage

    <SegmentedButton type="single" value={view} onValueChange={setView} aria-label="Calendar view">  <SegmentedButtonItem value="day">Day</SegmentedButtonItem>  <SegmentedButtonItem value="week">Week</SegmentedButtonItem></SegmentedButton>

    Props

    PropTypeDefaultNotes
    type"single" | "multiple"requiredSingle keeps one option selected
    value / defaultValuestring | string[]Matches type
    onValueChange(value) => void
    size"sm" | "default" | "lg""default"32, 40, 48 px
    aria-labelstringName the group for screen readers
    Item: iconIconNameThe check replaces it when selected
    Item: checkbooleantrueTurn off the check mark