Notice

Free

A tinted panel in the content about the thing beside it: a bare icon in the tone or the agent as the subject, the title and its line, one action, and a close only when it can go, lit with a still glim at the mark.

npx shadcn@latest add https://pixilui.com/r/notice.json

Preview

The space opens first, then the content arrives in pieces; an action turns it in place.
Notice

When to use

Use it when

  • Something about one setting or one part of the page: an approval rule next to the refund settings, a model that retires, a list that couldn't load.
  • The agent as the subject (agent): the locked agent avatar in its state, such as an agent that sends emails on its own.
  • A result that turns in place: Retry, then working (a shimmering title, aria-busy), then done, in the same panel.

Use something else when

  • Something that affects the whole app or panel: use a banner across its top.
  • News that passes (saved, sent): use a toast.
  • A choice that blocks the next step: use a dialog.

Installation

Terminal
npx shadcn@latest add https://pixilui.com/r/notice.json

Adds notice.tsx with button.tsx and agent-avatar.tsx, and installs clsx and tailwind-merge. The URL works in any app with a components.json, with no registry to add first.

Usage

example.tsx
import { Notice } from "@/components/pixilui/notice";

<Notice
  title={title}
  onClose={onClose}
  onClosed={onClosed}
/>

Fills its container; the title and its line wrap, and the action sits on the right.

API reference

PropTypeDefault
titleRequiredReactNode–A notice: the title, 14/20 in ink. A banner: the lead of its line, in ink at medium.
subReactNode–A notice: the line under the title. A banner: the rest of its one line, after the lead.
tone"neutral" | "done" | "warn" | "fail" | "wait" | "run"–The status color: neutral (default), done, warn, fail, wait or run. The panel takes its fill, the glyph its hue.
iconReactNode–A bare glyph in the tone's hue.
agentAgentAvatarState–Or the agent as the subject: the locked agent avatar in this state (it plays its own change when the state changes).
agentNamestring–The agent's name, for screen readers.
workingboolean–Working: the title shimmers, aria-busy.

Keyboard

TabReaches the action and the close.
Enter SpaceRuns the focused action or closes it.

Accessibility

  • role status, so a change is announced politely; aria-busy while it works.
  • The glyph is decorative (aria-hidden) and the words carry the meaning; the agent's avatar is named (agentName).
  • The close only shows when the notice can go, and has an accessible name (closeLabel).

Motion

  • The space folds open first (260ms on Emil's enter curve), then the icon swaps in (300ms from .3 out of a blur) and the words and each button rise 6px out of a 2px blur, 50ms apart.
  • A turn: the words and buttons leave (140ms, up 4px), a line more or less glides (240ms), the icon swaps or the agent plays its own change, the tint turns (200ms), and the pieces arrive again.
  • Closing, the content leaves quieter and faster, then the space folds shut (200ms). Reduced motion: it appears, turns and goes at once.
BannerIt opens its space, then its line arrives in pieces; an action turns it in place.
ToastA delete waits while the red rim runs out; Undo winds it back.
Agent avatarThe agent's face acts out its work, blinking on every change and hopping when done.

PixilUI Pro opens soon. The first 20 licenses are $99.