pnpm add @ghostvue/themesnpm install @ghostvue/themesyarn add @ghostvue/themesPackage: @ghostvue/themes. Status: experimental (stability policy).
Themed wrappers around headless GhostTabs, GhostTabsList, GhostTabsTrigger, and GhostTabsContent. Importing from @ghostvue/themes loads the default tab strip and panel stylesheet.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
None declared.
None declared.
None declared.
| Name | Description |
|---|---|
default | Container content. |
None declared.
| Name | Type | Description |
|---|---|---|
element | HTMLElement | null | Root element after mount; null before mount. |
| Attribute | Value | Description |
|---|---|---|
data-part | root | Neutral content container. |
| Name | Description |
|---|---|
--ghost-surface-fg | Inherited text color. |
Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/.
Required ARIA attributes: none.
None declared.
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Workspace overview, members, and activity panels with a disabled tab, counts, long labels, and a right-to-left layout switch.
Plan, people, and recent changes for the design systems team.
Team plan, renewed every November.
People who can open this workspace.
The latest changes, newest first.
Only workspace owners can see billing.
<script setup lang="ts">
import { computed, ref } from 'vue'
import {
GhostAvatar,
GhostBadge,
GhostSegmentedControl,
GhostSegmentedControlItem,
GhostTabs,
GhostTabsContent,
GhostTabsList,
GhostTabsTrigger,
} from '@ghostvue/themes'
type Layout = 'short' | 'long' | 'rtl'
type Role = 'owner' | 'admin' | 'editor' | 'viewer'
interface TabLabels {
overview: string
members: string
activity: string
billing: string
}
/*
* Deterministic local copy, all in English. The layout switch stresses the
* strip without translations: "Long" uses wordy tab names so the
* strip wraps, and "RTL" sets `dir="rtl"` on the example, where
* ArrowLeft moves to the next tab. Names, emails, and dates stay fixed so
* screenshots and tests never depend on the clock or the network.
*/
const shortTabs: TabLabels = {
overview: 'Overview',
members: 'Members',
activity: 'Activity',
billing: 'Billing',
}
const layouts: Record<Layout, { dir: 'ltr' | 'rtl'; tabs: TabLabels }> = {
short: { dir: 'ltr', tabs: shortTabs },
long: {
dir: 'ltr',
tabs: {
overview: 'Overview and plan',
members: 'Members and permissions',
activity: 'Activity log',
billing: 'Billing and invoices',
},
},
rtl: { dir: 'rtl', tabs: shortTabs },
}
const stats: readonly { label: string; value: string }[] = [
{ label: 'Members', value: '4 of 10 seats' },
{ label: 'Projects', value: '14 active' },
{ label: 'Storage', value: '18.4 GB of 50 GB' },
]
const roles: Record<Role, string> = {
owner: 'Owner',
admin: 'Admin',
editor: 'Editor',
viewer: 'Viewer',
}
const events: readonly { text: string; date: string }[] = [
{ text: 'Ada Lovelace published Tokens v4.2', date: '2026-11-18' },
{ text: 'Grace Hopper invited Alan Turing', date: '2026-11-17' },
{ text: 'Katherine Johnson archived Legacy icons', date: '2026-11-14' },
]
const members: readonly { name: string; email: string; role: Role }[] = [
{ name: 'Ada Lovelace', email: 'ada@northwind.example', role: 'owner' },
{ name: 'Grace Hopper', email: 'grace@northwind.example', role: 'admin' },
{
name: 'Katherine Johnson',
email: 'katherine.johnson@northwind.example',
role: 'editor',
},
{ name: 'Alan Turing', email: 'alan@northwind.example', role: 'viewer' },
]
const layout = ref<Layout>('short')
const section = ref('overview')
const current = computed(() => layouts[layout.value])
function isLayout(value: string | undefined): value is Layout {
return value === 'short' || value === 'long' || value === 'rtl'
}
function setLayout(value: string | undefined): void {
if (isLayout(value)) layout.value = value
}
</script>
<template>
<!--
`dir` sits on the example root so the strip, the panels, and the tab
list's roving focus all follow the chosen layout.
-->
<section
class="workspace"
:dir="current.dir"
:data-layout="layout"
aria-labelledby="workspace-title"
>
<header class="workspace__header">
<div class="workspace__heading">
<h2 id="workspace-title" class="workspace__title">
Northwind design workspace
</h2>
<!--
<bdi> keeps English sentences intact in the right-to-left layout:
without it, the closing period and leading numbers jump to the
wrong edge. Wrap mixed-direction text the same way in your app.
-->
<p class="workspace__lead">
<bdi
>Plan, people, and recent changes for the design systems team.</bdi
>
</p>
</div>
<GhostSegmentedControl
:model-value="layout"
aria-label="Tab layout"
class="workspace__layout"
@update:model-value="setLayout"
>
<GhostSegmentedControlItem value="short">
Short
</GhostSegmentedControlItem>
<GhostSegmentedControlItem value="long">
Long
</GhostSegmentedControlItem>
<GhostSegmentedControlItem value="rtl"> RTL </GhostSegmentedControlItem>
</GhostSegmentedControl>
</header>
<GhostTabs v-model="section">
<!--
GhostTabs renders no element. This grid is the explicit stack: the
strip always sits above the panel, and the themed panel's own top
margin is the only gap between them.
-->
<div class="workspace__tabs">
<GhostTabsList aria-label="Workspace sections" class="workspace__strip">
<GhostTabsTrigger value="overview" class="workspace__tab">
{{ current.tabs.overview }}
</GhostTabsTrigger>
<GhostTabsTrigger value="members" class="workspace__tab">
{{ current.tabs.members }}
<span class="workspace__count">{{ members.length }}</span>
</GhostTabsTrigger>
<GhostTabsTrigger value="activity" class="workspace__tab">
{{ current.tabs.activity }}
</GhostTabsTrigger>
<!-- Disabled tabs stay visible but are skipped by arrow keys. -->
<GhostTabsTrigger value="billing" class="workspace__tab" disabled>
{{ current.tabs.billing }}
</GhostTabsTrigger>
</GhostTabsList>
<GhostTabsContent value="overview" class="workspace__panel">
<p class="workspace__intro">
<bdi>Team plan, renewed every November.</bdi>
</p>
<dl class="workspace__stats">
<div
v-for="stat in stats"
:key="stat.label"
class="workspace__stat"
>
<dt class="workspace__stat-label">{{ stat.label }}</dt>
<dd class="workspace__stat-value">
<bdi>{{ stat.value }}</bdi>
</dd>
</div>
</dl>
</GhostTabsContent>
<GhostTabsContent value="members" class="workspace__panel">
<p class="workspace__intro">
<bdi>People who can open this workspace.</bdi>
</p>
<ul class="workspace__list">
<li
v-for="member in members"
:key="member.email"
class="workspace__member"
>
<GhostAvatar :name="member.name" size="sm" />
<span class="workspace__person">
<span class="workspace__name">{{ member.name }}</span>
<!-- Emails are left-to-right text even inside a right-to-left layout. -->
<span class="workspace__meta" dir="ltr">{{
member.email
}}</span>
</span>
<GhostBadge
:tone="member.role === 'owner' ? 'accent' : 'neutral'"
:variant="member.role === 'owner' ? 'soft' : 'outline'"
class="workspace__role"
>
{{ roles[member.role] }}
</GhostBadge>
</li>
</ul>
</GhostTabsContent>
<GhostTabsContent value="activity" class="workspace__panel">
<p class="workspace__intro">
<bdi>The latest changes, newest first.</bdi>
</p>
<ol class="workspace__list">
<li
v-for="event in events"
:key="event.date"
class="workspace__event"
>
<span class="workspace__name">{{ event.text }}</span>
<time class="workspace__meta" :datetime="event.date">
{{ event.date }}
</time>
</li>
</ol>
</GhostTabsContent>
<GhostTabsContent value="billing" class="workspace__panel">
<p class="workspace__intro">
<bdi>Only workspace owners can see billing.</bdi>
</p>
</GhostTabsContent>
</div>
</GhostTabs>
</section>
</template>
<style scoped>
/*
* The example owns its measure (40rem) and shrinks with the preview. Native
* text inside picks up docs prose styles, so every element below resets the
* margins, padding, and list styles it relies on.
*/
.workspace {
display: grid;
gap: var(--ghost-space-stack-md);
grid-template-columns: minmax(0, 1fr);
max-inline-size: 40rem;
}
/* Title and layout switch stack on phones and share a row from 34rem. */
.workspace__header {
display: grid;
gap: var(--ghost-space-stack-sm);
grid-template-columns: minmax(0, 1fr);
}
@container ghost-demo (min-width: 34rem) {
.workspace__header {
align-items: start;
grid-template-columns: minmax(0, 1fr) auto;
}
}
.workspace__heading {
display: grid;
gap: var(--ghost-space-gap-xs);
min-inline-size: 0;
}
.workspace__title {
border: 0;
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-lg);
font-weight: var(--ghost-type-weight-semibold);
line-height: var(--ghost-type-line-tight);
margin: 0;
padding: 0;
}
.workspace__lead,
.workspace__intro {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-snug);
margin: 0;
}
/* A smaller label keeps all three layouts on one row at 320px. */
.workspace__layout {
font-size: var(--ghost-type-size-sm);
justify-self: start;
max-inline-size: 100%;
}
/* Explicit stack: strip first, panel below, both at full width. */
.workspace__tabs {
display: grid;
min-inline-size: 0;
}
/*
* Long labels wrap inside their tab instead of widening the
* strip; the themed list already wraps whole tabs onto a new row.
*/
.workspace__tab {
align-items: center;
display: inline-flex;
gap: var(--ghost-space-gap-xs);
max-inline-size: 100%;
overflow-wrap: anywhere;
text-align: start;
}
.workspace__count {
background-color: var(--ghost-surface-muted-bg);
border-radius: var(--ghost-radius-pill);
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-xs);
font-variant-numeric: tabular-nums;
line-height: var(--ghost-type-line-tight);
padding: 0 var(--ghost-space-inset-xs);
}
.workspace__panel {
display: grid;
gap: var(--ghost-space-stack-sm);
}
/* The native `hidden` attribute must still win over the grid display. */
.workspace__panel[hidden] {
display: none;
}
.workspace__stats {
display: grid;
gap: var(--ghost-space-stack-sm) var(--ghost-space-gap-md);
grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
margin: 0;
}
.workspace__stat {
display: grid;
gap: var(--ghost-space-gap-xs);
}
.workspace__stat-label {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-xs);
line-height: var(--ghost-type-line-snug);
}
.workspace__stat-value {
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-md);
font-weight: var(--ghost-type-weight-semibold);
line-height: var(--ghost-type-line-tight);
margin: 0;
}
.workspace__list {
display: grid;
list-style: none;
margin: 0;
padding: 0;
}
/*
* Avatar, person, and role share a row; below about 24rem the role badge
* moves under the name so long emails keep their width.
*/
.workspace__member {
align-items: center;
border-block-start: var(--ghost-border-hairline-width) solid
var(--ghost-border-default);
column-gap: var(--ghost-space-gap-md);
display: grid;
grid-template-areas:
'avatar person'
'avatar role';
grid-template-columns: auto minmax(0, 1fr);
margin: 0;
padding-block: var(--ghost-space-stack-sm);
row-gap: var(--ghost-space-gap-xs);
}
.workspace__member > :first-child {
grid-area: avatar;
}
.workspace__person {
display: grid;
grid-area: person;
justify-items: start;
min-inline-size: 0;
}
.workspace__role {
grid-area: role;
justify-self: start;
}
@container ghost-demo (min-width: 24rem) {
.workspace__member {
grid-template-areas: 'avatar person role';
grid-template-columns: auto minmax(0, 1fr) auto;
}
}
.workspace__event {
border-block-start: var(--ghost-border-hairline-width) solid
var(--ghost-border-default);
display: grid;
gap: var(--ghost-space-gap-xs);
justify-items: start;
margin: 0;
padding-block: var(--ghost-space-stack-sm);
}
.workspace__member:first-child,
.workspace__event:first-child {
border-block-start: 0;
}
.workspace__name {
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-sm);
font-weight: var(--ghost-type-weight-medium);
line-height: var(--ghost-type-line-snug);
overflow-wrap: anywhere;
}
.workspace__meta {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-xs);
line-height: var(--ghost-type-line-snug);
max-inline-size: 100%;
overflow-wrap: anywhere;
}
</style>
Controlled compound tabs with automatic activation.
<script setup lang="ts">
import { ref } from 'vue'
import {
GhostTabs,
GhostTabsContent,
GhostTabsList,
GhostTabsTrigger,
} from '@ghostvue/vue'
const selected = ref('profile')
</script>
<template>
<GhostTabs v-model="selected">
<!-- GhostTabs renders no element; this block keeps the panel under the list. -->
<div class="tabs">
<GhostTabsList aria-label="Account settings">
<GhostTabsTrigger value="profile">Profile</GhostTabsTrigger>
<GhostTabsTrigger value="billing">Billing</GhostTabsTrigger>
<GhostTabsTrigger value="security">Security</GhostTabsTrigger>
</GhostTabsList>
<GhostTabsContent value="profile">
Manage your public profile and contact details.
</GhostTabsContent>
<GhostTabsContent value="billing">
Review invoices and payment methods.
</GhostTabsContent>
<GhostTabsContent value="security">
Rotate passwords and review active sessions.
</GhostTabsContent>
</div>
</GhostTabs>
</template>
<style scoped>
.tabs {
display: grid;
gap: var(--ghost-space-stack-sm);
}
</style>
Plain themed tab panels inside a card, switching the install command per package manager.
pnpm add @ghostvue/themesnpm install @ghostvue/themesyarn add @ghostvue/themes<script setup lang="ts">
import {
GhostCard,
GhostTabs,
GhostTabsContent,
GhostTabsList,
GhostTabsTrigger,
} from '@ghostvue/themes'
const managers = [
{ value: 'pnpm', label: 'pnpm', command: 'pnpm add @ghostvue/themes' },
{ value: 'npm', label: 'npm', command: 'npm install @ghostvue/themes' },
{ value: 'yarn', label: 'Yarn', command: 'yarn add @ghostvue/themes' },
] as const
</script>
<template>
<div class="install-commands">
<GhostCard>
<template #header>
<div class="install-commands__titles">
<span id="install-commands-title" class="install-commands__title">
Install the theme package
</span>
<span class="install-commands__meta">
Pick your package manager and run the command in your app.
</span>
</div>
</template>
<!--
The card already draws the border and padding, so each panel uses
variant="plain" instead of drawing a second frame inside it. The
panels stay tab stops with the same focus ring.
-->
<GhostTabs default-value="pnpm">
<div class="install-commands__tabs">
<GhostTabsList aria-labelledby="install-commands-title">
<GhostTabsTrigger
v-for="manager in managers"
:key="manager.value"
:value="manager.value"
>
{{ manager.label }}
</GhostTabsTrigger>
</GhostTabsList>
<GhostTabsContent
v-for="manager in managers"
:key="manager.value"
:value="manager.value"
variant="plain"
>
<code class="install-commands__command">{{ manager.command }}</code>
</GhostTabsContent>
</div>
</GhostTabs>
</GhostCard>
</div>
</template>
<style scoped>
.install-commands {
display: grid;
max-inline-size: 32rem;
}
.install-commands__titles {
display: grid;
gap: var(--ghost-space-gap-xs);
}
.install-commands__title {
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-md);
font-weight: var(--ghost-type-weight-semibold);
line-height: var(--ghost-type-line-snug);
}
.install-commands__meta {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-normal);
}
.install-commands__tabs {
display: grid;
}
.install-commands__command {
color: var(--ghost-text-default);
font-family: var(--ghost-type-family-mono);
font-size: var(--ghost-type-size-sm);
overflow-wrap: anywhere;
}
</style>
Small tab strip in a header beside a small input and button.
<script setup lang="ts">
import { ref } from 'vue'
import {
GhostButton,
GhostInput,
GhostTabs,
GhostTabsContent,
GhostTabsList,
GhostTabsTrigger,
} from '@ghostvue/themes'
const views = [
{ value: 'all', label: 'All', summary: '42 invoices this quarter.' },
{
value: 'open',
label: 'Open',
summary: '7 invoices are waiting on payment.',
},
{ value: 'paid', label: 'Paid', summary: '35 invoices are paid in full.' },
] as const
const search = ref('')
</script>
<template>
<!--
size="sm" on GhostTabsList sizes every trigger to match the small input
and button in the header. Panels keep their padding at every size.
-->
<GhostTabs default-value="all">
<div class="invoice-header">
<GhostTabsList size="sm" aria-label="Invoice status">
<GhostTabsTrigger
v-for="view in views"
:key="view.value"
:value="view.value"
>
{{ view.label }}
</GhostTabsTrigger>
</GhostTabsList>
<GhostInput
v-model="search"
size="sm"
type="search"
aria-label="Search invoices"
placeholder="Search invoices"
/>
<GhostButton size="sm">New invoice</GhostButton>
</div>
<GhostTabsContent
v-for="view in views"
:key="view.value"
:value="view.value"
>
{{ view.summary }}
</GhostTabsContent>
</GhostTabs>
</template>
<style scoped>
.invoice-header {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: var(--ghost-space-gap-sm);
}
</style>