Back to Shark UI

Announcement

docs/components/announcement

latest6.7 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Announcement

Copy Markdown

Inline notice for short, prominent updates.

PreviewCode

Releasev2.1.0 — Dark mode, faster builds, and 12 new components

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/announcement

Anatomy#

Announcement
├── Badge
└── AnnouncementTitle

Usage#

import {
  Announcement,
  AnnouncementTitle,
} from "@/components/ui/announcement";
<Announcement>
  <Badge>
    <SparklesIcon />
  </Badge>
  <AnnouncementTitle>New feature added</AnnouncementTitle>
</Announcement>

Variants#

Info#

PreviewCode

MaintenanceScheduled downtime tonight 2–4 AM UTC. No action needed.

Success#

PreviewCode

DeployedProduction build completed in 2m 34s

Warning#

PreviewCode

Trial endingYour free trial expires in 3 days. Upgrade to keep access.

Destructive#

PreviewCode

Payment failedYour last invoice couldn't be processed. Update your billing info.

Examples#

With icon#

PreviewCode

New featuresDark mode and 12 new components available

The asChild prop renders a link with announcement styling.

PreviewCode

Latest updateNew feature added

Without Badge#

The announcement supports a title-only layout without the badge component.

PreviewCode

New features added, check the logs for more details.

API Reference#

Announcement#

Root wrapper for announcement banners or notices.

PropTypeDefault
role`"status""alert"`
classNamestring-
asChildbooleanfalse

AnnouncementTitle#

Main title or message of the announcement.

PropTypeDefault
classNamestring-
asChildbooleanfalse

[

Previous page

Alert ](/docs/components/alert)[

Next page

Aspect Ratio ](/docs/components/aspect-ratio)

On This Page

InstallationAnatomyUsageVariantsInfoSuccessWarningDestructiveExamplesWith iconWith linkWithout BadgeAPI ReferenceAnnouncementAnnouncementTitle