GitHub

Form Alert

Inline alert for form validation messages

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { FormAlert } from "@corew500/ui/form-alert"

<FormAlert>Content</FormAlert>

API Reference

Props

PropTypeDefaultDescription
variant*enumAlert variant determining color and icon
titlestringOptional title (displayed in bold)
message*stringMain message content
classNamestringAdditional CSS classes
dismissibleenumfalseWhether the alert can be dismissed
onDismiss() => voidCallback when dismiss button is clicked
dismissLabelstringDismissi18n label for dismiss button

Accessibility

Screen Readers

  • - Built on Alert component with proper ARIA roles.
  • Dismiss button has proper aria-label for screen readers.
  • Alert is announced to screen readers via Alert's role="alert".

Additional

  • Icons have semantic meaning and are not decorative.

Localization

Translatable Content

  • - Title and message props should be translated before passing to component.
  • dismissLabel should be localized (defaults to "Dismiss").

RTL Support

  • Consider RTL layout for dismiss button positioning.

Related

Related Components