Skip to content

Notices provide inline contextual tips or advice to the user.

Overview

Notice provides information on page load and utilizes UI state colors to help convey meaning. Use Notice when required attention is low to moderate. Notice can provide a single action for the user, such as a Link in the Link slot along with a dismissal option. Notice is designed to be used sparingly and not in groups. Don't rely too heavily on Notice for critical messages as its styling is meant to be relatively unobtrusive.

Refer to Dialog or Alert when more immediate attention is needed.

Usage

  • Inline tip messaging
  • Advisory or warning messaging
  • Hints and other non-critical info

Sample

Best practices

While visually similar to Alert, Notice has distinct capabilities and intended use cases. It is positioned relatively within a parent element.

Comparison

NoticeThis component
Best for informative, contextually relevant information.
Can be open at page load, or displayed as a result of user action.
Can be persisted in the interface or made closable.
AlertAlternative
Best for ephemeral, workflow specific messaging.
Generally should not be open at page load.
Most often displayed as a result of user interaction.
DialogAlternative
Best for complex or narrative content that contains interactive elements or media.
Can at times be open at page load for introductory messaging.
Generally presented as a result of user invocation.

Recommendations

Correct Notice sparingly
Do use Notices sparingly, and for direct user attention regarding a workflow or interface.
Avoid Notice layouts groups
Avoid using Notices to represent items or entities in a group.

Accessibility

If using the Link slot, follow the Link accessibility guidance on unique link text.

Keyboard navigation

KeyFunction
TabMoves focus to the next focusable element. If the current focus is the last element, focus will exit the component.
Tab and ShiftMoves focus to previous focusable element. If the current focus is the first element, focus will exit the component.

Writing and copy

Correct Notice writing
Do prefer brevity in Notices. Be quick and specific with its message.
Avoid Notice writing
Avoid large amounts of copy in Notices, and avoid error codes if possible.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
appearanceappearanceSpecifies the appearance of the component.Extract<"transparent" | "outline-fill", Appearance>"outline-fill"
closableclosableWhen true, displays a close button in the component.booleanfalse
iconiconWhen true, shows a default recommended icon. Alternatively, pass a Calcite UI Icon name to display a specific icon.IconName | boolean
iconFlipRtlicon-flip-rtlWhen true, the icon will be flipped when the element direction is right-to-left ("rtl").booleanfalse
kindkindSpecifies the kind of the component, which will apply to the top border and icon.Extract<"brand" | "danger" | "info" | "success" | "warning" | "neutral", Kind>"brand"
messageOverridesOverrides individual strings used by the component.Record<string, unknown> | undefined
openopenWhen true, the component is visible.booleanfalse
scalescaleSpecifies the size of the component.Scale"m"
widthwidthSpecifies the width of the component. [Deprecated] The "half" value is deprecated, use "full" instead.Extract<Width, "auto" | "half" | "full">"auto"

Slots

NameDescription
titleA slot for adding a title.
messageA slot for adding a message.
actions-endA slot for adding calcite-actions to the end of the component. It is recommended to use two or less calcite-actions.

Styles

NameDescription
--calcite-notice-background-colorWhen appearance="outline-fill", specifies the component's background color.
--calcite-notice-border-colorWhen appearance="outline-fill", specifies the component's border color.
--calcite-notice-corner-radiusSpecifies the component's border radius.
--calcite-notice-close-background-colorSpecifies the background color of the component's close element.
--calcite-notice-close-background-color-hoverSpecifies the background color of the component's close element when hovered.
--calcite-notice-close-background-color-focus
deprecated Specifies the background color of the component's close element when hovered. Use --calcite-notice-close-background-color-hover instead.
--calcite-notice-close-background-color-pressSpecifies the background color of the component's close element when active.
--calcite-notice-close-icon-color-hoverSpecifies the icon color of the component's close element when hovered or active.
--calcite-notice-close-icon-colorSpecifies the icon color of the component's close element.
--calcite-notice-title-text-colorSpecifies the component's slotted "title" content text color.
--calcite-notice-content-text-colorSpecifies the component's slotted "message" content text color.
--calcite-notice-width
deprecated Specifies the component's width.
--calcite-notice-shadowSpecifies the component's shadow.

Events

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

Methods

NameDescriptionSignature
componentOnReadyCreate a promise that resolves once component is fully loaded.componentOnReady(): Promise<this>
setFocusSets focus on the component's first focusable element.setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.