alert
bejamas-ui/alertFreeComponent
bejamas/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by bejamas/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.bejamas.com/r/alert.jsonSource
1---2// Generated from bejamas-juno style registry. Do not edit packages/ui/src/components/alert/Alert.astro directly.3/**4 * @component Alert5 * @title Alert6 * @description A prominent message that draws user attention to important information.7 * @figmaUrl https://www.figma.com/design/koxai7zw5vIuBzuVxe5T2l/BejamasUI---Design-System?node-id=2536-3189&t=YFStJ3V8fXEO8QD8-48 *9 * @preview10 *11 * <div class="grid w-full max-w-xl items-start gap-4">12 * <Alert>13 * <CircleCheckIcon size={32} />14 * <AlertTitle>Success! Your changes have been saved</AlertTitle>15 * <AlertDescription>This is an alert with title and description.</AlertDescription>16 * </Alert>17 *18 * <Alert>19 * <AlertTitle>This Alert has a title and an icon. No description.</AlertTitle>20 * </Alert>21 *22 * <Alert variant="destructive">23 * <AlertTitle>Unable to process your payment.</AlertTitle>24 * <AlertDescription>25 * <p>Please verify your billing information and try again.</p>26 * <ul class="list-inside list-disc text-sm">27 * <li>Check your card details</li>28 * <li>Ensure sufficient funds</li>29 * <li>Verify billing address</li>30 * </ul>31 * </AlertDescription>32 * </Alert>33 * </div>34 *35 * @usage36 *37 * ```astro nocollapse38 * ---39 * import { Alert, AlertTitle, AlertDescription } from '@bejamas/ui/components/alert';40 * ---41 * <Alert variant="default">42 * <CircleCheckIcon size={32} />43 * <AlertTitle>Heads up!</AlertTitle>44 * <AlertDescription>Something happened successfully.</AlertDescription>45 * </Alert>46 * ```47 */48import { cva } from "class-variance-authority";49import { cn } from "@/lib/utils";50import type { HTMLAttributes } from "astro/types";5152type AlertVariant = "default" | "destructive";5354interface Props extends HTMLAttributes<"div"> {55 variant?: AlertVariant;56 class?: string;57}5859const {60 class: className = "",61 variant = "default",62 ...rest63} = Astro.props as Props;6465const alertVariants = cva(66 "grid gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 gap-y-0.5 rounded-xl border-border bg-card has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current group/alert relative w-full",67 {68 variants: {69// … truncated
Files it writes
More from bejamas/ui
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | bejamas/ui | Components | Free | 1 dep · 5 files | |
| avataravatar | bejamas/ui | Components | Free | no deps · 7 files | |
| badgebadge | bejamas/ui | Components | Free | no deps · 2 files | |
| breadcrumbbreadcrumb | bejamas/ui | Components | Free | no deps · 5 files | |
| buttonbutton | bejamas/ui | Components | Free | no deps · 2 files | |
| button-groupbutton-group | bejamas/ui | Components | Free | no deps · 4 files | |
| cardcard | bejamas/ui | Components | Free | no deps · 10 files | |
| carouselcarousel | bejamas/ui | Components | Free | no deps · 3 files |
