Alert

Use <vara-alert> for notes, guidance, warnings, and status feedback. It is static by default; set role="status" or role="alert" only for content that changes after the page loads.

Usage

<vara-alert
  title="Heads up"
  description="Your changes have not been saved yet."
  color="warning"
/>

Preview

Props

PropTypeDefaultDescription
titlestring""Bold heading text.
descriptionstring""Supporting description.
colorstring"neutral"One of: neutral, info, success, warning, error.
iconstringautoOverride the icon associated with the color.
rolestring""Optional live-region role: status or alert.
heading_levelstring"3"Semantic title level: 3 or 4.
classstring""Additional CSS classes.

The description prop takes precedence over the paired body. If you omit it, the component renders its inner content instead.

Colors

Custom icon

Pass any icon name from the bundled icon set to replace the default one:

<vara-alert
  title="Deployment finished"
  description="The latest build is now live."
  icon="rocket"
  color="success"
/>

Richer content

For more than a title and a description, use a paired tag. Its body is rendered as Markdown before it reaches the component:

<vara-alert title="Before you continue" color="info">
  Make sure you have read the [introduction](/docs/). If you already have an
  account, you can **skip this step**.
</vara-alert>