Notification
A reusable notification component that displays animated messages with smooth slide and scale transitions, perfect for in-app alerts, toasts, and contextual updates.
Current Theme:
"Please direct your attention to the bottom-right corner of the viewport for a preview."
Nexus raises $40M Series B 🎉
Fueling the future of social identity and agent-driven play.
The new funding, led by Aurora Ventures and Vector Capital, will help us advance agent identity, expand cross-world integrations, and elevate the creator experience across the Nexus ecosystem.
API usage
components/notification.demo.tsx
import {
Notification,
NotificationCancel,
NotificationContent,
NotificationTrigger,
} from "./notification";
export function NotificationDemo() {
return (
<Notification
className="right-5 bottom-5 z-50 max-w-xs text-sm"
slideContentFrom="bottom"
>
<NotificationTrigger>
<h3 className="font-medium">Nexus raises $40M Series B 🎉</h3>
<p className="mt-1 text-xs">
Fueling the future of social identity and agent-driven play.
</p>
</NotificationTrigger>
<NotificationContent className="max-h-(--container-xs)">
The new funding, led by Aurora Ventures and Vector Capital, will help us
advance agent identity, expand cross-world integrations, and elevate the
creator experience across the Nexus ecosystem.
</NotificationContent>
<NotificationCancel />
</Notification>
);
}
Installation
CLIÂ (recommended)
1
Run the command below to add the component to your project.
It will also generate the required base stylesheet if one doesn't already exist and guide you through setting up the import aliasÂ
@/components/... if it isn't already configured.pnpm dlx shadcn@latest add https://100xui.com/components/notification.jsonManual
1
pnpm add clsx lucide-react motion tailwind-merge2
100xui
components/notification.tsx
3
API reference
<Notification/>
| Props | Type | Description | Default value |
|---|---|---|---|
transition? | | Custom motion transitions for scale and vertical movement. Lets you fine-tune animation timing and easing. | |
initialContentScale? | | Sets the starting scale of the content before expansion. Adjust this to create a subtle zoom-in or pop effect when the notification opens. | |
expandedGap? | | Specifies the gap between the trigger and the expanded content when the notification is open. | |
minVisibleContentHeight? | | Determines how much of the content remains visible when the notification is collapsed. Useful for showing a preview. | |
slideContentFrom? | | Controls the direction from which the content slides in during expansion. | |
...rest | | Any standard React div props, like id, style or className, which will be applied directly to the component's root element. | |
<NotificationTrigger/>
| Props | Type | Description | Default value |
|---|---|---|---|
props | | Any standard React div props like id, style, className, onMouseEnter, etc. These will be applied directly to the trigger element. | |
<NotificationContent/>
| Props | Type | Description | Default value |
|---|---|---|---|
props | | Any standard motion.div props excluding ref. These will be applied to the content wrapper element, allowing custom styles, classNames, or event handlers. | |
<NotificationCancel/>
| Props | Type | Description | Default value |
|---|---|---|---|
props | | Any standard React button props, like id, style, className, or onClick. Applied to the cancel button, with built-in dismiss and hide functionality. | |