Your next page is taking shape...

Opening Your Next Page…

Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.

Made for Preact. Built to be yours.

Status & Feedback

Alert

Inline callouts with optional leading icon, title, description, destructive variant, action slot, and custom colors (shadcn Alert pattern). Explain what is happening, what changed and what someone can do next. Pair visual status with language that still makes sense without its color. Import it from @/components/kamod-ui/alert.

Source · Design reference · API reference · Theming · Styles


Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Installation

Import Alert parts from @/components/kamod-ui/alert.

Install PackagesTerminal
pnpm add @kamod-ch/ui

Copy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.

Import SetupTypeScript
import { Alert, AlertAction, AlertDescription, AlertTitle } from "@kamod-ch/ui";

Usage

Put an optional Lucide icon first, then AlertTitle and AlertDescription. Use AlertAction for a corner control.

Import SetupTypeScript
import { Alert } from "@kamod-ch/ui";

Choose a complete composition from the examples below; required child components and props vary by pattern.

Usage PatternTypeScript
import { Alert, AlertAction, AlertDescription, AlertTitle, Button } from "@kamod-ch/ui";
import { Info } from "lucide-preact";

<Alert>
  <Info />
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>You can add components using the CLI.</AlertDescription>
  <AlertAction>
    <Button variant="outline">Enable</Button>
  </AlertAction>
</Alert>

Component Examples & Variants

Explore Alert in Different Contexts, from the starting pattern to the compositions below. Begin with Basic, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.

Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.

Basic

Keep Persistent Context Close to the Task. Compose AlertTitle and AlertDescription beside a supporting icon within one bounded message. The example constrains the width so the status and its explanation read together rather than stretching across the page.

The icon should reinforce that meaning rather than replace it; this inline pattern stays in the document while the user reads.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Structured Callout

Give Helpful Context a Clear Home. AlertCallout composes the core Alert’s callout variant into an icon header, a reading area and an optional footer. Use eyebrow for a short category, meta for a small index or badge, and footer for related links. Keep the useful explanation in the body; emphasize key decisions with strong and exact values with inline code.

It defaults to role="note", so persistent guidance does not announce itself as an urgent alert. The title is a named label by default; set headingLevel when it belongs in your page’s heading hierarchy, or headingId to create a linkable level-three heading. All slots accept Preact content, and the layout wraps naturally for narrow screens and translated text.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Destructive

Explain Both the Problem and the Recovery. Set variant="destructive" when the message describes an error that needs attention. Put the actual problem in AlertTitle and use the description to explain its effect and the next useful step.

Avoid relying on red alone, and distinguish a correctable field error from a broader failure that affects the whole page or form.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Action

Offer One Clear Next Step. Place the recovery control inside AlertAction; the alert reserves space for it at the logical end of the message. This keeps a related action close to its explanation without positioning it over the text.

Check the layout with a long message and a narrow viewport; if several actions compete, move the less urgent ones into the surrounding page.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Custom Colors

Choose Meaning before Color. Use class utilities to adjust the alert's surface, text and border as a coordinated set. A warning color can distinguish billing or account notices, while the title still states the meaning explicitly.

Test text, icons and borders in both themes, and prefer shared Theme Tokens when the treatment will recur across the product.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width
API reference

Props and Data

Configure Alert using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.

Props overview.

API reference
Your API, from source

Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.

Component Props

Read each option with its owning component. The
marker identifies required fields verified in that declaration. A ? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.
@kamod-ch/ui/alert7.1 KB min · 2.1 KB gzipSignals: none

Alert

AlertProps

Alert documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildAlertProps

Configure children for Alert. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>AlertProps

Configure class for Alert. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
variant
"default" | "callout" | "destructive" | "primary" | "secondary" | "info" | "success" | "warning" | "error"AlertProps

Configure variant for Alert. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"default"

AlertAction

AlertActionProps

AlertAction documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildAlertActionProps

Configure children for AlertAction. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>AlertActionProps

Configure class for AlertAction. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

AlertCallout

AlertCalloutProps

AlertCallout documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildAlertCalloutProps

Configure children for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>AlertCalloutProps

Configure class for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
eyebrow
ComponentChild[] | ComponentChildAlertCalloutProps

A short category above the title.

Default
—
footer
ComponentChild[] | ComponentChildAlertCalloutProps

Configure footer for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
headingId
stringAlertCalloutProps

Configure headingId for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
headingLevel
2 | 3 | 4 | 5 | 6AlertCalloutProps

Configure headingLevel for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
3
icon
ComponentChild[] | ComponentChildAlertCalloutProps

Configure icon for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
meta
ComponentChild[] | ComponentChildAlertCalloutProps

Optional index, badge or source, aligned with the heading.

Default
—
role
AriaRole | SignalLike<AriaRole | undefined>AlertCalloutProps

Configure role for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"note"
title
ComponentChild[] | ComponentChildAlertCalloutProps

Configure title for AlertCallout. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

AlertDescription

AlertDescriptionProps

AlertDescription documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildAlertDescriptionProps

Configure children for AlertDescription. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>AlertDescriptionProps

Configure class for AlertDescription. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

AlertTitle

AlertTitleProps

AlertTitle documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildAlertTitleProps

Configure children for AlertTitle. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>AlertTitleProps

Configure class for AlertTitle. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

Data Type Reference

Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.

Alert Props

1 declared field
AlertProps
Exported Source Declaration from Alert.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of AlertProps before adapting it.

AlertAction Props

1 declared field
AlertActionProps
Exported Source Declaration from AlertAction.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of AlertActionProps before adapting it.

AlertCallout Props

7 declared fields
AlertCalloutProps
Exported Source Declaration from AlertCallout.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of AlertCalloutProps before adapting it.
Required fields
title

AlertDescription Props

1 declared field
AlertDescriptionProps
Exported Source Declaration from AlertDescription.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of AlertDescriptionProps before adapting it.

AlertTitle Props

1 declared field
AlertTitleProps
Exported Source Declaration from AlertTitle.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of AlertTitleProps before adapting it.

Accessibility

Alert renders role="alert". That semantic role is intended for important updates, not simply for giving any paragraph a bordered background. The visual variant does not decide whether an announcement is appropriate.

Take the Next Useful Step

You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.

Connect the Foundation

Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.

Build the Surrounding Screen

Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.

Make the Result Hold Up

Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.

Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.