Skip to content
Haze UI

Team selector

Sculptural team seat selector card with tinted overlapping initials avatars, bold circular stepper, live pricing and native form input.

pnpm dlx shadcn@latest add @haze/team-selector
Open preview in a new tab
Livesmall script

When to use

  • Onboarding, billing or plan upgrade forms let users pick a team size with live avatar and pricing feedback
  • A compact card control needs to submit a numeric seat count inside a native HTML form

When not to use

  • Only a read-only avatar stack is needed without editing; use avatar-group
  • A plain numeric quantity without member identity or pricing is sufficient; use quantity-stepper
  • Users switch between existing workspaces rather than selecting team size; use workspace-switcher

Installation

Add the Haze registry to components.json once, then install Team selector with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/team-selector
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
id*string–Unique ID associating the label, native number input and stepper buttons.
namestring"teamCount"Form field name submitted when placed inside a native form.
labelstring"Team size"Top-left eyebrow label for the selector card.
members{ name: string; role?: string; src?: string }[]6 sample membersRoster used to derive colored initials avatars.
valuenumber3Initial selected seat count clamped between min and max.
minnumber1Lowest allowed seat count.
maxnumber10Highest allowed seat count.
maxAvatarsnumber5Maximum avatars shown before displaying a +N overflow badge.
unitstring"seat"Singular unit label displayed beneath the count and in the price line.
unitPluralstring"seats"Plural unit label displayed beneath the count.
pricePerSeatnumber12Unit seat price used to compute the live footer total; set 0 to hide pricing.
currencystring"$"Currency symbol formatted before seat and total amounts.
billingPeriodstring"month"Billing period suffix shown after the live total.
classstring–Additional classes on the outer card container.

Keyboard interactions

TabShiftTab
Move focus between the decrease and increase circular stepper buttons
EnterSpace
Decrement or increment the team seat count and update live avatars and total

Accessibility

  • Includes a labeled native <input type="number" class="sr-only"> so the selected seat count submits inside standard forms.
  • Circular stepper buttons use aria-controls pointing to the input and aria-disabled at min/max bounds so focus is never lost.
  • Announces seat count updates via an aria-live polite region and disables avatar pop animation under prefers-reduced-motion.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Team selector" with `npx shadcn@latest add @haze/team-selector`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import TeamSelector from "@/components/haze/ui/team-selector.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/team-selector.md

  • Customize with real content

    Adapt the Haze team-selector ui for our product. Replace the demo values of these props with our real content: id, name, label, members, value, min, max, maxAvatars, unit, unitPlural, pricePerSeat, currency, billingPeriod, class. Keep the layout, the heading level rules and these accessibility details: Includes a labeled native <input type="number" class="sr-only"> so the selected seat count submits inside standard forms. Circular stepper buttons use aria-controls pointing to the input and aria-disabled at min/max bounds so focus is never lost. Announces seat count updates via an aria-live polite region and disables avatar pop animation under prefers-reduced-motion. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using team-selector, check it fits: use it when onboarding, billing or plan upgrade forms let users pick a team size with live avatar and pricing feedback; a compact card control needs to submit a numeric seat count inside a native html form. Avoid it when only a read-only avatar stack is needed without editing; use avatar-group; a plain numeric quantity without member identity or pricing is sufficient; use quantity-stepper; users switch between existing workspaces rather than selecting team size; use workspace-switcher. Alternatives: @haze/avatar-group, @haze/quantity-stepper, @haze/workspace-switcher.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog