shadcn.io is not affiliated with official shadcn/ui
Customer Segments Dashboard Block for Svelte
A rule row of plan, region, minimum ARR and a quiet-for-30-days switch over forty accounts, with matching accounts, revenue, average deal and churn, five presets and the six biggest matches.
Installation
Overview
Build a customer segment and see what it is worth, with this segment builder for Svelte with Ark UI. A hairline frame with a plus mark on each corner opens with a rule row: a plan and a region Native Select, a minimum ARR Number Input and a Switch for accounts that have been quiet for 30 days or more. Under it four figures are worked out from the forty typed accounts that match (how many, the revenue a year, the average deal and the share that churned), then a table lists the six biggest matching accounts with their plan, region, ARR and last activity. Five preset buttons (Enterprise, Mid-market, Startup, Individual and Churn risk) set the rules in one press, and the one that matches the current rules is shown as pressed. A rule set that matches nothing shows an empty state with a button that clears the rules, inside the same frame so the panel never changes height. Nothing is saved or sent. Below the large breakpoint the rule row stacks. It's built from Native Select, Number Input, Switch, Button, Empty and Guides. For growth and customer success teams.
FAQ
How do I use my own accounts?
Replace the RAW lines, each name|plan|region|ARR|days since last activity|churned, or swap the parser for rows from your database. The plans and regions come from PLANS and REGIONS. Matching, totals, the averages and the six rows are derived from those accounts and the current rules.
How do the rules combine?
Every rule that is set must hold at once. Any plan and any region leave those rules open, the minimum is a floor on ARR, and the switch keeps only accounts whose last activity was more than 30 days ago, which includes the churned ones. The status line spells the rules out in words after you stop changing them.
What do the presets set?
Enterprise picks the Enterprise plan, Mid-market the Business plan with $20,000 of ARR or more, Startup and Individual their plans, and Churn risk accounts of $10,000 or more that have been quiet for 30 days. A preset replaces all four rules, and changing any rule afterwards releases the pressed state.
What stays local, and how do I wire it for real?
The accounts are typed and the rules live in component state. To make it real, query your customer table with the same four rules, let people name and save a segment, and send it to the tool that runs your campaigns.