shadcn.io is not affiliated with official shadcn/ui
Seat Management Billing Block for React
Seats on a team plan: members with a role each (viewers are free), a stepper for the seats you pay for, and the monthly and prorated cost worked out before you save.
Installation
Overview
Let a team lead manage who pays for what, with this seat management section for React with Base UI. A hairline frame with a plus mark on each corner holds the members in a list ruled by Guides and the seats beside it. Each member has an Avatar with initials, a name and email, a role in a Native Select (the owner's is fixed) and an outline Badge that says whether the role uses a seat or is free: viewers take none. The seats panel has a Number Input for the seats you pay for, a Progress bar in your foreground color showing how many are in use, the current and the new monthly price (the new one rolling with Sliding Number) and what the change costs: prorated today when you add seats, at renewal when you remove them. A Shine Button saves it, the only colored control. On a phone the seats panel comes first and the new total and the button ride a bar fixed to the foot of the panel. For team plans, workspaces and any per-seat product.
FAQ
How do I change the members, roles and price?
Edit MEMBERS (each has a name, email, initials and starting role), ROLES, SEAT_PRICE, PAID_START for the seats the account pays for, and DAYS_LEFT and PERIOD_DAYS for the proration. Seats are used by everyone who isn't a viewer, so changing a role to Viewer frees a seat at once, and the in-use count and the progress bar follow.
How is the cost change worked out?
Adding seats charges the difference now, for the part of the period that remains: the added seats times the price times the days remaining over the days in the period. Removing seats takes effect at renewal, with no refund for this period. The new monthly price is simply the seats times the seat price. These are the rules the example uses; make them match your billing provider's proration settings before you show them to customers.
What stops someone going below the seats in use?
The stepper can't go below the number of people who use a seat. Typing a lower number is held at that count and says how many people need a seat, and that moving someone to Viewer lowers it. The top limit is 100 seats.
What does the button do?
Its label says the change ("Add 2 seats", "Remove 1 seat") and it's disabled while there's nothing to save. Pressing it makes the new count the seats you pay for and announces it; send the change to your billing provider there. The example starts with two seats added to show the cost before saving.
How does it work with a keyboard and a screen reader?
Each role select is named for its member ("Role for Daniel Reyes"), the seats field has its own stepper buttons, and a polite status message reads out the seats in use, the new total and what it costs whenever one changes. The progress bar repeats what the text says, so it's hidden from assistive technology.
How does it look on a phone?
The seats panel comes first, so the stepper and the cost are on the first screen, then the members, each as two lines: the person, and under them the role and the badge. The total and the save button stay on a bar at the foot of the panel while you scroll through the members.
Related
- Pro
Current Plan Billing
Plan and usageThe account's current plan in app settings: plan, price, renewal date and card, a change-plan action, every quota's usage this period on shared hairlines, and the next invoice.
- Pro
Per-Seat Pricing by Seat Type
Seats and teamsSeat-type pricing with a stepper for each type: Full, Collaborator and Viewer seats at different prices, a stacked bar of the seat mix, a live monthly total and, on a phone, a sticky total bar.
- Pro
Team Size Slider With Volume Discounts
Seats and teamsA seat calculator: a slider sets the team size with its count riding the thumb, ticks at the 10, 25 and 50 seat discounts, shortcuts to them, and a panel that rolls the seat price and monthly total.
- Pro
Hybrid Seat and Usage Pricing
Seats and teamsOne bill for seats plus metered usage: a seat stepper and an events slider move a two-part bar that splits the total into its fixed and variable parts, with line items and a sticky total on phones.
- Pro
Per-User Pricing as One Sentence
Seats and teamsThe simplest per-user price, said as one giant sentence, '$8 per user, per month.', with a small stepper for the team's users and a monthly total beside it.
- Pro
Spend by Project Billing
Plan and usageSpend management for a usage-billed product: this period's spend per project, a budget bar with a tick at the alert threshold, the trend against last period, inline budget editing and the account's hard cap.