Workspace billing status
Contextual notices sit inline with the billing controls they affect.
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrapper around headless GhostInlineAlert. Adds variant and tone visual props plus data-themed scoping.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
variant | 'solid' | 'soft' | 'outline' | 'ghost' | "soft" | No | Visual treatment. The default omits data-variant. |
tone | 'accent' | 'neutral' | 'danger' | 'success' | 'warning' | "neutral" | No | Semantic color intent, independent of variant and not a status enum. success and warning use the status tokens, as on GhostBadge; there is no info tone. The default omits data-tone. |
None declared.
None declared.
| Name | Description |
|---|---|
actions | Optional action controls. |
message | Primary supporting copy. |
title | Optional heading text. |
None declared.
None declared.
None declared.
| Name | Type | Description |
|---|---|---|
element | HTMLElement | null | Delegates to the unstyled GhostInlineAlert root. |
None declared.
None declared.
Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/.
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. |
Solid, soft, and outline GhostInlineAlert notices with contextual actions.
Contextual notices sit inline with the billing controls they affect.
<script setup lang="ts">
import { nextTick, ref, useTemplateRef } from 'vue'
import {
GhostButton,
GhostCard,
GhostInlineAlert,
type GhostButtonExposed,
} from '@ghostvue/themes'
const showQuotaNotice = ref(true)
const status = ref('')
function retryCharge(): void {
status.value = 'Payment retry queued.'
}
const dismissButton = useTemplateRef<GhostButtonExposed>('dismissButton')
const restoreButton = useTemplateRef<GhostButtonExposed>('restoreButton')
// Dismiss and Restore each unmount the button that was pressed. Move focus to
// the control that replaces it so keyboard users are not dropped on the page.
async function dismissQuota(): Promise<void> {
showQuotaNotice.value = false
status.value = 'Usage notice dismissed.'
await nextTick()
restoreButton.value?.focus()
}
async function restoreNotices(): Promise<void> {
showQuotaNotice.value = true
status.value = 'Notices restored.'
await nextTick()
dismissButton.value?.focus()
}
</script>
<template>
<section class="notices" aria-labelledby="notices-title">
<GhostCard>
<template #header>
<div class="notices__header">
<h2 id="notices-title" class="notices__title">
Workspace billing status
</h2>
<p class="notices__lead">
Contextual notices sit inline with the billing controls they affect.
</p>
</div>
</template>
<div class="notices__stack">
<!--
These notices are present on first paint, so they keep the default
announce="off" and are read in document order. The footer status
line announces what the actions did.
-->
<GhostInlineAlert variant="solid" tone="danger">
<template #title>Payment method declined</template>
<template #message>
The card ending in 4242 failed authorization. Update billing details
before Friday to avoid pausing background workers.
</template>
<template #actions>
<GhostButton size="sm" variant="outline" @click="retryCharge">
Retry charge
</GhostButton>
</template>
</GhostInlineAlert>
<GhostInlineAlert variant="soft" tone="accent">
<template #title>Annual invoice scheduled</template>
<template #message>
Your Pro renewal ($348.00) is scheduled for December 1, 2026.
</template>
</GhostInlineAlert>
<GhostInlineAlert
v-if="showQuotaNotice"
variant="outline"
tone="neutral"
>
<template #title>Storage at 82% of included quota</template>
<template #message>
Artifact retention is set to 30 days. Adjust retention in workspace
settings if you need more headroom.
</template>
<template #actions>
<GhostButton
ref="dismissButton"
size="sm"
variant="ghost"
tone="neutral"
@click="dismissQuota"
>
Dismiss
</GhostButton>
</template>
</GhostInlineAlert>
</div>
<template #footer>
<div class="notices__footer">
<p class="notices__status" role="status">{{ status }}</p>
<GhostButton
v-if="!showQuotaNotice"
ref="restoreButton"
size="sm"
variant="ghost"
tone="neutral"
@click="restoreNotices"
>
Restore dismissed
</GhostButton>
</div>
</template>
</GhostCard>
</section>
</template>
<style scoped>
.notices {
max-inline-size: 38rem;
}
.notices__header {
display: grid;
gap: var(--ghost-space-gap-xs);
padding-block-end: var(--ghost-space-stack-sm);
}
.notices__title {
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;
}
.notices__lead,
.notices__status {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-snug);
margin: 0;
overflow-wrap: anywhere;
}
.notices__stack {
display: grid;
gap: var(--ghost-space-stack-md);
}
.notices__footer {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: var(--ghost-space-gap-sm);
justify-content: space-between;
min-block-size: var(--ghost-control-size-sm-min);
}
</style>
One mounted announce="status" alert whose text changes in place from checking to partially unavailable to up to date while saved readings stay visible.
<script setup lang="ts">
import { computed, reactive, ref } from 'vue'
import {
GhostBadge,
GhostButton,
GhostCard,
GhostInlineAlert,
type GhostInlineAlertTone,
} from '@ghostvue/themes'
type FeedId = 'buoy' | 'wind' | 'tide'
interface Feed {
name: string
reading: string
/** Minutes since the reading was measured. */
age: number
available: boolean
}
type Phase = 'checking' | 'partial' | 'retrying' | 'current'
interface PhaseCopy {
tone: GhostInlineAlertTone
title: string
message: string
action: string
}
const feeds = reactive<Record<FeedId, Feed>>({
buoy: {
name: 'Harbor buoy',
reading: '1.2 m swell',
age: 18,
available: true,
},
wind: { name: 'Pier wind', reading: '14 kn SW', age: 9, available: true },
tide: {
name: 'Tide gauge',
reading: '2.1 m rising',
age: 9,
available: true,
},
})
const phase = ref<Phase>('checking')
const copy: Record<Phase, PhaseCopy> = {
checking: {
tone: 'neutral',
title: 'Checking 3 feeds…',
message: 'Saved readings stay on screen until each feed responds.',
action: 'Receive responses',
},
partial: {
tone: 'danger',
title: 'Harbor buoy is unavailable',
message:
'Showing its saved reading. Pier wind and tide gauge are up to date.',
action: 'Retry harbor buoy',
},
retrying: {
tone: 'neutral',
title: 'Retrying harbor buoy…',
message: 'Its saved reading stays on screen until the feed responds.',
action: 'Receive response',
},
current: {
tone: 'accent',
title: 'All 3 feeds are up to date',
message: 'Readings refresh every 10 minutes.',
action: 'Refresh feeds',
},
}
const current = computed(() => copy[phase.value])
function ageText(feed: Feed): string {
const prefix = feed.available ? 'Updated' : 'Saved'
return feed.age === 0
? `${prefix} just now`
: `${prefix} ${String(feed.age)} min ago`
}
// Stand-ins for feed responses, so each phase can be inspected. Readings and
// their ages change outside the alert, so they are not announced.
function nextStep(): void {
switch (phase.value) {
case 'checking':
feeds.wind = { ...feeds.wind, reading: '16 kn SW', age: 0 }
feeds.tide = { ...feeds.tide, reading: '2.3 m rising', age: 0 }
feeds.buoy.available = false
phase.value = 'partial'
break
case 'partial':
phase.value = 'retrying'
break
case 'retrying':
feeds.buoy = { ...feeds.buoy, reading: '1.4 m swell', age: 0 }
feeds.buoy.available = true
phase.value = 'current'
break
case 'current':
for (const feed of Object.values(feeds)) feed.age += 10
phase.value = 'checking'
break
}
}
</script>
<template>
<section class="feed-status" aria-labelledby="feed-status-title">
<GhostCard>
<template #header>
<h2 id="feed-status-title" class="feed-status__title">
Coastal conditions
</h2>
</template>
<div class="feed-status__body">
<!--
One alert stays mounted for the whole refresh, so its role="status"
region exists before the text changes and each change is announced
politely. Remounting it per phase could drop announcements.
-->
<GhostInlineAlert
announce="status"
variant="soft"
:tone="current.tone"
:heading-level="3"
>
<template #title>{{ current.title }}</template>
<template #message>{{ current.message }}</template>
</GhostInlineAlert>
<ul class="feed-status__list">
<li v-for="feed in feeds" :key="feed.name" class="feed-status__item">
<span class="feed-status__name">{{ feed.name }}</span>
<span class="feed-status__reading">{{ feed.reading }}</span>
<span class="feed-status__age">
{{ ageText(feed) }}
<GhostBadge
v-if="!feed.available"
size="sm"
tone="danger"
variant="soft"
>
Offline
</GhostBadge>
</span>
</li>
</ul>
</div>
<template #footer>
<GhostButton
size="sm"
variant="outline"
tone="neutral"
@click="nextStep"
>
{{ current.action }}
</GhostButton>
</template>
</GhostCard>
</section>
</template>
<style scoped>
.feed-status {
max-inline-size: 36rem;
}
.feed-status__title {
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;
}
.feed-status__body {
display: grid;
gap: var(--ghost-space-stack-md);
}
.feed-status__list {
display: grid;
gap: var(--ghost-space-gap-sm);
list-style: none;
margin: 0;
padding: 0;
}
.feed-status__item {
align-items: baseline;
column-gap: var(--ghost-space-gap-sm);
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
row-gap: var(--ghost-space-gap-2xs);
}
.feed-status__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);
}
.feed-status__reading {
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-sm);
font-variant-numeric: tabular-nums;
line-height: var(--ghost-type-line-snug);
text-align: end;
}
.feed-status__age {
align-items: center;
color: var(--ghost-text-muted);
display: flex;
flex-wrap: wrap;
font-size: var(--ghost-type-size-xs);
gap: var(--ghost-space-gap-xs);
grid-column: 1 / -1;
line-height: var(--ghost-type-line-normal);
}
</style>
Soft danger styling from @ghostvue/themes.
<script setup lang="ts">
import { GhostInlineAlert } from '@ghostvue/themes'
</script>
<template>
<GhostInlineAlert :heading-level="2" tone="danger" variant="soft">
<template #title>Could not refresh rows</template>
<template #message>
The server returned an error. Your last successful data is still shown
below.
</template>
</GhostInlineAlert>
</template>
Neutral, success, warning, and danger soft alerts side by side, with transparent actions on the status tones.
<script setup lang="ts">
import { ref } from 'vue'
import { GhostButton, GhostInlineAlert } from '@ghostvue/themes'
const status = ref('')
</script>
<template>
<section class="service-health" aria-labelledby="service-health-title">
<h2 id="service-health-title" class="service-health__title">
Service health
</h2>
<!--
The title says the status in words, so the tone only adds color. Pick
success for healthy or completed, warning for degraded or needs attention
soon, and danger for failures. Accent follows the brand color and does
not mean success.
-->
<div class="service-health__stack">
<GhostInlineAlert tone="neutral">
<template #title>Maintenance window on Sunday</template>
<template #message>
Search indexing pauses from 02:00 to 03:00 UTC. Queries still return
cached results.
</template>
</GhostInlineAlert>
<GhostInlineAlert tone="success">
<template #title>API gateway is healthy</template>
<template #message>
All 6 regions responded within 120 ms over the last hour.
</template>
<template #actions>
<GhostButton
size="sm"
variant="ghost"
@click="status = 'Opened the uptime report.'"
>
View uptime report
</GhostButton>
</template>
</GhostInlineAlert>
<GhostInlineAlert tone="warning">
<template #title>Database replicas are degraded</template>
<template #message>
Replica lag in eu-west is 45 seconds. Reads may return stale rows
until it catches up.
</template>
<template #actions>
<GhostButton
size="sm"
variant="outline"
@click="status = 'Opened the replica dashboard.'"
>
Review replicas
</GhostButton>
</template>
</GhostInlineAlert>
<GhostInlineAlert tone="danger">
<template #title>Webhook delivery failed</template>
<template #message>
38 events could not be delivered. They will retry automatically for 24
hours.
</template>
</GhostInlineAlert>
</div>
<p class="service-health__status" role="status">{{ status }}</p>
</section>
</template>
<style scoped>
.service-health {
display: grid;
gap: var(--ghost-space-stack-md);
max-inline-size: 38rem;
}
.service-health__title {
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;
}
.service-health__stack {
display: grid;
gap: var(--ghost-space-stack-sm);
}
.service-health__status {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-snug);
margin: 0;
min-block-size: 1lh;
}
</style>
announce=alert after a simulated failure.
<script setup lang="ts">
import { ref } from 'vue'
import { GhostButton, GhostInlineAlert } from '@ghostvue/vue'
const showFailure = ref(false)
function simulateFailure() {
showFailure.value = true
}
</script>
<template>
<GhostButton type="button" @click="simulateFailure">
Simulate save failure
</GhostButton>
<GhostInlineAlert v-if="showFailure" :heading-level="2" announce="alert">
<template #title>Save failed</template>
<template #message>Your changes were not persisted.</template>
<template #actions>
<GhostButton type="button">Retry save</GhostButton>
</template>
</GhostInlineAlert>
</template>
Recoverable table error with a retry action.
<script setup lang="ts">
import { GhostButton, GhostInlineAlert } from '@ghostvue/themes'
</script>
<template>
<GhostInlineAlert
:heading-level="2"
as="section"
tone="danger"
variant="outline"
data-testid="table-load-error"
>
<template #title>Unable to load table</template>
<template #message>
A network error prevented rows from loading. Cached data may be stale.
</template>
<template #actions>
<GhostButton type="button">Retry load</GhostButton>
</template>
</GhostInlineAlert>
</template>