Primitives

Alert

An inline status message. The first composition in the library — its icon is an Icon, and proving the child's own data-part survived was the point.

data-scope="alert"

Usage

import { Alert } from "@crosskit-ui/react";

<Alert variant="warning" title="Heads up" dismissible onDismiss={hide}>
  Your trial ends in three days.
</Alert>
<script setup lang="ts">
import { Alert } from "@crosskit-ui/vue";
</script>

<template>
  <Alert variant="warning" title="Heads up" dismissible @dismiss="hide">
    Your trial ends in three days.
  </Alert>
</template>
<script lang="ts">
  import { Alert } from "@crosskit-ui/svelte";
</script>

<Alert variant="warning" title="Heads up" dismissible onDismiss={hide}>
  Your trial ends in three days.
</Alert>
import { CkAlert } from "@crosskit-ui/angular";

@Component({
  imports: [CkAlert],
  template: `
    <ck-alert variant="warning" title="Heads up" dismissible (dismiss)="hide()">
      Your trial ends in three days.
    </ck-alert>
  `,
})
export class Demo {}

Props

PropTypeDefaultNotes
variant"info" | "success" | "warning" | "error""info"Status.
titleReactNodeBold heading above the body.
showIconbooleantrueStatus icon.
dismissiblebooleanfalseRenders a close button.
onDismiss() => voidCalled when dismissed.

Prop names are identical in all four frameworks. Only two-way binding differs, and each framework uses its own idiom over the same underlying prop.