Skip to main content

Announcement

A component for new product announcement or news.

import { Announcement } from "rizzui/announcement";

Default

The default style of Announcement component.

Trending25% discount

on our new product

import { Announcement } from "rizzui/announcement";

export default function App() {
return (
<Announcement
className="flex-wrap"
badgeText="Trending"
highlightedText="25% discount"
>
on our new product
</Announcement>
);
}

Sizes

You can change the size of Announcement using size property.

Small25% discount

on our new product

Default25% discount

on our new product

Large25% discount

on our new product

Large25% discount

on our new product

import { Announcement } from "rizzui/announcement";

export default function App() {
return (
<>
<Announcement
className="flex-wrap"
size="sm"
badgeText="Small"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
badgeText="Default"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
size="lg"
badgeText="Large"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
badgeText="Large"
highlightedText="25% discount"
>
on our new product
</Announcement>
</>
);
}

Colors

You can change the color of Announcement using color property.

Primary25% discount

on our new product

Secondary25% discount

on our new product

Danger25% discount

on our new product

Info25% discount

on our new product

Success25% discount

on our new product

Warning25% discount

on our new product

import { Announcement } from "rizzui/announcement";

export default function App() {
return (
<>
<Announcement
className="flex-wrap"
color="primary"
badgeText="Primary"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
color="secondary"
badgeText="Secondary"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
color="danger"
badgeText="Danger"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
color="info"
badgeText="Info"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
color="success"
badgeText="Success"
highlightedText="25% discount"
>
on our new product
</Announcement>
<Announcement
className="flex-wrap"
color="warning"
badgeText="Warning"
highlightedText="25% discount"
>
on our new product
</Announcement>
</>
);
}

Background Colors

You can change background color of Announcement using bgColor property.

White Background25% discount

on our every product

Gray Background25% discount

on our every product

import { Announcement } from "rizzui/announcement";

export default function App() {
return (
<>
<Announcement
className="flex-wrap"
badgeText="White Background"
highlightedText="25% discount"
>
on our every product
</Announcement>
<Announcement
className="flex-wrap"
badgeText="Gray Background"
highlightedText="25% discount"
bgColor="muted"
>
on our every product
</Announcement>
</>
);
}

With Icons

You can add icons to Announcement using startIcon & endIcon property.

25% discount

on our every product

Trending25% discount

on our every product

import { Announcement } from "rizzui/announcement";
import { ChevronRightIcon, MegaphoneIcon } from "@heroicons/react/24/outline";

export default function App() {
return (
<>
<Announcement
className="flex-wrap"
highlightedText="25% discount"
color="primary"
startIcon={<MegaphoneIcon className="w-5 text-primary-dark" />}
>
on our every product
</Announcement>
<Announcement
className="flex-wrap"
badgeText="Trending"
highlightedText="25% discount"
color="danger"
endIcon={<ChevronRightIcon className="w-3.5 ml-1" />}
>
on our every product
</Announcement>
</>
);
}

API Reference


Announcement Props

Here is the API documentation of the Announcement component.

PropsTypeDescriptionDefault
badgeTextstringPass badge text to have badge at the beginning__
highlightedTextstringPass highlighted text at the beginning__
children__
sizeAnnouncementSizesThe size of the component."md"
colorAnnouncementColorsChoose color variations"primary"
bgColorbackground mutedBackground color of the component"background"
classNamestringPass className to customize announcement design__
startIconReactNodePlace icon at the beginning__
endIconReactNodePlace icon at the end__
badgeClassNamestringPass badgeClassName to style badge__
highlightedTextClassNamestringPass hightlightedTextClassName to style highlighted text__

Announcement Sizes

type AnnouncementSizes = "sm" | "md" | "lg";

Announcement Colors

type AnnouncementColors = "primary" | "secondary" | "danger" | "info" | "success" | "warning";