BetaPublic beta — Read the release notes
Documentation

Alert

Inline, non-modal alert for status messages with live region semantics.

Package
@solidiom/alert
Version
0.0.1-next.0
Status
stable

Preview

Information
A new feature is available in your dashboard.
Success
Your changes have been saved.
Warning
You are approaching your storage limit.
Error
Failed to connect to the server.

This preview uses documentation-only styling. Ship with one of the included recipe outputs (CSS, Tailwind, or UnoCSS) for production styles.

Alert renders an inline, non-modal notification area with ARIA live region semantics. It supports four visual variants (info, success, warning, error) and two assertiveness levels (assertive, polite) to control how screen readers announce the message. Title and Description parts are automatically wired via aria-labelledby and aria-describedby using SSR-safe stable IDs.

Usage

Alert composes from three composable parts: Root, Title, and Description. Configure the variant and assertiveness through props on Root.

import * as Alert from "@solidiom/alert"

;<Alert.Root type="info">
  <Alert.Title>Information</Alert.Title>
  <Alert.Description>This is an informational message.</Alert.Description>
</Alert.Root>

Installation

Install the package with pnpm add @solidiom/alert. The package requires compatible solid-js and @solidjs/web peer dependencies.

Props

Root

PropTypeDefaultDescription
type"info" | "success" | "warning" | "error""info"Alert variant that controls visual appearance.
assertiveness"assertive" | "polite""assertive"Live region assertiveness. Assertive uses role="alert" and interrupts the user. Polite uses role="status" and announces at the next opportunity.

Title

PropTypeDefaultDescription
childrenJSX.ElementTitle text. Required for accessibility.

Description

PropTypeDefaultDescription
childrenJSX.ElementBody text for the alert message.

Styling

Alert carries data-scope="alert", data-part, and data-state attributes for styling hooks.

Partdata-partdata-state
RootrootVariant (info, success, warning, error)
Titletitle
Descriptiondescription

Apply your visual recipe using the data attributes for targeting. Root renders as a <div>, Title as an <h5>, and Description as a <div>.

Keyboard & behavior

This primitive has no keyboard interaction. It renders static content that does not receive focus or respond to key events.

SSR and hydration

Alert uses createStableId for SSR-safe ID generation, ensuring aria-labelledby and aria-describedby references are consistent between server and client renders.