Document toolbarNo formatting action applied yet
GhostToolbar reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrapper around headless GhostToolbar. Same behavioral props; flex row/column layout from default CSS. Hand-written until GHO-13 generates manifests.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
orientation | 'horizontal' | 'vertical' | "horizontal" | No | Toolbar layout forwarded to the unstyled GhostToolbar. |
loop | boolean | true | No | Roving wrap behavior forwarded to the unstyled GhostToolbar. |
dir | 'ltr' | 'rtl' | — | No | Text direction for horizontal arrows, forwarded to the unstyled GhostToolbar. |
label | string | — | No | Accessible name forwarded to the unstyled GhostToolbar. |
as | 'div' | 'section' | 'footer' | 'header' | "div" | No | Root element forwarded to the unstyled GhostToolbar. |
Emits
None declared.
Models
None declared.
Slots
| Name | Description |
|---|---|
default | Toolbar items forwarded to the unstyled GhostToolbar. |
Slot props: default
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLElement | null | Root toolbar element inside the themed scope. |
focus | (options?: FocusOptions) => void | Focuses the toolbar root. |
blur | () => void | Blurs the toolbar root. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The toolbar element inside the display:contents themed scope. |
CSS variables
| Name | Description |
|---|---|
--ghost-space-gap-sm | Gap between toolbar controls. |
Accessibility
Role: toolbar. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/.
Required ARIA attributes: aria-label.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
ArrowLeft | Previous enabled item when orientation is horizontal. | Not reviewed |
ArrowRight | Next enabled item when orientation is horizontal. | Not reviewed |
ArrowUp | Previous enabled item when orientation is vertical. | Not reviewed |
ArrowDown | Next enabled item when orientation is vertical. | Not reviewed |
Home | First enabled item. | Not reviewed |
End | Last enabled item. | Not reviewed |
Verification
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. |
Examples
toolbar/editor-actions
Document formatting toolbar
Themed toolbar with grouped formatting controls, vertical separator, and roving focus.
editor-actions.vue
vue
<script setup lang="ts">
import { ref } from 'vue'
import {
GhostButton,
GhostCard,
GhostSeparator,
GhostToolbar,
} from '@ghostvue/themes'
const lastAction = ref('No formatting action applied yet')
function runAction(name: string): void {
lastAction.value = `Applied: ${name}`
}
</script>
<template>
<div class="toolbar-showcase">
<GhostCard>
<template #header>
<div class="toolbar-showcase__header">
<span class="toolbar-showcase__title">Document toolbar</span>
<span class="toolbar-showcase__status" role="status">
{{ lastAction }}
</span>
</div>
</template>
<GhostToolbar label="Document formatting" class="toolbar-showcase__bar">
<GhostButton
size="sm"
variant="outline"
tone="neutral"
@click="runAction('Bold')"
>
Bold
</GhostButton>
<GhostButton
size="sm"
variant="outline"
tone="neutral"
@click="runAction('Italic')"
>
Italic
</GhostButton>
<GhostButton
size="sm"
variant="outline"
tone="neutral"
@click="runAction('Code')"
>
Code
</GhostButton>
<GhostSeparator orientation="vertical" />
<GhostButton
size="sm"
variant="ghost"
tone="neutral"
@click="runAction('Insert link')"
>
Link
</GhostButton>
<GhostButton
size="sm"
variant="ghost"
tone="danger"
@click="runAction('Clear formatting')"
>
Clear
</GhostButton>
</GhostToolbar>
</GhostCard>
</div>
</template>
<style scoped>
.toolbar-showcase {
display: grid;
}
.toolbar-showcase__header {
display: grid;
gap: var(--ghost-space-gap-2xs);
}
.toolbar-showcase__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);
}
.toolbar-showcase__status {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-xs);
line-height: var(--ghost-type-line-normal);
}
.toolbar-showcase__bar {
flex-wrap: wrap;
}
@container ghost-demo (min-width: 28rem) {
.toolbar-showcase__header {
align-items: baseline;
grid-template-columns: auto minmax(0, 1fr);
justify-content: space-between;
}
.toolbar-showcase__status {
text-align: end;
}
}
</style>
toolbar/themed
Themed
Flex layout from @ghostvue/themes.
No annotation added
themed.vue
vue
<script setup lang="ts">
import { ref } from 'vue'
import { GhostButton, GhostSeparator, GhostToolbar } from '@ghostvue/themes'
const action = ref('No annotation added')
</script>
<template>
<div class="toolbar-themed-example">
<GhostToolbar label="Annotation tools" orientation="vertical">
<GhostButton size="sm" @click="action = 'Added a text annotation'">
Text
</GhostButton>
<GhostButton size="sm" @click="action = 'Added a highlight'">
Highlight
</GhostButton>
<GhostSeparator orientation="horizontal" :decorative="false" />
<GhostButton
size="sm"
variant="outline"
@click="action = 'No annotation added'"
>
Clear
</GhostButton>
</GhostToolbar>
<p role="status">{{ action }}</p>
</div>
</template>
<style scoped>
.toolbar-themed-example {
display: grid;
justify-items: start;
gap: var(--ghost-space-gap-sm);
}
</style>