Skip to content

shadcn.io is an independent project built on shadcn/ui

Status Selector Button Group for Vue

Status buttons for To Do through Done, and for Backlog, Active, and Completed, sharing one value from To Do.

UI library: Ark UI

One status, two workflows, starting at To Do. The first row is To Do, In Progress, Review, and Done. The second is Backlog, Active, and Completed. Picking Active clears To Do. Any step can be picked, including a jump to Done. The value is only stored, not saved.

Keep the row that matches the workflow. These are pressed buttons, not radios. Arrow keys in one stop need a Radio Group. In Vue, Ark UI does not save the status.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Button Group anatomy: root, group, button, separator

Usage

<div class="flex flex-col gap-4">
  <ButtonGroup aria-label="Status">
    <Button
      v-for="item in STATUSES"
      :aria-pressed="status === item.value"
      :key="item.value"
      @click="handleSelect"
      size="sm"
      :value="item.value"
      :variant='status === item.value ? "default" : "outline"'
    >
      {{ item.label }}
    </Button>
  </ButtonGroup>
  <ButtonGroup aria-label="Stage">
    <Button
      v-for="item in STAGES"
      :aria-pressed="status === item.value"
      :key="item.value"
      @click="handleSelect"
      size="sm"
      :value="item.value"
      :variant='status === item.value ? "default" : "outline"'
    >
      {{ item.label }}
    </Button>
  </ButtonGroup>
</div>

FAQ

How is the status tracked?

One value, starting at todo. Each button carries its own value, such as inProgress, and pressing it stores that value. The matching button gets variant="default" and aria-pressed.

Do the two rows share a selection?

Yes. Picking Active clears To Do. Keep the row that matches your workflow.

Can someone skip from To Do to Done?

Yes, any button can be picked. Disable the steps that aren't allowed yet if your workflow enforces an order.

Does the demo save the status?

No. It only stores it in the component. Send the value to your API when it changes.

Why are the stored values different from the labels?

Each item in the data has a label, such as In Progress, and a value, such as inProgress. Store whatever key your backend uses.

What size are the buttons?

All use size="sm", and outline when not selected.

API Reference

Button Group

Sets aria-label="Status" and aria-label="Stage". The rest is on the Button Group page.

Button

Sets v-for="item in STATUSES", aria-pressed="status === item.value", key="item.value", click="handleSelect", size="sm" and value="item.value". The rest is on the Button page.