Skip to contents

Create a Alert component

Usage

calcite_alert(...)

Arguments

...

named attributes passed to htmltools::tag()

Value

an object of class calcite_component which is a subclass of shiny.tag

Details

Alerts are meant to provide a way to communicate urgent or important information to users, frequently as a result of an action they took in your app. Alerts are positioned at the bottom of the page. Multiple opened alerts will be added to a queue, allowing users to dismiss them in the order they are provided.

Properties

The following properties are provided by this component:

NameAttributeDescriptionValuesReflects to Attribute
autoCloseauto-closeWhen true, the component closes automatically. Recommended for passive, non-blocking alerts.booleanTRUE
autoCloseDurationauto-close-durationSpecifies the duration before the component automatically closes - only use with autoClose."fast" | "medium" | "slow"TRUE
iconiconWhen true, shows a default recommended icon. Alternatively, pass a Calcite UI Icon name to display a specific icon.boolean | stringTRUE
iconFlipRtlicon-flip-rtlWhen true, the icon will be flipped when the element direction is right-to-left ("rtl").booleanTRUE
kindkindSpecifies the kind of the component, which will apply to top border and icon."brand" | "danger" | "info" | "success" | "warning"TRUE
labellabelSpecifies an accessible name for the component.stringFALSE
messageOverridesNAUse this property to override individual strings used by the component.Check API referenceFALSE
numberingSystemnumbering-systemSpecifies the Unicode numeral system used by the component for localization."arab" | "arabext" | "latn"TRUE
openopenWhen true, displays and positions the component.booleanTRUE
placementplacementSpecifies the placement of the component."bottom" | "bottom-end" | "bottom-start" | "top" | "top-end" | "top-start"TRUE
queuequeueSpecifies the ordering priority of the component when opened."immediate" | "last" | "next"TRUE
scalescaleSpecifies the size of the component."l" | "m" | "s"TRUE

Events

The following events are observed by shiny:

EventDescription
calciteAlertBeforeCloseFires when the component is requested to be closed and before the closing transition begins.
calciteAlertBeforeOpenFires when the component is added to the DOM but not rendered, and before the opening transition begins.
calciteAlertCloseFires when the component is closed and animation is complete.
calciteAlertOpenFires when the component is open and animation is complete.

Slots

The following slots are provided by this component:

SlotDescription
titleA slot for adding a title to the component.
messageA slot for adding main text to the component.
linkA slot for adding a calcite-action to take from the component such as: "undo", "try again", "link to page", etc.
actions-endA slot for adding calcite-actions to the end of the component. It is recommended to use two or fewer actions.

Examples

calcite_alert()
#> <calcite-alert></calcite-alert>