UiAlert

An inline message banner.

Contents

A coloured message block with an optional icon and border, in three sizes. Put the message in the default slot.

Examples

Colours

Five colours: red, amber, green, blue and gray, each with an icon and border.

<div class="flex flex-col gap-3">
  <UiAlert color="green" icon="mdi:check-circle-outline" bordered>Saved successfully.</UiAlert>
  <UiAlert color="amber" icon="mdi:alert-outline" bordered>Your trial ends soon.</UiAlert>
  <UiAlert color="red" icon="mdi:close-circle-outline" bordered>Something went wrong.</UiAlert>
  <UiAlert color="blue" icon="mdi:information-outline" bordered>A neutral note.</UiAlert>
  <UiAlert color="gray" icon="mdi:information-outline" bordered>Just so you know.</UiAlert>
</div>

Sizes and structured content

Three sizes (xs, sm, md); the default slot accepts multi-line, structured content.

<div class="flex flex-col gap-3">
  <UiAlert color="amber" icon="mdi:alert-outline" bordered size="md">
    <p class="font-semibold">This action cannot be undone</p>
    <p>Deleting the project removes every file it contains.</p>
  </UiAlert>
  <UiAlert color="red" size="xs">Compact xs alert</UiAlert>
</div>

Props

NameTypeDefaultDescription
colorstring'red'Semantic colour. redambergreenbluegray
iconstring''Leading MDI icon.
borderedbooleanfalseAdd a border.
sizestring'sm'Padding and text size. xssmmd

Slots

SlotDescription
defaultAlert content.
iconCustom icon element (replaces the icon prop).