VAlert
TheVAlert component is used to convey important information to users through the use of contextual types, icons, and colors.
Usage
Alerts in their simplest form are a flat sheet of paper that displays a message.Alert Types
Thetype prop provides four default contextual alert styles: success, info, warning, and error.
When using the
type prop, the appropriate icon is automatically assigned unless overridden with the icon prop.Closable Alerts
Theclosable prop adds a close button to the end of the alert component.
Border
Theborder prop adds a simple border to one of the 4 sides of the alert. Accepts top, end, bottom, and start.
Prominent
Theprominent prop provides a more pronounced alert by increasing the height and applying a larger icon.
Custom Icon
You can customize the alert icon using theicon prop, or disable it entirely by setting icon to false.
Props
Specifies a contextual style. Automatically applies a corresponding icon unless overridden.
Specify a title text for the alert.
Specify body text for the alert.
Adds a close button to the end of the alert.
Change the default icon used for closable alerts.
Accessible label for the close button.
Designates a specific icon. Set to
false to disable the icon.Controls whether the alert is visible or hidden.
Displays a larger, more prominent alert with a bigger icon.
Puts a border on the alert. Accepts
true or a string specifying the side.Specifies the color of the border.
Applies specified color to the control.
Applies a distinct style to the component. Options include:
flat, elevated, tonal, outlined, text, plain.Adjusts the vertical spacing within the component.
Designates an elevation applied to the component between 0 and 24.
Designates the border-radius applied to the component.
Slots
default
The default Vue slot for alert content.
prepend
Adds an item to the prepend section of the alert.
title
Slot for the alert title.
text
Slot for the alert text content.
append
Adds an item to the append section of the alert.
close
Slot for customizing the close button.
Events
Emitted when the close button is clicked.
Emitted when the alert visibility changes.