One choice out of a few as a pill track of pressed-or-not buttons on Base UI's ToggleGroup and Toggle (roving arrow keys, aria-pressed). Selection never empties; pressing the pressed option reports onReselect. The pressed option has a fill and an edge at least 3:1 against the track. sm/md/lg heights (md 28px by default) through the control-height variables, per-option tooltips and names, and a wrapping layout.
pnpm dlx shadcn@latest add "https://pluginui.com/r/core-segmented-control.json"