Skip to content

Alert

vue
<script setup lang="ts">
import { Alert } from '@/components/kuro/alert';
</script>

<template>
  <Alert>
    <template #title>Heads up!</template>
    <template #description>This is an alert message.</template>
  </Alert>
</template>

Installation

bash
npx kuro-ui add allert
bash
npx github:Bartek-Nowak/Kuro add allert

Variants and Sizes

The Alert component supports several visual variants and sizes. Use the variant and size props to customize its appearance.

VariantDescription
defaultBlue tone for neutral information
destructiveRed tone for destructive or error messages
successGreen tone for success or confirmation
warningYellow tone for warning or caution messages
SizeDescription
smSmall alert
mdMedium alert (default)
lgLarge alert

Props

PropTypeDescription
variantstringVisual variant (default, destructive, etc.)
sizestringAlert size (sm, md, lg)
classstringAdditional Tailwind classes (optional)
titleTagstringHTML tag for the title (default: p)
descriptionTagstringHTML tag for the description (default: p)

Slots

SlotDescription
title(optional) Title of the alert box
description(optional) Description or subtitle
defaultMain content (e.g. buttons or custom UI)

Usage Example

vue
<template>
  <Alert variant="success" size="lg">
    <template #title>Success!</template>
    <template #description>Your changes have been saved.</template>
    <span>✔️</span>
  </Alert>
</template>