Atoms / Notice

Notice

A message in the flow of the page; the state always comes with a word.

import { Notice } from "@forgeron/ui";
/01 → Default
import { Button, Notice } from "@forgeron/ui";

export default function Default() {
  return (
    <div style={{ width: "100%", maxWidth: 520 }}>
      <Notice
        tone="warning"
        title="The Odoo token expires in 3 days."
        action={<Button size="sm">Renew</Button>}
      />
    </div>
  );
}
/02 → Tones
Note

Previews close after 7 days.

Done

crm 1.4.0 is live.

import { Button, Notice } from "@forgeron/ui";

export default function Tones() {
  return (
    <div style={{ display: "grid", gap: 12, width: "100%", maxWidth: 520 }}>
      <Notice title="Previews close after 7 days." />
      <Notice tone="success" title="crm 1.4.0 is live." />
      <Notice
        tone="warning"
        title="The Odoo token expires in 3 days."
        action={<Button size="sm">Renew</Button>}
      />
      <Notice tone="danger" title="The deploy failed.">
        The build stopped on a type error in src/actions.ts.
      </Notice>
    </div>
  );
}
API → Props
PropTypeDefaultDescription
tone"info" | "success" | "warning" | "danger""info"Note, Done, Warning, Error.
titleReactNode—One line.
actionReactNode—The thing to do next.
childrenReactNode—The detail.
classNamestring—Extra classes.