Tabs
Shadcn tabs reconstructed on Proto UI.
Ordinary demos on this page explicitly use Shadcn Rhea, with matching examples. This does not change public compatibility defaults or imply complete browser, native-host or visual acceptance. Neutral Surface/Text atoms retain their own public semantics; the consumer composition supplies the family presentation theme.
<wc-shadcn-tabs-root style-profile="rhea" default-value="account">
<wc-shadcn-tabs-list style-profile="rhea">
<wc-shadcn-tabs-trigger style-profile="rhea" value="account">Account</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="rhea" value="password">Password</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="rhea" value="billing" disabled>Billing</wc-shadcn-tabs-trigger>
</wc-shadcn-tabs-list>
<wc-shadcn-tabs-content style-profile="rhea" value="account">Make changes to your account here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="rhea" value="password">Change your password here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="rhea" value="billing">Billing tab is disabled in this preview.</wc-shadcn-tabs-content>
</wc-shadcn-tabs-root>Style Profile preset exhibition
Section titled “Style Profile preset exhibition”The upstream Shadcn Registry defines multiple style profiles for Tabs (vega, nova, maia, lyra, mira, luma, sera, rhea, new-york-v4). Only nova, rhea, and new-york-v4 currently have bounded text-default projection (see internal/fixtures/shadcn-tabs-style/coverage.json); unsupported profiles are rejected at runtime.
The three examples below use identical children, defaultValue, and disabled state, changing only styleProfile, to demonstrate that preset switching does not reset value, focus, or children. Each example renders independently and does not share runtime instances.
<wc-shadcn-tabs-root style-profile="nova" default-value="account">
<wc-shadcn-tabs-list style-profile="nova">
<wc-shadcn-tabs-trigger style-profile="nova" value="account">Account</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="nova" value="password">Password</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="nova" value="billing" disabled>Billing</wc-shadcn-tabs-trigger>
</wc-shadcn-tabs-list>
<wc-shadcn-tabs-content style-profile="nova" value="account">Make changes to your account here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="nova" value="password">Change your password here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="nova" value="billing">Billing tab is disabled in this preview.</wc-shadcn-tabs-content>
</wc-shadcn-tabs-root>Rhea (current default exhibition)
Section titled “Rhea (current default exhibition)”<wc-shadcn-tabs-root style-profile="rhea" default-value="account">
<wc-shadcn-tabs-list style-profile="rhea">
<wc-shadcn-tabs-trigger style-profile="rhea" value="account">Account</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="rhea" value="password">Password</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="rhea" value="billing" disabled>Billing</wc-shadcn-tabs-trigger>
</wc-shadcn-tabs-list>
<wc-shadcn-tabs-content style-profile="rhea" value="account">Make changes to your account here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="rhea" value="password">Change your password here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="rhea" value="billing">Billing tab is disabled in this preview.</wc-shadcn-tabs-content>
</wc-shadcn-tabs-root>New York v4
Section titled “New York v4”<wc-shadcn-tabs-root style-profile="new-york-v4" default-value="account">
<wc-shadcn-tabs-list style-profile="new-york-v4">
<wc-shadcn-tabs-trigger style-profile="new-york-v4" value="account">Account</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="new-york-v4" value="password">Password</wc-shadcn-tabs-trigger>
<wc-shadcn-tabs-trigger style-profile="new-york-v4" value="billing" disabled>Billing</wc-shadcn-tabs-trigger>
</wc-shadcn-tabs-list>
<wc-shadcn-tabs-content style-profile="new-york-v4" value="account">Make changes to your account here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="new-york-v4" value="password">Change your password here.</wc-shadcn-tabs-content>
<wc-shadcn-tabs-content style-profile="new-york-v4" value="billing">Billing tab is disabled in this preview.</wc-shadcn-tabs-content>
</wc-shadcn-tabs-root>Content mount policy
Section titled “Content mount policy”TabsContent uses a lazy L1 view by default:
- only the current panel materializes a host view;
- an inactive panel detaches its view while preserving its Proto instance, state, and exposes;
keepMounted={true}is the only view-retention option and keeps the complete inactive view mounted.
Web Component keeps the custom element as the owner and hides that owner while its internal view is detached. Reactivating the panel materializes a new view inside the same Proto instance owner.
Install
Section titled “Install”
npx @proto.ui/cli@latest add wc shadcn-tabs
Replace wc with react, vue or vue2 to generate the facade for that host.
Passing value selects controlled mode.
| Prop | Type | Default |
|---|---|---|
defaultValue | string | '' |
orientation | 'horizontal' 'vertical' | horizontal |
activationMode | 'automatic' 'manual' | automatic |
These props belong to Root. List defaults orientation to horizontal, loop to false, and a11yLabel to ''. Trigger defaults value to '' and disabled to false. Content defaults value to '' and keepMounted to false.