Skip to contents

Create a Notice component

Usage

calcite_notice(...)

Arguments

...

named attributes passed to htmltools::tag()

Value

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

Details

Notices are intended to be used to present users with important-but-not-crucial contextual tips or copy. Because notices are displayed inline, a common use case is displaying them on page-load to present users with short hints or contextual copy. They are optionally closable - useful for keeping track of whether or not a user has closed the notice. You can also choose not to display a notice on page load and set the "active" attribute as needed to contextually provide inline messaging to users.

Properties

The following properties are provided by this component:

NameAttributeDescriptionValuesReflects to Attribute
closableclosableWhen true, a close button is added to the component.booleanTRUE
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
messageOverridesNAUse this property to override individual strings used by the component.Check API referenceFALSE
openopenWhen true, the component is visible.booleanTRUE
scalescaleSpecifies the size of the component."l" | "m" | "s"TRUE
widthwidthCheck API reference"auto" | "full" | "half"TRUE

Events

The following events are observed by shiny:

EventDescription
calciteNoticeBeforeCloseFires when the component is requested to be closed and before the closing transition begins.
calciteNoticeBeforeOpenFires when the component is added to the DOM but not rendered, and before the opening transition begins.
calciteNoticeCloseFires when the component is closed and animation is complete.
calciteNoticeOpenFires when the component is open and animation is complete.

Slots

The following slots are provided by this component:

SlotDescription
titleA slot for adding the title.
messageA slot for adding the message.
linkA slot for adding a calcite-action to take, 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 less actions.

Examples

calcite_notice()
#> <calcite-notice></calcite-notice>