PolyHunter

Alert

Hover decoration requires a fine pointer and hover support at widths of 768px or more. Phone and touch controls keep tap actions and keyboard focus without rollover effects.

A status message that calls attention to important information. Pick a status to color the title, border, and background. The close button label follows the selected UI locale.

Playground

Live preview

Examples

Variants

import {
  CheckSquareBoldDuotoneIcon,
  DangerSquareBoldDuotoneIcon,
  InfoSquareBoldDuotoneIcon,
} from "@npolyhunter/ui/icons";

<Alert status="info" icon={<InfoSquareBoldDuotoneIcon />}>
  <AlertTitle>Heads up</AlertTitle>
  <AlertDescription>New hunts are available in your region.</AlertDescription>
</Alert>

<Alert status="warning" icon={<DangerSquareBoldDuotoneIcon />}>
  <AlertTitle>Session expiring</AlertTitle>
  <AlertDescription>Your session ends in 5 minutes.</AlertDescription>
</Alert>

<Alert status="success" icon={<CheckSquareBoldDuotoneIcon />}>
  <AlertTitle>Claim submitted</AlertTitle>
  <AlertDescription>Your reward is on the way.</AlertDescription>
</Alert>

<Alert status="danger" icon={<DangerSquareBoldDuotoneIcon />}>
  <AlertTitle>Claim failed</AlertTitle>
  <AlertDescription>The hunt could not be verified.</AlertDescription>
</Alert>

// icon prop: pass any node, or null to hide
<Alert status="info" icon={null}>…</Alert>

// closable: close button on the right, vertically centered
<Alert status="danger" closable onClose={() => dismiss()}>
  <AlertTitle>Claim failed</AlertTitle>
  <AlertDescription>The hunt could not be verified.</AlertDescription>
</Alert>

Code

import { Alert, AlertDescription, AlertTitle } from "@npolyhunter/ui";
import { InfoSquareBoldDuotoneIcon } from "@npolyhunter/ui/icons";

// status: "info" (default) | "warning" | "success" | "danger"
// closable adds a close button on the right side
<Alert status="info" icon={<InfoSquareBoldDuotoneIcon />} closable>
  <AlertTitle>Heads up</AlertTitle>
  <AlertDescription>
    New hunts are available in your region.
  </AlertDescription>
</Alert>

Code

import { Alert, AlertDescription, AlertTitle } from "@npolyhunter/ui";
import { InfoSquareBoldDuotoneIcon } from "@npolyhunter/ui/icons";

// status: "info" (default) | "warning" | "success" | "danger"
// closable adds a close button on the right side
<Alert status="info" icon={<InfoSquareBoldDuotoneIcon />} closable>
  <AlertTitle>Heads up</AlertTitle>
  <AlertDescription>
    New hunts are available in your region.
  </AlertDescription>
</Alert>

Used in

Includes use through shared UI components.

AppBack Office