shadcn.io is not affiliated with official shadcn/ui
Centered Audience Tabs Hero Block for React
A compact centred hero with a role switch in a band that swaps the headline, the subtitle and a band of three checklist cells for designers, engineers and product teams.
Installation
Overview
A compact, centred hero that lets each visitor pick who they are, for a fictional design-system platform. A segmented switch sits in a band between solid page rails and offers Designers, Engineers and Product; choosing one swaps the two-line headline, the subtitle and a band of three checklist cells for copy written for that role, with a short fade and rise as the new copy comes in. Two actions sit between them and stay where they are whichever role is picked: a ShineButton that sweeps a light across it on hover, and an outline Button, both links. The bands draw their rules with Guides, with + marks where they meet the rails. It's built from Segment Group, Shine Button, Button and Guides, with Lucide check icons and CSS transitions only. For products that serve several personas with different reasons to buy: design tools, developer platforms, product suites and collaboration software.
FAQ
How do I change the roles and their copy?
Edit AUDIENCES at the top of the file. Each role has an id, the label on its segment, the headline's two lines (headlineStart and headlineEnd), a subtitle and its features. Add or remove a role and the switch grows or shrinks with it; keep two to four roles with short labels so the switch fits on a phone. The checklist band is three columns, so keep three features per role. The role shown first is the state's starting value, engineers: start with the role most of your visitors have.
Why don't the buttons move when the copy changes?
Every role's headline, subtitle and checklist is also rendered, invisible and hidden from screen readers, in the same grid cell as the copy on show, so each area is always as tall as the longest role at the current width. The text can differ in length from role to role, and the actions and bands around it stay put.
How do keyboard and screen reader users switch roles?
The switch is our Segment Group: a radio group named Your role. Tab moves into it, the arrow keys change the role, and a screen reader announces each choice as a radio button that's selected. The copy sits in a polite live region, so after a change the new headline, subtitle and checklist are read once the visitor stops. There's still one h1 on the page: the headline of the role on show.
How do I remember the role or track which one converts?
Call your analytics in the switch's onValueChange handler with the new role, and pass the role on with the calls to action, in their links or as a property of the click event, to see which persona signs up most. To keep the choice between visits, put it in the URL (?role=designers) and read it back for the default.
What moves, and what happens with reduced motion?
The switch's background slides to the selected role, and each time the role changes the new copy and checklist fade and rise into place. On first load the switch band and the actions fade in the same way. It's all CSS transitions, with no animation library. With reduced motion, the copy changes at once and the switch's background jumps to its new place.
How does the hero fit on a phone?
The switch band and the headline come first, then the actions, all within the first screen. The checklist's three cells stack into three ruled rows, and the switch's labels are short enough to fit at 320px.
When should I use audience tabs instead of a single-message hero?
Use audience tabs when one product serves different people for different reasons, and each would scroll past a pitch written for someone else. Use a single headline when your positioning is unified or one persona brings most of your sign-ups: a switch adds a decision before the visitor has read anything.
Related
- Pro
Tabbed Feature Showcase Hero
Interactive demosA split hero for a code assistant: a headline, a Shine Button and an outline action at the start, and at the end a framed card with underline tabs for features, integrations and pricing.
- Pro
Tabbed Product Views Hero
Interactive demosA centred showcase hero with a Shine Button and an outline action over a pill tab switch and one wide product window in a hairline frame that shows a chat, a terminal session or a docs page.
- Pro
Split Layout Tab-Switch Browser Hero
Interactive demosA showcase hero for a project workspace: the headline beside its pitch and a Shine Button, then a browser window in a hairline frame whose tabs switch between three drawn views: Projects, Analytics and Settings.
- 12345Pro
Split Layout Numbered Feature List Hero
Features and tablesA split hero between solid rails: an announcement link, a headline and a Shine Button with an outline button on one side, a divider, and a numbered list of six features as ruled rows on the other.
- Pro
A centered single-plan hero with a monthly and annual switch under the headline, then one band split by a hairline: the price beside a Shine Button, and six included features.
- Pro
Centered Tech Icon Row Hero
Logos and social proofA showcase centered hero for an integrations story, with a headline, a sentence, a Shine Button and six tool tiles below on shared hairlines, each with what the product does with the tool.