Notice

A quiet line of text with a coloured dot, for something worth knowing: done, be careful, or gone wrong.

Saved. Your changes are live.

Trial ends in 3 days. Add a card to keep going.

Payment failed. Check the card and try again.

Options

Size

Code

import "./notice.css";

export function Notice({ kind, title, children }) {
  return (
    <p className="dh-notice" data-kind={kind} role={kind === "bad" ? "alert" : "status"}>
      <span>
        {title && <b>{title} </b>}
        {children}
      </span>
    </p>
  );
}

export function Example() {
  return (
    <div className="dh-notice-stack">
      <Notice kind="good" title="Saved.">Your changes are live.</Notice>
      <Notice kind="warn" title="Trial ends in 3 days.">Add a card to keep going.</Notice>
      <Notice kind="bad" title="Payment failed.">Check the card and try again.</Notice>
    </div>
  );
}

Saved. Your changes are live.

Trial ends in 3 days. Add a card to keep going.

Payment failed. Check the card and try again.