BlogPlaygroundOne

VAlert API


Props
name
type
default
boolean | 'top' | 'end' | 'bottom' | 'start'
false

Adds a colored border to the component.

string
undefined

Specifies the color of the border. Only used in combination with border prop. Accepts any color value.

boolean
false

Adds a close icon that can hide the alert.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
'$close'

Change the default icon used for closable alerts.

string
'$vuetify.close'

Text used for aria-label on closable alerts. Can also be customized globally in Internationalization.

string
undefined

Applies specified color to the control - supports utility colors with or without text- prefix (for example success, purple or text-purple) or CSS color (#033 or rgba(255, 0, 0, 0.5)). Find a list of built-in classes on the colors page.

'default' | 'comfortable' | 'compact'
'default'

Adjusts the vertical height used by the component.

string | number
undefined

Designates an elevation applied to the component between 0 and 5. You can find more information on the elevation page.

string | number
undefined

Sets the height for the component.

  | false
  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
null

Apply a specific icon using the v-icon component.

string | number
undefined

The specific size of the icon, can use named sizes.

['default' | 'small' | 'x-small' | 'large' | 'x-large', number][]
[
  ['x-small', 10],
  ['small', 16],
  ['default', 24],
  ['large', 28],
  ['x-large', 32]
]

An array of tuples that define the icon sizes for each named size.

Anchor
undefined

Specifies the component’s location. Can combine by using a space separated string.

string | number
undefined

Sets the maximum height for the component.

string | number
undefined

Sets the maximum width for the component.

string | number
undefined

Sets the minimum height for the component.

string | number
undefined

Sets the minimum width for the component.

boolean
true

Controls whether the component is visible or hidden.

'fixed' | 'static' | 'relative' | 'absolute' | 'sticky'
undefined

Sets the position for the component.

boolean
false

Displays a larger vertically centered icon to draw more attention.

string | number | boolean
undefined

Designates the border-radius applied to the component. This can be 0, xs, sm, true, lg, xl, pill, circle, and shaped. Find more information on available border radius classes on the Border Radius page.

string | (new () => any) | FunctionalComponent
'div'

Specify a custom tag used on the root element.

string
undefined

Specify content text for the component.

string
undefined

Specify a theme for this component and all of its children.

boolean
false

Removes the component’s border-radius.

string
undefined

Specify a title text for the component.

'success' | 'info' | 'warning' | 'error'
undefined

Create a specialized alert that uses a contextual color and has a pre-defined icon.

'text' | 'flat' | 'elevated' | 'tonal' | 'outlined' | 'plain'
'flat'

Applies a distinct style to the component.

string | number
undefined

Sets the width for the component.

Events
name
type
[MouseEvent]

Emitted when close icon is clicked.

[boolean]

Event that is emitted when the component’s model changes.

Slots
never
{ props: Record<string, any> }
never
never
never
never

Slot for icon at end of alert.

Slot for icon used in dismissible prop.

The default Vue slot.

Slot for icon at beginning of alert.

Slot for the component’s text content.

Slot for the component’s title content.

SASS Variables
name
default
16px
16px
rgb(var(--v-theme-surface-light))
(
  $alert-border-color,
  $alert-border-style,
  $alert-border-width,
  $alert-border-thin-width
)
currentColor
.38
settings.$border-radius-root
settings.$border-style-root
8px
0
tools.theme-color('on-surface-light', var(--v-high-emphasis-opacity))
('default': 0, 'comfortable': -1, 'compact': -2)
1
16px
.62
.2s opacity settings.$standard-easing
absolute fixed sticky
1.75rem
16px
1.35
tools.map-deep-get(settings.$typography, 'headline-small', 'size')
tools.map-deep-get(settings.$typography, 'headline-small', 'weight')
auto
tools.map-deep-get(settings.$typography, 'headline-small', 'letter-spacing')
1.75rem
normal
none
normal
break-word
(
  $alert-background,
  $alert-color,
  $alert-elevation,
  $alert-plain-opacity,
  'v-alert'
)