VibeUI
ComponentsDocs
VibeUI

Components with taste, that you own. Copy the source, retint the tokens, keep every line.

Library

  • All components
  • Signature pieces
  • Text effects
  • Footers

Docs

  • Introduction
  • Installation
  • Theming
  • CLI

Project

  • GitHub
  • Agents and MCP
  • Issues
  • MIT license
© 2026 VibeUI · MIT licensed
  1. Components
  2. Feedback
  3. Alert

Alert

Inline status message with tone, icon and optional title.

FeedbackServer-safe

Tokens synced

Light and dark palettes match.

Heads up

Prefer hairlines over shadows.

Draft

Publish when the copy is ready.

Connection lost

We’ll retry in a few seconds.

Install

bash
npx @agents-npm-packages/vibeui add alert --dir ./src/components/ui

Import

tsx
import { Alert } from "@/components/ui/alert"

API

Generated from the component's TypeScript types, so it always matches the source. * marks a required prop.

<Alert>

also accepts every HTMLAttributes<HTMLDivElement> attribute

PropTypeDefaultDescription
tone"neutral" | "sky" | "sage" | "sand" | "rose""neutral"Semantic color: neutral, sky, sage, sand, rose.
titleReactNode—Heading text.

Source

src/components/ui/alert.tsx
import * as React from "react";
import {
  CheckCircle,
  Info,
  Warning,
  WarningOctagon,
} from "@phosphor-icons/react/dist/ssr";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";

/** Inline status message with tone, icon and optional title. */
const alertVariants = cva(
  "relative flex w-full animate-pop-in gap-3 rounded-md border px-4 py-3.5 text-sm leading-relaxed",
  {
    variants: {
      tone: {
        neutral: "border-line bg-surface-muted text-ink-soft",
        sky: "border-pastel-sky-ink/15 bg-pastel-sky text-pastel-sky-ink",
        sage: "border-pastel-sage-ink/15 bg-pastel-sage text-pastel-sage-ink",
        sand: "border-pastel-sand-ink/15 bg-pastel-sand text-pastel-sand-ink",
        rose: "border-pastel-rose-ink/15 bg-pastel-rose text-pastel-rose-ink",
      },
    },
    defaultVariants: { tone: "neutral" },
  },
);

const icons = {
  neutral: Info,
  sky: Info,
  sage: CheckCircle,
  sand: Warning,
  rose: WarningOctagon,
} as const;

export function Alert({
  className,
  tone = "neutral",
  title,
  children,
  ...props
}: Omit<React.HTMLAttributes<HTMLDivElement>, "title"> &
  VariantProps<typeof alertVariants> & { title?: React.ReactNode }) {
  const Icon = icons[tone ?? "neutral"];
  return (
    <div
      role="alert"
      className={cn(alertVariants({ tone }), className)}
      {...props}
    >
      <Icon size={18} weight="fill" className="mt-0.5 shrink-0 animate-pop-in [animation-delay:120ms]" />
      <div className="min-w-0">
        {title ? (
          <p className="font-medium tracking-[-0.01em]">{title}</p>
        ) : null}
        {children ? (
          <div className={cn(title && "mt-0.5", "opacity-85")}>{children}</div>
        ) : null}
      </div>
    </div>
  );
}

Exports Alert. Peer dependencies: clsx, tailwind-merge, @phosphor-icons/react, class-variance-authority.

PreviousTag InputNextBanner