Alert
Provide contextual feedback messages for typical user actions using the alert component.
Color Variants
Alerts are contextual feedback messages usable for any length of text, and can have an optional dismiss button. By default, alerts are set to have width: 100%, fully spanning the width of the parent container. For choosing the context of the alert, use the color property.
Size Variants
You’re able to use the size modifier to control the text and spacing size of your alerts, using one of the available sizes: sm, md, and lg.
Icon
It’s very common for alerts to have an associated icon to help the user understand the significance of the alert.
Content
Your alerts accept any kind of content, giving you the flexibility to create great looking contextual messages.
You can also add an icon to the <i-alert> component by providing an icon slot. The following example makes use of the bundled Inkline icons, but you can use any icon font that you like:
Dismissible
You can dismiss alerts using a combination of the provided dismissible property and v-model directive. The dismissible property will be used to show the dismiss icon. The v-model directive will show or hide the alert, resetting dismissed alerts when needed.
Whoa! Nicely done.
Configuration
Props
Use props to modify the component’s design and behavior.
- Property
sizeType'sm' | 'md' | 'lg'Default'md'Description The size variant of the alert - Property
colorType'info' | 'success' | 'warning' | 'danger'Default'info'Description The color variant of the alert - Property
modelValueTypeBooleanDefaulttrueDescription Used to show or hide a dismissible alert - Property
dismissibleTypeBooleanDefaultfalseDescription Shows a dismiss icon on the alert - Property
dismissAriaLabelTypeStringDefaultDismissDescription The aria-label to use for the dismiss button
Slots
Use slots to insert custom content into well-defined component locations.
- Property
defaultDescription Slot for default alert content - Property
iconDescription Slot for alert icon - Property
dismissDescription Slot for alert dismiss button
Events
Use events to react to something happening inside the component.
- Property
update:modelValueDescription Event emitted for setting the modelValue
CSS Variables
Read more about configuring Inkline’s Design System variables to update the look and feel of the component.
- Property
----backgroundValuecolor('info')Description The background of the alert component - Property
----border-top-colorValuecolor('info-60')Description The border top color of the alert component - Property
----border-right-colorValuecolor('info-60')Description The border right color of the alert component - Property
----border-bottom-colorValuecolor('info-60')Description The border bottom color of the alert component - Property
----border-left-colorValuecolor('info-60')Description The border left color of the alert component - Property
----border-colorValuevar(----border-top-color) var(----border-right-color) var(----border-bottom-color) var(----border-left-color)Description The border color of the alert component - Property
----border-styleValuevar(--border-style)Description The border style of the alert component - Property
----border-top-widthValuevar(--border-top-width)Description The border top width of the alert component - Property
----border-right-widthValuevar(--border-right-width)Description The border right width of the alert component - Property
----border-bottom-widthValuevar(--border-bottom-width)Description The border bottom width of the alert component - Property
----border-left-widthValuevar(--border-left-width)Description The border left width of the alert component - Property
----border-widthValuevar(----border-top-width) var(----border-right-width) var(----border-bottom-width) var(----border-left-width)Description The border width of the alert component - Property
----border-top-left-radiusValuevar(--border-top-left-radius)Description The border top left radius of the alert component - Property
----border-top-right-radiusValuevar(--border-top-right-radius)Description The border top right radius of the alert component - Property
----border-bottom-right-radiusValuevar(--border-bottom-right-radius)Description The border bottom right radius of the alert component - Property
----border-bottom-left-radiusValuevar(--border-bottom-left-radius)Description The border bottom left radius of the alert component - Property
----border-radiusValuevar(----border-top-left-radius) var(----border-top-right-radius) var(----border-bottom-right-radius) var(----border-bottom-left-radius)Description The border radius of the alert component - Property
----box-shadow-offset-xValuevar(--box-shadow-offset-x)Description The box shadow horizontal offset of the alert component - Property
----box-shadow-offset-yValuevar(--box-shadow-offset-y)Description The box shadow vertical offset of the alert component - Property
----box-shadow-blur-radiusValuevar(--box-shadow-blur-radius)Description The box shadow blur radius of the alert component - Property
----box-shadow-spread-radiusValuevar(--box-shadow-spread-radius)Description The box shadow spread radius of the alert component - Property
----box-shadow-colorValuevar(--box-shadow-color)Description The box shadow spread radius of the alert component - Property
----box-shadowValuevar(----box-shadow-offset-x) var(----box-shadow-offset-y) var(----box-shadow-blur-radius) var(----box-shadow-spread-radius) var(----box-shadow-color)Description The box shadow of the alert component - Property
----colorValuecontrast-color($color-info)Description The text color of the alert component - Property
----font-sizeValuefont-size()Description The font size of the alert component - Property
----font-weightValuefont-weight('normal')Description The font weight of the alert component - Property
----line-heightValuevar(--line-height)Description The line height of the alert component - Property
----padding-topValuevar(--padding-top)Description The padding top of the alert component - Property
----padding-rightValuevar(--padding-right)Description The padding right of the alert component - Property
----padding-bottomValuevar(--padding-bottom)Description The padding bottom of the alert component - Property
----padding-leftValuevar(--padding-left)Description The padding left of the alert component - Property
----paddingValuevar(----padding-top) var(----padding-right) var(----padding-bottom) var(----padding-left)Description The padding of the alert component - Property
----code--colorValuevar(----color)Description The code color of the alert component - Property
----code--backgroundValuecolor('info-60')Description The code background of the alert component - Property
----dismiss--marginValuevar(----padding-right)Description The margin of the alert component dismiss icon - Property
----dismiss--paddingValuecalc(var(----padding-top) / 2)Description The padding of the alert component dismiss icon - Property
----link--colorValuevar(----color)Description The link color of the alert component