Skip to content
synccn

Alert

Inline message in five tones, with action and dismiss.

A new version is available

synccn 2.4 adds range mode to Calendar.

Payment received

Your invoice for March has been paid.

Your trial ends in 3 days

Pick a plan to keep your projects.

Playground

Change the props and copy the code. The controls come from the component's TypeScript types.

Trial ends soon

Upgrade to keep your projects after the 14th.

Props

variant
import { Alert } from "@/components/ui/alert";<Alert title="Trial ends soon">Upgrade to keep your projects after the 14th.</Alert>

Installation

$ pnpm dlx shadcn@latest add @synccn/alert

First time in this project? Connect synccn with one command.

Usage

import { Alert } from "@/components/ui/alert";<Alert variant="warning" title="Trial ends soon">…</Alert>

API reference

Generated from the component's TypeScript types, so it always matches the code.

  • variant
    "default" | "info" | "success" | "warning" | "destructive"

    Default "default"

    Colour and default icon.

  • title
    React.ReactNode

    Bold first line.

  • dismissible
    boolean

    Default false

    Shows a close button that hides the alert.

  • action
    React.ReactNode

    Button or link shown under the text.

  • icon
    React.ElementType

    Replaces the variant's default icon.

  • children
    React.ReactNode

    Content to render.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: variant
  • ARIA attributes: aria-label