Skip to content

AisAlert ​

AisAlert highlights user messages. Alerts may contain error messages or other important data that should be brought to the user's attention. Use title, the default slot, and details to specify the alert's body.

Props ​

variant ​

The variant prop conveys the type of message being presented. The accepted values are: default, primary, secondary, info, success, warning, danger. The default value is default.

title ​

The title prop specifies featured text that appears at the top of the alert. See the default slot for details on specifying the alert's message.

details ​

The details prop accepts an array of strings, which will be shown as a bulleted list under the alert's message. If you plan to use the details slot, you can instead pass in an array of objects to build a custom detail list.

v-model ​

v-model drives an alert's visibility. v-model accepts a boolean and is required for dissmissible alerts. AisAlert maintains no internal state, so it depends on its v-model to capture update:modelValue events. See Vue's docs.

dismissible ​

The dismissible boolean prop specifies if the alert is closable. If true, a close button will appear in the alert's upper-righthand corner. The default value is false. Dismissible alerts must use v-model to drive the alert's visibility.

icon ​

The icon prop accepts either an FontAwesome object or a string specifying one our core icons. If no icon prop is specified, a variant default will be used.

noIcon ​

noIcon is a boolean prop. When it is true, the alert will only show an icon if one is explicitly specified with the icon prop. No default variant icon will be used.

transition ​

The transition boolean prop specifies if the alert will appear and disappear with a fade transition. The default value is true.

Slots ​

default ​

Use the default slot, the tag body, to specify the alert's primary message. The message will display between the tite and details if all three are specified. The slot props icon, hasIcon, and hasTitle are exposed to the slot if you want to build a custom layout in the body of the alert.

title ​

Use the title slot to customize the markup for the alert's title. The title prop is passed as a slot prop along with a hasTitle flag. The slot resides in a single-column grid with the default and details slot with a gap of gap-y-1.

details ​

Use the details slot to customize the markup for the alert's details array. The default implementation expects an array of strings and displays them in an unordered list. Using the details slot, developers could pass an array of object and create a more intricate detail list. The slot resides in a single-column grid with the default and details slot with a gap of gap-y-1.

icon ​

Use the icon slot to customize the presentation of the icon prop. The slot flexes with the title, body, details grid. This slot should be used sparingly, and it is most likely only needed to match customizations in the other slots.

Component Reference ​

Props ​

Property
Type(s)
Required
Default
Description
Deprecated
details
Array
[]
Array of strings that will appear as a bulleted list below the main message.
false
dismissLabel
String
'Close'
Value for the aria-label attribute on the dismiss button
false
dismissible
Boolean
false
When set, enables the close button
false
icon
Undefined
undefined
Optional header icon. Accepts either an object imported from the FontAwesome icon packs or a string specifying one of the preloaded, core icons
false
modelValue
Boolean
true
v-model controls the visibility of the alert
false
noIcon
Boolean
false
When noIcon is true, do not use the variant default icon
false
title
String
''
Bold text that appears at the top of the alert
false
transition
Boolean
true
When set to true, enables a transition on the component. Currently, fade is the only implemented transition.
false
variant
String
'default'
Applies one of the theme color variants to the component.
false

Slots ​

Name
Scoped
Description
default
Scoped slot for custom rending the content between the alert title and the alert details
details
Scoped slot for custom rending the alert details
icon
Scoped slot for custom rending the alert icon
title
Scoped slot for custom rending the alert title

Events ​

Event
Arguments
Description
update:modelValue