Colour theme

Notice

  • Primitives

A presentational message: severity, icon and text. Payload only — no live role, no announcement, no dismissal. To announce it, the context renders it into a persistent live region.

Variants

One accent token per severity. The icon carries the meaning alongside the colour; the tint is derived from the accent.

Validation error

Please fill in all required fields before continuing.

Almost out of space

You have used 90% of your storage quota.

Saved

Your changes have been saved.

Heads up

Maintenance is scheduled for Sunday at 02:00 UTC.

Reminder

Your trial ends in three days.

astro
---
import Notice from "tsugite/Notice/Notice.astro";
---
<Notice variant="error" title="Validation error">
  <p>Please fill in all required fields before continuing.</p>
</Notice>

<Notice variant="warning" title="Almost out of space">
  <p>You have used 90% of your storage quota.</p>
</Notice>

<Notice variant="success" title="Saved">
  <p>Your changes have been saved.</p>
</Notice>

<Notice variant="info" title="Heads up">
  <p>Maintenance is scheduled for Sunday at 02:00 UTC.</p>
</Notice>

<Notice variant="neutral" title="Reminder">
  <p>Your trial ends in three days.</p>
</Notice>

Border

data-border adds a full border in the accent colour. Nothing else changes.

Validation error

A full border in the accent colour.

Heads up

The border follows the variant, nothing else changes.

astro
---
import Notice from "tsugite/Notice/Notice.astro";
---
<Notice variant="error" border title="Validation error">
  <p>A full border in the accent colour.</p>
</Notice>

<Notice variant="info" border title="Heads up">
  <p>The border follows the variant, nothing else changes.</p>
</Notice>

Emphasis

data-emphasis is the styled hook: a thick leading bar. The toggles are independent and compose.

Almost out of space

The thick leading bar is the richest look — the "styled" hook.

Saved

Emphasis and border compose; each toggle is independent.

astro
---
import Notice from "tsugite/Notice/Notice.astro";
---
<Notice variant="warning" emphasis title="Almost out of space">
  <p>The thick leading bar is the richest look — the "styled" hook.</p>
</Notice>

<Notice variant="success" emphasis border title="Saved">
  <p>Emphasis and border compose; each toggle is independent.</p>
</Notice>

Without icon

data-icon=&quot;false&quot; drops the icon and lets the content take the whole width.

Text only

Without the icon, severity is carried by the tint alone — use sparingly.

astro
---
import Notice from "tsugite/Notice/Notice.astro";
---
<Notice variant="info" icon={false} title="Text only">
  <p>Without the icon, severity is carried by the tint alone — use sparingly.</p>
</Notice>

Footprint

data-grow-inline and data-cap-inline: may it take more room than its content, and is there a reading ceiling. The default is both.

Saved

Natural width, no ceiling.

Natural width, capped

A long message shrinks to its text but wraps at the reading ceiling instead of running on across the whole page.

Three fields need attention

A validation summary fills the form it belongs to, whatever its width.

astro
---
import Notice from "tsugite/Notice/Notice.astro";
---
{/* Two booleans on the inline axis (ADR-0015). grow: may it take more room than its
    content; cap: is there a reading ceiling. Default is grow + cap. */}
<Notice variant="success" growInline={false} capInline={false} title="Saved">
  <p>Natural width, no ceiling.</p>
</Notice>
<Notice variant="info" growInline={false} title="Natural width, capped">
  <p>A long message shrinks to its text but wraps at the reading ceiling instead of running on across the whole page.</p>
</Notice>
<Notice variant="error" capInline={false} title="Three fields need attention">
  <p>A validation summary fills the form it belongs to, whatever its width.</p>
</Notice>

Actions and dismiss

Two slots the host fills. Buttons go in actions, under the body; a dismiss control goes in dismiss, in the top-end corner, where a third column opens. Notice places them and nothing more: the buttons keep their own size and emphasis, and what the dismiss control does belongs to the host, never to Notice — it owns no lifetime, as it owns no live role.

A new version is available

Version 4.2 fixes the export and adds the calendar view. Reload to get it.

Your session ends in five minutes.

astro
---
import Notice from "tsugite/Notice/Notice.astro";
import LinkButton from "tsugite/Button/LinkButton.astro";
import ActionButton from "tsugite/Button/ActionButton.astro";
---
{/* Two slots the host fills: `actions` under the body, `dismiss` in the top-end corner.
    Notice places them and nothing more — the buttons' size and emphasis are the host's,
    and what the dismiss control does is the host's (or the kernel's), never Notice's. */}
<Notice variant="info" title="A new version is available">
  <p>Version 4.2 fixes the export and adds the calendar view. Reload to get it.</p>
  <LinkButton slot="actions" href="#" size="sm" iconStart="icon-info">Release notes</LinkButton>
  <ActionButton slot="actions" size="sm" emphasis="secondary">Reload</ActionButton>
  <ActionButton slot="dismiss" size="sm" emphasis="secondary" iconEnd="cancel" aria-label="Dismiss" />
</Notice>
<Notice variant="warning" icon={false}>
  <p>Your session ends in five minutes.</p>
  <ActionButton slot="dismiss" size="sm" emphasis="secondary" iconEnd="cancel" aria-label="Dismiss" />
</Notice>

Test bench

The package fixture the conformance suite runs against — every variant and state, mounted unchanged.

Notice

Variants

Validation error

Please fill in all required fields before continuing.

Almost out of space

You have used 90% of your storage quota.

Saved

Your changes have been saved.

Heads up

Maintenance is scheduled for Sunday at 02:00 UTC.

Reminder

Your trial ends in three days.

Border (data-border="true")

Validation error

A full border in the accent colour.

Styled (data-emphasis="true")

Heads up

A thick leading accent bar — the richest look.

Enriched (border + emphasis)

Saved

Border and leading bar together — the most decorated Notice.

No icon

Text only

The icon column collapses when data-icon="false".

No title

A single-line confirmation with no heading.

Single line

Please fill in all required fields before continuing.

Long content

Long message

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.

Live-region pattern (announcer)