Feedback

Alert

Inline alert for sync issues, limits and compliance notes. Four tones plus feature, three styles (soft, solid, outline) and two sizes.

react-aria-componentslucide-react

Soft

Salesforce sync runs every 15 minutes
Last sync 4 min ago · 2,318 accounts mapped.
Domain verified
Emails will now send from vantu.dev.
80% of AI credits used
Credits reset Oct 1. Upgrade to keep enriching.

Solid and outline with actions

Link actions and a dismiss button.

AI research is here
Generate an account brief from 20+ sources in one click.
Try it
80% of AI credits used
Credits reset Oct 1.
Domain verified
Emails now send from vantu.dev.

Compact

Single 36px line for toolbars, forms and table headers.

Salesforce sync runs every 15 minutes.
Upgrade
24 prospects enriched · 22 verified emails.
You’re close to your enrichment limit.
Upgrade
New: AI research briefs.
Upgrade

Installation

Components are copied into your project — no runtime package.

  1. Install the following dependencies:

    terminal
    npm install react-aria-components lucide-react
  2. Create a alert.tsx file and paste the following code into it.

    src/components/ui/alert.tsx
    "use client";
    
    import { AlertTriangle, CheckCircle2, Info, Sparkles, X, XCircle } from "lucide-react";
    import type { ReactNode } from "react";
    import { Button as AriaButton } from "react-aria-components";
    import { cx } from "@/utils/cx";
    
    export type StatusTone = "info" | "success" | "warning" | "error" | "feature";
    export type AlertVariant = "soft" | "solid" | "outline";
    
    const tones: Record<StatusTone, { soft: string; solid: string; icon: string; Icon: typeof Info }> = {
      info: { soft: "bg-info-soft border-info-border", solid: "bg-info", icon: "text-info", Icon: Info },
      success: { soft: "bg-success-soft border-success-border", solid: "bg-success", icon: "text-success", Icon: CheckCircle2 },
      warning: { soft: "bg-warning-soft border-warning-border", solid: "bg-warning", icon: "text-warning", Icon: AlertTriangle },
      error: { soft: "bg-error-soft border-error-border", solid: "bg-error", icon: "text-error", Icon: XCircle },
      feature: { soft: "bg-accent-soft border-accent-soft-border", solid: "bg-linear-to-b from-accent-light to-accent", icon: "text-accent", Icon: Sparkles },
    };
    
    export interface AlertProps {
      tone?: StatusTone;
      /** `soft` tinted surface (default) · `solid` filled · `outline` white with border and shadow. */
      variant?: AlertVariant;
      /** `md` stacks title + description; `sm` is a single 36px line. */
      size?: "sm" | "md";
      title: ReactNode;
      children?: ReactNode;
      /** Inline actions, typically <LinkButton>s. */
      actions?: ReactNode;
      /** Deprecated alias of `actions` kept for compatibility. */
      action?: ReactNode;
      onDismiss?: () => void;
      className?: string;
    }
    
    /** Inline alert for sync issues, limits and compliance notes. Four tones + feature, three styles, two sizes. */
    export function Alert({ tone = "info", variant = "soft", size = "md", title, children, actions, action, onDismiss, className }: AlertProps) {
      const t = tones[tone];
      const solid = variant === "solid";
      const acts = actions ?? action;
      const dismiss = onDismiss && (
        <AriaButton
          aria-label="Dismiss"
          onPress={onDismiss}
          className={cx(
            "-m-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-xs outline-none data-focus-visible:shadow-focus",
            solid ? "text-white/70 data-hovered:text-white" : "text-fg-muted data-hovered:text-fg",
          )}
        >
          <X className="size-3.5" />
        </AriaButton>
      );
    
      return (
        <div
          role={tone === "error" ? "alert" : "status"}
          className={cx(
            "flex gap-2.5 rounded-md",
            variant === "soft" && ["border", t.soft],
            variant === "outline" && "border border-line bg-surface shadow-card",
            solid && [t.solid, "text-white [&_a]:!text-white [&_[role=link]]:!text-white"],
            size === "sm" ? "min-h-9 items-center px-3 py-2" : "items-start px-3.5 py-3",
            className,
          )}
        >
          <t.Icon aria-hidden className={cx("size-4 shrink-0", size === "md" && "mt-px", solid ? "text-white" : t.icon)} />
          {size === "sm" ? (
            <>
              <div className={cx("min-w-0 flex-1 truncate text-sm font-medium", solid ? "text-white" : "text-fg")}>{title}</div>
              {acts}
              {dismiss}
            </>
          ) : (
            <>
              <div className="min-w-0 flex-1">
                <div className={cx("text-base font-medium", solid ? "text-white" : "text-fg")}>{title}</div>
                {children && <div className={cx("mt-0.5 text-sm", solid ? "text-white/80" : "text-fg-secondary")}>{children}</div>}
                {acts && <div className="mt-2.5 flex flex-wrap items-center gap-3">{acts}</div>}
              </div>
              {dismiss}
            </>
          )}
        </div>
      );
    }
  3. Create a link-button.tsx file and paste the following code into it.

    src/components/ui/link-button.tsx
    "use client";
    
    import type { ReactNode } from "react";
    import { Link as AriaLink, type LinkProps as AriaLinkProps } from "react-aria-components";
    import { cx } from "@/utils/cx";
    
    export interface LinkButtonProps extends Omit<AriaLinkProps, "className" | "children"> {
      tone?: "gray" | "black" | "accent" | "error";
      size?: "sm" | "md";
      underline?: boolean;
      leadingIcon?: ReactNode;
      trailingIcon?: ReactNode;
      className?: string;
      children: ReactNode;
    }
    
    const tones = {
      gray: "text-fg-secondary data-hovered:text-fg",
      black: "text-fg data-hovered:text-fg-secondary",
      accent: "text-accent-text data-hovered:text-accent-pressed",
      error: "text-error-text data-hovered:text-error-hover",
    };
    
    /** Inline text action. Underline on hover, or always with `underline`. */
    export function LinkButton({ tone = "accent", size = "md", underline, leadingIcon, trailingIcon, className, children, ...props }: LinkButtonProps) {
      return (
        <AriaLink
          {...props}
          className={cx(
            "inline-flex cursor-pointer items-center gap-1 rounded-xs font-medium underline-offset-[3px] outline-none transition-colors",
            "data-hovered:underline data-focus-visible:shadow-focus data-disabled:cursor-default data-disabled:text-fg-disabled data-disabled:no-underline",
            size === "md" ? "text-base [&_svg]:size-4" : "text-sm [&_svg]:size-3.5",
            underline && "underline decoration-current/40",
            tones[tone],
            className,
          )}
        >
          {leadingIcon}
          {children}
          {trailingIcon}
        </AriaLink>
      );
    }
  4. Add the theme tokens and the cx helper from Installation if you haven’t yet, then update the import paths to match your project setup.

Props

PropTypeDefaultDescription
tone"info" | "success" | "warning" | "error" | "feature""info"Status color and icon.
variant"soft" | "solid" | "outline""soft"Surface style.
size"sm" | "md""md"Single line or stacked.
actionsReactNode—Inline link buttons.
onDismiss() => void—Shows the close button.