Tabs / Persona Switcher: Format, Rules and Examples
Use tabs and persona switchers to route readers through relevant content while keeping every panel in the DOM, accessible, indexable, and extractable.
A tabs/persona switcher gives several readers distinct paths through one bounded subject without sending them to separate pages. The labels identify the path; selecting one reveals its panel in the same location. The element is useful only when the panels are genuine peers and every panel remains present in the page’s initial HTML.
Choose your team
Turn the brief into a repeatable draft
Start with the required answer, evidence, and element set. Draft the reasoning in full before applying components, then check that every claim still makes sense when extracted from its visual treatment.
Verify discovery and extraction
Inspect the rendered HTML, internal links, headings, and structured fields. Confirm that inactive panel content arrives in the first response rather than appearing only after client-side interaction.
Review the system, not just the page
Approve the common promise once, then review where each audience genuinely needs different proof, workflow, or next action. Remove differences that are only changes in tone.
The rendered state shows one active panel, but the other two panels are also in the document object model (DOM)—the browser’s structured representation of the page. They are hidden with the native hidden attribute, not requested after a click. A production renderer adds the keyboard and pointer behavior described below; the authored content contract remains the same across platforms.
Why this element matters
Readers filter a page through their role, goal, and level of responsibility. A content specialist may want drafting instructions, an SEO specialist may want validation rules, and a team lead may want governance. A well-labelled persona switcher reduces the effort of translating generic advice into “what does this mean for me?” It also keeps the shared premise in one place, which avoids three near-duplicate pages competing for the same intent.
The psychological advantage is recognition over interpretation. A reader can recognize a label such as “SEO teams” faster than they can scan three paragraphs to infer which one applies. Tabs also preserve spatial context: the panel changes in place, so the reader can compare peer paths without repeatedly scrolling past the shared introduction.
That convenience creates a machine-extractability trade-off. Machine extractability is the ability of a crawler, search index, assistive technology, or retrieval system to isolate content while preserving its subject and relationships. Visible headings and paragraphs appear in an obvious reading sequence. Tab panels introduce an interaction state: one is visible, several are not, and software must connect each tab label to the correct panel. A weak implementation leaves only the active panel in the HTML, loads other panels after a click, or repeats generic headings such as “Benefits” without the persona name. In each case, a machine receives less context than the reader sees.
Even a correct implementation can reduce extractability compared with ordinary sections. Some systems prioritize initially visible text, flatten interactive relationships, or omit hidden content from excerpts. Tabs are therefore an information-routing tool, not a way to conceal essential answers. Put the shared answer, definition, warning, eligibility condition, and conclusion outside the tab set. Use panels for audience-specific application, examples, workflows, or proof that remains useful after the common answer is known.
Apply the element writing rules : draft the complete explanation first, then classify a genuine set of peer reader paths as this typed element. The rules on this page take precedence for panel mapping, interaction, and content limits.
When to use it
Use a tabs/persona switcher when all of these conditions are true:
- Two to five recognizable audiences, contexts, or modes need different applications of the same subject.
- Every panel answers the same question at comparable depth.
- Most readers need one panel at a time, while a minority may compare two or more.
- The common answer can be stated outside the element without forcing a reader to open every tab.
- Keeping the paths on one page is clearer than maintaining separate pages with largely duplicated introductions.
Strong uses include implementation guidance for “Developers / Editors / Reviewers,” onboarding paths for “Solo / Team / Agency,” and one capability explained through “Plan / Produce / Measure.” Persona labels should reflect meaningful differences in workflow, evidence, permissions, or desired outcome—not demographic guesses.
Near-miss cases often come from trying to shorten a page. Do not put sequential steps into tabs; hiding step two until a reader selects it destroys the procedure’s order. Do not tab a short list of definitions, because ordinary headings expose the same information with less interaction. Do not use tabs for a detailed feature comparison: a comparison table keeps criteria simultaneously visible. Do not use tabs as navigation between unrelated subjects, and do not split information merely because the page feels long.
An accordion is a better fit when the sections are independent questions in a vertical reading flow or when several answers should remain open. Separate pages are better when each audience needs a distinct search intent, title, evidence set, conversion path, or more than roughly 300 words of unique content. If a reader needs all panels to act safely or correctly, tabs are the wrong component.
Where to place it
Place the switcher after the shared answer and the paragraph that explains why paths differ. The reader should understand the common subject before choosing a label. On a product or solution page, that usually means after the core value proposition and shared capability explanation, but before detailed proof and the primary closing action. In documentation, place it immediately before the role-specific instructions it controls.
Do not place a tab set before the page’s direct answer, definition, or mandatory warning. Do not put it between a claim and its source, between a prerequisite and the procedure it governs, or between a price and its qualifications. Those relationships must survive even when no panel is selected. A tab set may not sit beside another tab set, an accordion, a large comparison grid, or carousel; adjacent interaction models create competing controls and unclear reading order.
Avoid nested tabs. The outer choice hides the inner choice, creates difficult keyboard behavior, and makes deep linking ambiguous. Also avoid placing a persona switcher immediately above another audience selector in a form or CTA. If both controls use similar labels, readers may not know whether they are changing visible content or submitting a preference.
Anatomy
The anatomy has one labelled container, one ordered tab list, and one panel for every tab. The screenshot must show inactive panels in the DOM inspector as well as the visible state because presence in source is part of the element, not an implementation detail.
- Shared title: States the common question or task that every panel addresses.
- Tab list: Groups two to five peer labels in a stable authored order.
- Tab label: Names an audience, context, or mode in language readers recognize.
- Selected state: Communicates the active tab through text semantics and a visible treatment, not color alone.
- Panel: Contains a self-contained heading and the content for one label.
- Programmatic relationship:
aria-controlson the tab andaria-labelledbyon the panel connect each pair. - Fallback order: Keeps the shared title, labels, and all panel content meaningful when scripts or styling do not run.
Spacing, border, indicator shape, animation, and breakpoint belong to the renderer. Authors control labels, source order, panel content, and an optional stable fragment identifier.
Design examples
The component supports four variants. Every variant uses the same content model and DOM requirement.
Persona tabs: Use role labels when workflows, evidence, or next actions genuinely differ by reader. Prefer established customer language such as “In-house teams” over invented personas such as “Growth gurus.”
Context tabs: Use non-persona states such as team size, operating model, or implementation mode. The shared title must name the changing dimension so the labels are not mistaken for page navigation.
Vertical tabs: Use only when labels need more horizontal room and there are no more than five. DOM and keyboard order remain tab one through tab five, followed by their associated panels according to the chosen accessible implementation.
Narrow-viewport and fallback state: Labels may scroll horizontally when a visible cue makes overflow obvious, or the renderer may expose panels as stacked labelled sections. It must not truncate labels into ambiguous fragments or remove inactive content from the HTML.
Parameters
The content contract keeps the relationship explicit while leaving visual and responsive behavior to the renderer.
| Name | Type | Required | Min/max | Default | Source |
|---|---|---|---|---|---|
title | Plain string | Yes | 3–10 words; 80 characters maximum | None | First heading in the parent body |
items | Ordered collection | Yes | 2–5 items; 3–4 preferred | None | Nested item bodies |
item.label | Plain string | Yes | 1–4 words; 28 characters maximum | None | label item attribute |
item.title | Plain string | Yes | 3–10 words; 80 characters maximum | None | First heading in each item body |
item.content | Limited Markdown | Yes | 40–180 words recommended; 300 maximum | None | Item body after its first heading |
item.id | Slug token | No | 3–40 lowercase characters, numbers, and hyphens | Generated from item.label | id item attribute |
variant | Enum | No | horizontal or vertical | horizontal | Parent attribute |
default | Item ID | No | Must match one item ID | First item | Parent attribute |
Labels are attributes because they operate the control; panel titles come from the first heading because they belong to the content. The two may be similar, but a concise tab label can map to a fuller, extractable panel heading. Panel bodies allow paragraphs, a short list, inline code, one image, and one contextual action. They do not allow another tab set, accordion, data table, form, video player, or multi-step procedure.
Syntax and code examples
All three notations preserve one title, ordered labels, panel headings, panel bodies, stable IDs, and the initial default. The portable Markdown directive is the canonical authored form.
Portable Markdown directive
:::tabs-persona-switcher{default=content-teams variant=horizontal}
## Choose your team
::item{label="Content teams" id=content-teams}
### Turn the brief into a repeatable draft
Start with the required answer, evidence, and element set. Draft the reasoning in full before applying components.
::
::item{label="SEO teams" id=seo-teams}
### Verify discovery and extraction
Inspect the rendered HTML, internal links, headings, and structured fields. Confirm that every panel arrives in the initial response.
::
::item{label="Team leaders" id=team-leaders}
### Review the system, not just the page
Approve the shared promise once, then review where each audience genuinely needs a different workflow, proof point, or next action.
::
:::
The parent body’s first heading maps to title. Each nested item takes label and id from attributes, maps its first heading to item.title, and maps the remainder to item.content.
Hugo shortcode
{{< tabs-persona-switcher title="Choose your team" default="content-teams" variant="horizontal" >}}
{{< tab-item label="Content teams" id="content-teams" title="Turn the brief into a repeatable draft" >}}
Start with the required answer, evidence, and element set. Draft the reasoning in full before applying components.
{{< /tab-item >}}
{{< tab-item label="SEO teams" id="seo-teams" title="Verify discovery and extraction" >}}
Inspect the rendered HTML, internal links, headings, and structured fields. Confirm that every panel arrives in the initial response.
{{< /tab-item >}}
{{< tab-item label="Team leaders" id="team-leaders" title="Review the system, not just the page" >}}
Approve the shared promise once, then review where each audience genuinely needs a different workflow, proof point, or next action.
{{< /tab-item >}}
{{< /tabs-persona-switcher >}}
The adapter uses named parameters only. It must render all item bodies during the server response, reject duplicate IDs, and initialize interaction without rewriting the content model.
WordPress block
<!-- wp:amicited/tabs-persona-switcher {"title":"Choose your team","default":"content-teams","variant":"horizontal"} -->
<!-- wp:amicited/tab-item {"label":"Content teams","id":"content-teams","title":"Turn the brief into a repeatable draft"} -->
<p>Start with the required answer, evidence, and element set. Draft the reasoning in full before applying components.</p>
<!-- /wp:amicited/tab-item -->
<!-- wp:amicited/tab-item {"label":"SEO teams","id":"seo-teams","title":"Verify discovery and extraction"} -->
<p>Inspect the rendered HTML, internal links, headings, and structured fields. Confirm that every panel arrives in the initial response.</p>
<!-- /wp:amicited/tab-item -->
<!-- wp:amicited/tab-item {"label":"Team leaders","id":"team-leaders","title":"Review the system, not just the page"} -->
<p>Approve the shared promise once, then review where each audience genuinely needs a different workflow, proof point, or next action.</p>
<!-- /wp:amicited/tab-item -->
<!-- /wp:amicited/tabs-persona-switcher -->
WordPress should limit inner blocks to registered tab items. Preview, saved markup, and front-end rendering must retain every panel; editor convenience must not turn inactive items into client-fetched content.
Examples
Good example
Choose an implementation path
Hosted platform — Launch without maintaining infrastructure
Connect the approved data source, configure roles, and validate output in a staging workspace. The vendor maintains runtime updates and monitoring; your team owns content approval and access review.
Self-hosted — Control deployment and data boundaries
Deploy the supported package in your environment, connect the same approved data source, and assign an owner for upgrades, monitoring, backups, and access review.
This works because both panels answer the same implementation question, name the operational difference, and contain comparable responsibilities. “Hosted platform” and “Self-hosted” are recognizable labels. The shared decision remains clear if both panels are flattened into source order.
Bad example
Explore everything
Overview: Our platform makes modern teams more effective.
Pricing: Contact sales for a personalized quote and important contract conditions.
Security: Read our security documentation.
Careers: Join our growing team.
This is site navigation disguised as tabs. The panels do not answer one shared question, the labels mix buyer information with corporate content, and important pricing conditions are concealed behind an interaction. Replace the set with ordinary page sections and real navigation. If pricing options need simultaneous evaluation, use a pricing or comparison structure rather than tabs.
Schema markup and accessibility
Tabs and persona switchers do not create a dedicated Schema.org type. Their content remains part of the enclosing Article, TechArticle, Product, or WebPage when that page independently qualifies. Do not mark tabs as ItemList merely because they are repeated, and do not generate multiple Person entities from persona labels. A label such as “Agency” describes a reader path, not a factual entity assertion.
Use the WAI-ARIA tabs pattern only when the interface actually behaves as tabs. The container has role="tablist"; each control has role="tab", a unique ID, aria-controls, and an accurate aria-selected value; each panel has role="tabpanel" and aria-labelledby. Use buttons for controls, not links with fake destinations. The selected tab belongs in the page’s tab order; inactive tabs use roving tabindex="-1" and remain reachable with arrow keys. Home and End move to the first and last tab. Activation may follow focus only when panel switching is immediate; otherwise Enter or Space activates the focused tab.
Focus must remain predictable. Selecting a tab does not push focus into its panel automatically. A panel can use tabindex="0" when its first content is not otherwise focusable, allowing keyboard users to move into it. A visible focus indicator and selected indicator must differ, and neither may rely on color alone.
All panels must be rendered in the initial HTML response. Hiding inactive panels with hidden, CSS, or a progressively enhanced equivalent is acceptable; creating them only after a click is not. Without JavaScript, the fallback must expose every labelled panel in source order or provide real links to server-rendered destinations. Stable fragments may activate a panel, but the canonical page remains one URL. Test zoom, narrow screens, long translated labels, screen-reader relationships, keyboard order, and script failure.
Writing rules
Begin with the shared question. If each proposed panel answers a different question, do not use tabs. Write two to five items, with three or four preferred. Keep labels to one to four words and 28 characters where possible. Use parallel grammar: all roles (“Editors / Reviewers”), all modes (“Hosted / Self-hosted”), or all stages (“Plan / Produce / Measure”). Do not mix a role, a verb, and a marketing phrase.
Give each panel a 3–10 word heading that names both the relevant path and its outcome when the tab label alone is insufficient. Write 40–180 words per panel, with 300 as an absolute maximum. Panels should have comparable depth, but they do not need identical word counts. Use direct language and concrete differences in tasks, evidence, permissions, constraints, or actions. Changing only the pronouns from “you” to “your team” does not justify another panel.
Keep common information outside the element. Repeating the same opening sentence in every panel creates maintenance drift and makes extracted passages look duplicated. Put differences inside panels, and make each difference explicit enough to survive extraction. Prefer “Agency teams can assign client-level roles” to “You get more control,” which loses its subject when separated from the selected label.
Never put these inside a tab set:
- The page’s only definition, direct answer, conclusion, safety warning, legal qualification, eligibility rule, or source attribution.
- Sequential steps that every reader must complete, or prerequisites that govern content outside one panel.
- Another tab set, accordion, carousel, complex data table, multi-field form, or autoplaying media.
- More than one primary call to action per panel, or actions that lead to unrelated funnel stages.
- Content loaded only after interaction, even when the loading state is fast for a human user.
- Labels such as “Other,” “More,” “General,” or “Resources” that hide an undefined relationship.
If each panel exceeds 300 words, needs its own evidence set, or targets a different search intent, publish dedicated sections or pages. If readers need to compare several criteria at once, use a table. If the content is merely optional detail, use prose or an accordion according to the relationship.
Post types that use it
The postTypes frontmatter field is the source for this table. Inclusion means the format can support tabs; it does not make them mandatory.
| Post type | Typical use | Recommended position | Common misuse |
|---|---|---|---|
| Ultimate guide | Role-specific application of one shared framework | After the framework is explained in visible prose | Hiding required chapters to make a long guide appear shorter |
| Documentation article | Instructions that differ by role, environment, or supported mode | After shared prerequisites and before path-specific actions | Putting consecutive steps in separate panels |
| Product page | Outcomes or workflows for distinct qualified audiences | After the shared product promise and capability | Concealing price, terms, or limitations in an inactive panel |
| Feature page | One capability applied by different teams or operating modes | After the common feature explanation | Repeating identical benefits with persona names swapped |
| Solution page | Different stakeholder responsibilities within one solution | After the problem and shared approach | Mixing unrelated industries, jobs, and resources in one control |
| Use-case page | Execution paths for audience segments that share the use case | After the common outcome and before detailed proof | Using tabs when each audience actually needs a dedicated intent page |
QA checklist
- One shared question: Every panel answers the same bounded question for a different audience, context, or mode.
- Appropriate count: The set contains two to five tabs, preferably three or four, with concise parallel labels.
- Visible common answer: The definition, core answer, mandatory qualification, and conclusion remain outside the tab set.
- Initial DOM presence: Every panel and its complete authored content appears in the initial server-rendered HTML.
- Explicit context: Each panel heading and opening sentence remain understandable when extracted without the visual tab state.
- Correct relationships: Tab and panel IDs are unique;
aria-controlsandaria-labelledbypair them correctly. - Keyboard behavior: Arrow, Home, End, Enter, Space, Tab, and Shift+Tab behavior matches the chosen activation model.
- Focus clarity: Focus and selection are visibly distinct, and selection does not move focus unexpectedly.
- Stable fallback: Script failure exposes labelled content or usable server-rendered destinations without losing information.
- Responsive behavior: Labels remain complete and discoverable at narrow widths, 200% zoom, and with longer translated text.
- Safe placement: The component does not separate a claim from evidence, a warning from its scope, or prerequisites from instructions.
- No complex nesting: Panels contain bounded prose and simple supporting content, not another interaction system.
- Schema restraint: The renderer does not invent list, person, or audience schema from presentation labels.
- Notation parity: Markdown, Hugo, and WordPress preserve the same order, IDs, default, labels, headings, and panel bodies.
A reviewer should reject the component when inactive content requires a click-triggered network request, when essential information exists only inside one panel, or when the labels do not describe peer paths. Those are content and architecture failures; visual refinement cannot repair them.
FAQ
The structured FAQ entries in frontmatter address indexing, fragment URLs, tab count, calls to action, and the distinction between tabs and accordions. They are intentionally outside the interactive element so every reader and renderer receives the same implementation guidance.
More tutorials in this section
Ready to put it into practice?
Free check · 7-day trial · no credit card