### File

`packages/components/eui-alert/eui-alert.component.ts`

### Description

Alert displays a short, important message to attract the user's attention without interrupting its task.

### Implements

`OnInit`

### Metadata

changeDetection | `ChangeDetectionStrategy.OnPush`
HostDirectives | `BaseStatesDirective` Inputs : euiSuccess euiInfo euiWarning euiDanger euiVariant
selector | `div[euiAlert], eui-alert`
imports | `NgTemplateOutlet` `EUI_ICON_BUTTON` `EUI_ICON_STATE`
templateUrl | `./eui-alert.component.html`
styleUrl | `./eui-alert.scss`

### Index

###### Properties

- alertTitle
- baseStatesDirective
- role

###### Methods

- onCloseClick

###### Inputs

- e2eAttr
- isCloseable
- isFocusable
- isVisible

###### Outputs

- closeAlert
- isVisible

###### HostBindings

- attr.aria-describedby
- attr.data-e2e
- attr.role
- attr.tabindex
- class

###### Accessors

- cssClasses
- ariaDescribedBy
- tabindex
- e2eAttribute

### Inputs

e2eAttr
Default value : `'eui-alert'`
Used for end-to-end testing.

isCloseable
Default value : `false, { transform: booleanAttribute }`
Allows the alert to be closed by the user.

isFocusable
Default value : `false, { transform: booleanAttribute }`
Allows the alert to be focused by the user.

isVisible
Default value : `true`
Controls the visibility of the alert. Default: true

### Outputs

closeAlert
Type : `boolean`
Event emitted when the alert is closed.

isVisible
Controls the visibility of the alert. Default: true

### HostBindings

attr.aria-describedby
Type : `string`
Sets the `aria-describedby` attribute for the host element.

attr.data-e2e
Type : `string`
Sets the `data-e2e` attribute for the host element. It is used for end-to-end testing.

attr.role
Type : `string`
Default value : `'alert'`
Sets the `role` attribute for the host element.

attr.tabindex
Type : `string`
Sets the `tabindex` attribute for the host element.

class
Type : `string`

### Methods

onCloseClick
`onCloseClick()`
Hide the alert and emits the `closeAlert` event when the close button is clicked. Returns : `void`

### Properties

alertTitle
Type : `QueryList<EuiAlertTitleComponent>`
Decorators : `@ContentChild(undefined, {static: false})`
Content for the alert title given by `<eui-alert-title>`.

baseStatesDirective
Type : `unknown`
Default value : `inject(BaseStatesDirective)`

role
Type : `string`
Default value : `'alert'`
Decorators : `@HostBinding('attr.role')`
Sets the `role` attribute for the host element.

### Accessors

cssClasses
get `cssClasses()`
Computes and returns the CSS classes for the component based on its current state. Returns : `string`

ariaDescribedBy
get `ariaDescribedBy()`
Sets the `aria-describedby` attribute for the host element. Returns : `string`

tabindex
get `tabindex()`
Sets the `tabindex` attribute for the host element. Returns : `string`

e2eAttribute
get `e2eAttribute()`
Sets the `data-e2e` attribute for the host element. It is used for end-to-end testing. Returns : `string`

# results matching ""

# No results matching ""