Skip to content

Alert ​

Styled alert component family built on zw-alert primitives.

@zeus-web/alertFeedbackzweb add alertGenerated

Playground ​

Source ​

Choose the framework entry that matches your application.

html
<script type="module">
  import '@zeus-web/alert/wc/auto'
</script>

<zw-alert variant="success">
  <zw-alert-title>Deployment complete</zw-alert-title>
  <zw-alert-description>
    The new version is now available.
  </zw-alert-description>
</zw-alert>
tsx
import { Alert, AlertDescription, AlertTitle } from '@zeus-web/alert/react'

export function AlertExample() {
  return (
    <Alert variant="success">
      <AlertTitle>Deployment complete</AlertTitle>
      <AlertDescription>The new version is now available.</AlertDescription>
    </Alert>
  )
}
vue
<script setup lang="ts">
import { Alert, AlertDescription, AlertTitle } from '@zeus-web/alert/vue'
</script>

<template>
  <Alert variant="success">
    <AlertTitle>Deployment complete</AlertTitle>
    <AlertDescription>The new version is now available.</AlertDescription>
  </Alert>
</template>

Add ​

bash
zweb add alert

Imports ​

Styled registry component:

tsx
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert'

Primitive React wrapper:

tsx
import { Alert, AlertTitle, AlertDescription } from '@zeus-web/alert/react'

Web Component entry:

ts
import '@zeus-web/alert/wc/auto'

Props ​

PropTypeDefaultDescription
variantAlertVariant
Values: default, info, success, warning, danger
defaultVisual style variant.
livestringpoliteARIA live region mode.

Events ​

No public events documented.

Slots ​

SlotDescription
defaultAlert content.

Styling ​

Uses Tailwind: yes

Theme tokens:

  • bg-background
  • text-foreground
  • border

Internal selectors:

  • [data-slot=alert-root]
  • [data-slot=alert-title]
  • [data-slot=alert-description]

Registry ​

Registry source: available.

Add command: zweb add alert

Type: component

Dependencies:

  • @zeus-web/alert
  • class-variance-authority

Registry dependencies:

  • cn
  • globals

Files:

  • templates/react/alert.tsx → components/ui/alert.tsx
  • templates/vue/alert.ts → components/ui/alert.ts

AI usage rules ​

Do:

  • Use Alert for system messages.
  • Use AlertTitle for the heading.
  • Use AlertDescription for the detail.

Do not:

  • Do not use Alert for persistent banners outside the page content.

Examples ​

React styled usage ​

tsx
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert'

export function Example() {
  return (
    <Alert variant="info">
      <AlertTitle>Heads up!</AlertTitle>
      <AlertDescription>Info message here.</AlertDescription>
    </Alert>
  )
}

Released under the MIT License.