Alert
A hand-drawn callout whose outline is sketched around the message.
Default
Destructive
With action
Paper texturesPatterns from Hero Patterns
Title only
Installation
Add Alert with the shadcn CLI.
npx shadcn@latest add https://sketchcn.chuwii.com/r/alert.json
Examples
Notices, errors, inline actions, and a steadier drawing hand.
Release note
import { InfoCircle } from "@boxicons/react";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";

export function ReleaseNote() {
  return (
    <Alert>
      <InfoCircle />
      <AlertTitle>Sketchcn 1.2 is out</AlertTitle>
      <AlertDescription>
        Alerts now draw their own outline with RoughJS.
      </AlertDescription>
    </Alert>
  );
}
Upload error
import { AlertTriangle } from "@boxicons/react";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";

export function UploadError() {
  return (
    <Alert variant="destructive">
      <AlertTriangle />
      <AlertTitle>Upload failed</AlertTitle>
      <AlertDescription>
        The file is larger than the 5 MB limit.
      </AlertDescription>
    </Alert>
  );
}
With action
import { CheckCircle } from "@boxicons/react";
import {
  Alert,
  AlertAction,
  AlertDescription,
  AlertTitle,
} from "@/components/ui/alert";
import { Button } from "@/components/ui/button";

export function DraftSaved() {
  return (
    <Alert>
      <CheckCircle />
      <AlertTitle>Draft saved</AlertTitle>
      <AlertDescription>You can keep sketching from any device.</AlertDescription>
      <AlertAction>
        <Button size="xs" variant="ghost">
          Undo
        </Button>
      </AlertAction>
    </Alert>
  );
}
Paper texture
import { AlertTriangle } from "@boxicons/react";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";

export function MaintenanceNotice() {
  return (
    <Alert paper="graph" variant="destructive">
      <AlertTriangle />
      <AlertTitle>Scheduled maintenance</AlertTitle>
      <AlertDescription>
        Sketches are read-only until 18:00.
      </AlertDescription>
    </Alert>
  );
}
Steadier outline
import { Alert, AlertTitle } from "@/components/ui/alert";

export function CalmAlert() {
  return (
    <Alert className="[--sketch-roughness:0.4] [--sketch-bowing:0.6]">
      <AlertTitle>A steadier hand drew this one</AlertTitle>
    </Alert>
  );
}