Skip to content

TkxAlert

import { TkxAlert } from 'tekivex-ui';
<TkxAlert variant="info">Update available — restart to apply.</TkxAlert>
Information message — does not interrupt screen readers.
Operation completed successfully.
<TkxAlert variant="info">Information message</TkxAlert>
<TkxAlert variant="success">Operation completed</TkxAlert>
<TkxAlert variant="warning">Disk space low</TkxAlert>
<TkxAlert variant="danger">Connection lost — retrying</TkxAlert>

The variant determines both the visual style and the WAI-ARIA role:

VariantRoleAnnouncement
infostatuspolite — does not interrupt
successstatuspolite
warningstatuspolite
dangeralertassertive — interrupts current speech
With title

Deploy succeeded

Your changes are live at my-app.example.com.
<TkxAlert variant="success" title="Deploy succeeded">
Your changes are live at <code>my-app.example.com</code>.
</TkxAlert>
Dismissible
const [open, setOpen] = useState(true);
{open && (
<TkxAlert
variant="warning"
title="Beta feature"
onClose={() => setOpen(false)}
>
This feature may change without notice.
</TkxAlert>
)}

The close button gets aria-label from the active locale (defaults to “Close”).

TkxAlert is one of the 13 components that render in Next.js Server Components without 'use client' — useful for status messages from searchParams or server-fetched data.

PropTypeRequiredDescription
variant'info' | 'success' | 'warning' | 'danger'yesVisual + role mapping.
titleReactNodeBold heading row.
onClose() => voidRenders the close button.
iconReactNodeOverride the default per-variant icon.
childrenReactNodeyesBody content.

src/components/TkxAlert.tsx