Primitives
19

Alert

A message that needs attention. Polite by default: role="alert" makes a screen reader interrupt whatever it was reading, which is right for a message that just appeared and wrong for one that was on the page all along — set urgent only for the former. The tone is a colour and the strength of its wash, read through --aura-alert-color and --aura-alert-tint, so .aura-alert--brand { --aura-alert-color: var(--brand) } is a sixth tone with no fork of the stylesheet.

plain markup — no library on the page
rendered by aura-react
rendered by aura-vue
rendered by aura-svelte
built from aura-angular's own class helpers
Budget at 80%
Three days left in the cycle.
Build failed
aura-svelte — 2 minutes ago
Tokens rebuilt.
Budget at 80%
Three days left in the cycle.
Build failed
aura-svelte — 2 minutes ago
Tokens rebuilt.
Budget at 80%
Three days left in the cycle.
Build failed
aura-svelte — 2 minutes ago
Tokens rebuilt.
Budget at 80%
Three days left in the cycle.
Build failed
aura-svelte — 2 minutes ago
Tokens rebuilt.
Budget at 80%
Three days left in the cycle.
Build failed
aura-svelte — 2 minutes ago
Tokens rebuilt.

Code

index.html
<div class="aura-stack" style="--aura-dir:column;--aura-gap:var(--space-3)">
  <div role="status" class="aura-alert aura-alert--warning">
    <div class="aura-alert__body"><div class="aura-alert__title">Budget at 80%</div>Three days left in the cycle.</div>
  </div>
  <div role="status" class="aura-alert aura-alert--danger">
    <div class="aura-alert__body"><div class="aura-alert__title">Build failed</div>aura-svelte — 2 minutes ago</div>
  </div>
  <div role="status" class="aura-alert">
    <div class="aura-alert__body">Tokens rebuilt.</div>
  </div>
</div>
Demo.tsx
import { Alert, Stack } from '@ilomee/aura-react';

export default function Demo() {
  return (
    <Stack gap={3}>
      <Alert title="Budget at 80%" tone="warning">Three days left in the cycle.</Alert>
      <Alert tone="danger" title="Build failed">aura-svelte — 2 minutes ago</Alert>
      <Alert>Tokens rebuilt.</Alert>
    </Stack>
  );
}
Demo.vue
<script setup lang="ts">
import { Alert } from '@ilomee/aura-vue';
</script>

<template>
  <Alert tone="warning" title="Budget at 80%">Three days left in the cycle.</Alert>
</template>
Demo.svelte
<script lang="ts">
  import { Alert } from '@ilomee/aura-svelte';
</script>

<Alert tone="warning" title="Budget at 80%">Three days left in the cycle.</Alert>

Used as aura-alert.

demo.component.ts
import { AuraAlert } from '@ilomee/aura-angular';

@Component({
  standalone: true,
  imports: [AuraAlert],
  template: `<aura-alert tone="warning" title="Budget at 80%">Three days left in the cycle.</aura-alert>`,
})
export class DemoComponent {}

Props

Plain markup has no props — the classes below are the whole API. The four packages do nothing more than set these same classes for you.
NameTypeDefaultNotes
toneBadgeTone'info'
titlestring
urgentbooleanfalseSwitches role="status" to role="alert". Only for a message that appears in response to something.
withCloseButtonbooleanfalse
closeLabelstring'Dismiss'
onClose() => void
iconReactNode
NameTypeDefaultNotes
toneBadgeTone'info'
titlestring
urgentbooleanfalse
withCloseButtonbooleanfalse
closeLabelstring'Dismiss'
closeevent() => void
iconslotslot
NameTypeDefaultNotes
toneBadgeTone'info'
titlestring
urgentbooleanfalse
withCloseButtonbooleanfalse
closeLabelstring'Dismiss'
onclose() => void
iconslotSnippet
NameTypeDefaultNotes
toneBadgeTone'info'
titlestring
iconTemplateRef<unknown>React takes a node, Vue a slot and Svelte a snippet; a template is this package’s word for the same thing. Aura ships no icon set, so this is markup, not a name.
urgentbooleanfalse
withCloseButtonbooleanfalse
closeLabelstring'Dismiss'
closeeventEventEmitter<void>

Emitted classes

Every framework emits the same classes — that is what makes the four libraries look identical. You can use them directly, without any component library.

ClassRoleNotes
.aura-alertbaseRequired. A modifier does nothing without it.
.aura-alert--<tone>modifier
.aura-alert__titleelement
.aura-alert__bodyelement

Tokens and rules

components.css
rule
3px solid var(--aura-alert-color, var(--info))
wash
color-mix(var(--aura-alert-color) var(--aura-alert-tint, 8%))
default tone
info — a note, not a brand moment