Skip to content

Notice Component

A notice/alert component is a user interface element that displays important messages or alerts to inform or warn users about specific events or actions.

Properties

NameTypeDefaultDescription
variant'success' | 'error' | 'info' | 'warning' | 'inverse''inverse'The variant of the notice. Defaults to inverse.
priority'high' | 'low''high'The priority of the notice. Defaults to high. Bolder colors are used with high priority whereas lighter colors are used for 'low' priority notices.
dismissablebooleanfalseIndicates whether the notice can be dismissed or not. When dismissable, the dismiss button is rendered and emits 'dismiss' event upon click.
undefinedstringundefinedundefined

Slots

NameDescription
defaultnotice text
actionsslot actions

CSS Parts

NameDescription
noticeThe root container of the notice component a div.
iconThe container of the icon, a span.
content-rootThe wrapper around title, message and actions, a div.
messageThe message element, a p.
titleThe title element, a p.
actionsThe actions slot, a slot.
dismissThe dismiss button, a button.

Check this link to learn how to use CSS parts for Notice Component.

CSS Properties

TokenDefaultDescription
--tap-notice-width100%The width of the notice component.
--tap-notice-heightautoThe height of the notice component.
--tap-notice-gap--tap-sys-spacing-5The default gap between horizontal items of the notice.
--tap-notice-radius--tap-sys-radius-3The default border radius of the notice.
--tap-notice-vertical-padding--tap-sys-spacing-6The default vertical padding of the notice.
--tap-notice-horizontal-padding--tap-sys-spacing-5The default horizontal padding of the notice.
--tap-font-family--tap-sys-font-familyThe default font used for tapsi web components.
--tap-notice-actions-margin-top--tap-sys-spacing-4The space between message and action buttons if there are any.
--tap-notice-title-font-size--tap-sys-typography-label-md-size-
--tap-notice-title-line-height--tap-sys-typography-label-md-height-
--tap-notice-title-font-weight--tap-sys-typography-label-md-weight-
--tap-notice-message-font-size--tap-sys-typography-label-sm-size-
--tap-notice-message-line-height--tap-sys-typography-label-sm-height-
--tap-notice-message-font-weight--tap-sys-typography-label-sm-weight-
--tap-notice-message-font-weight--tap-sys-typography-label-sm-weight-
--tap-notice-[variant]-[priority]-color-The text and icon color in the specified variant and high priority. The icon color in the specified variant and low priority.
--tap-notice-[variant]-[priority]-bg-color-The background color in the specified variant and priority.
--tap-notice-title-low-color--tap-sys-color-content-primaryThe color of the title in the low priority mode (overrides --tap-notice-[variant]-[priority]-color).
--tap-notice-message-low-color--tap-sys-color-content-secondaryThe color of the message in the low priority mode (overrides --tap-notice-[variant]-[priority]-color).
--tap-notice-dismiss-low-color--tap-sys-color-content-secondaryThe color of the dismiss button in the low priority mode (overrides --tap-notice-[variant]-[priority]-color).

Events

NameDescription
dismissFires when the dismiss button is clicked (if dismissable).