Skip to content

Components

Notice: messages by importance, in one frame

Notice is a message on a page that needs attention, such as a warning, a refusal or a missing step: a white frame with the tone only in its glyph, a title, a quiet sentence and an action. NoticeList gathers several under one heading, and only info and success can be closed; a warning or a danger stays until it is dealt with.

By Bohuslav PoláčekChecked

A weather notice on Stonebridge's schedule, what Fernhill's roast plan needs, and what Martin has to invoice, rendered from the kit with the demo's text. The deal waiting 18 days is a warning that stays; the one published 3 days ago is info and can be closed.

What it is for, and what the preview shows

Notice is for what a person should not miss on a page: a missing step, a shortage, a risk, a refusal. It is a white frame with a hairline; its tone (info, success, warning, danger) shows only in its glyph, never as a tinted box. It has a title, an optional quiet sentence under it, an action, and a close button where closing makes sense. NoticeList puts several under one heading.

The preview shows three cases from the demo. On the schedule of Stonebridge, a building firm, the weather threatens a task, and the notice offers a proposal to move it. The roast plan of Fernhill, a coffee roastery, lists a missing batch as a warning and a shortage of green coffee as a danger. Martin's money page lists the deals still to invoice: the one published 18 days ago is a warning, the fresh one is info with a close button.

The rules, and where each one lives

  • Messages by importance, in one frame. The root AGENTS.md (Look and feel) and docs/principles.md (Lightness): Notice or NoticeList, a white frame and a hairline, the colour only in the glyph.
  • Only info and success close. onDismiss adds the close button; a warning or a danger goes when it is dealt with (docs/principles.md). Martin's list follows it: a deal waiting 14 days or more turns into a warning and loses the button.
  • Colour next to a word. The glyph's colour sits beside a title that says what is wrong, so colour never carries the message alone (AGENTS.md, Look and feel; docs/principles.md, Colour carries information).
  • Not a decision, not a confirmation. Approving or rejecting is a card at the top of the side column (ApprovalPanel), never a banner; a passing confirmation is a toast (the manifest's not; AGENTS.md).
  • In the content, not above it. Only the header and one row of controls sit above the content; facts and notices go into it (AGENTS.md, Screens). Stonebridge's notice opens the content and scrolls with the chart (decision 0009).
  • What matters later also notifies. A message that matters after leaving the page also goes to the notifications, with the same tone and glyph (docs/principles.md; NotificationItem.tone in docs/patterns.md).

What AI coding tools write instead

The manifest's replaces: a tinted alert box with coloured text, and a coloured banner across the page. That is what an assistant writes from habit: a yellow or red box, the text in a darker shade of the same colour, an icon, and a close button on everything.

Coloured text on a tinted fill often misses the contrast the kit asks for, Lc 75 in APCA for text under 14px, in one theme or the other, and colour without a word does not reach people who do not see it. A page with three banners has no order of importance, and a warning that can be closed disappears before anyone deals with it. Notice keeps the frame white, puts the tone in the glyph beside a title that says what is wrong, and lets only info and success close.

How to use it

Notice takes:

  • tone: "info", "success", "warning" (the default) or "danger".
  • title and children: what is wrong in a few words, and the quiet sentence under it.
  • action: one or two small buttons, the way to deal with it.
  • onDismiss: shows a close button and is called once the notice has folded away; info and success only.
  • role: "alert", "status" or "note", and className.

NoticeList takes heading and headingId (the list is labelled by its heading), headingLevel 2 or 3, items as { id, tone?, title?, body?, action?, onDismiss? }[], and className. Return nothing when the list is empty, as Martin's page does.

Its entry in the manifest

The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

Where it runs in the example apps

The example apps whose code renders Notice, and in which modules, read from the demo's source.Read from the demo's source when the site was built: 8 of 9 example apps render <Notice>, in the modules named here as each app's sidebar names them.

How Martin's money page lists what to invoice

apps/demo/src/modules/money/pages/invoices.tsx
<NoticeList
  heading={tx("K vyfakturování", "To invoice")}
  headingId="money-to-invoice"
  items={shown.map((deal) => {
    const forgotten = deal.daysSincePublished >= FORGOTTEN_AFTER_DAYS;
    return {
      id: deal.id,
      tone: forgotten ? "warning" : "info",
      title: (
        <>
          {deal.customerName}
          <span className="font-normal text-fg-muted">, {deal.title}</span>
        </>
      ),
      body: (
        <>
          {deal.number} · <span className="tabular">{formatMoney(deal.amount)}</span> ·{" "}
          {tx(
            `zveřejněno před ${daysLabel(deal.daysSincePublished)}`,
            `published ${daysLabel(deal.daysSincePublished)} ago`,
          )}
        </>
      ),
      action: (
        <Can do="money.invoice.create">
          <Button
            size="sm"
            onClick={() => onIssue(deal.id)}
            aria-label={tx(
              `Vystavit fakturu pro ${deal.customerName}`,
              `Issue an invoice for ${deal.customerName}`,
            )}
          >
            {tx("Vystavit", "Issue")}
          </Button>
        </Can>
      ),
      onDismiss: forgotten ? undefined : () => setClosed((current) => [...current, deal.id]),
    };
  })}
/>
The tone comes from how long a deal has waited: 14 days or more is a warning without a close button, a fresh deal is info that can be closed. The Issue button shows only to someone who may invoice.

Questions

When can a notice be closed?

When it is info or success. A warning or a danger stays until the problem is dealt with, so pass onDismiss only to the tones that may close.

Why is the frame white and not tinted?

Coloured text on a tinted box struggles with contrast in light or dark, and a page of tinted boxes has no order. A white frame keeps the text readable, and the glyph's colour beside the title says how serious it is.

Is a notice the right place to approve or reject?

No. A decision is a card at the top of a record's side column. A notice points at what needs attention and carries the action that deals with it.

Where does a notice go on a screen?

Into the content, where it scrolls with the rest. Only the header and one row of controls sit above the content.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app