Components

Alert ​

Alerts draw attention to information that affects the current task. Choose a semantic variant for the message, then add a heading, actions, or expandable details only when they help someone respond.

Variants ​

Use neutral for supporting information without a status, info for contextual guidance, success for a completed action, warning for a condition that needs attention, and error for a failed or blocked action.

Appearances ​

Use appearance to change visual emphasis without changing the alert's meaning. accent is the default and adds a strong leading border. filled-outlined uses a quiet fill and border, filled removes the border, outlined removes the fill and uses a stronger variant-coloured border, and plain removes both.

Sizes ​

Use the default size for ordinary control-panel feedback. sm fits compact settings rows and secondary feedback, while lg gives an important alert more visual weight. The size scales the icon, type, padding, dismissal, details, copy controls, and default-sized action buttons together.

Details and Copying ​

Put secondary or technical information in the details slot so the primary message stays concise. Set copyable when the details need to be shared or retained elsewhere. The component adds a compact copy button with a subdued neutral colour inside the details area and copies the slot's plain text. Its icon changes to a check after success, the result is announced, and failures remain visibly explained.

Content in the actions slot belongs to the consumer. The alert scales default-sized Plugin Kit buttons with its size, but the button's own variant continues to control its appearance.

Use announce="polite" for asynchronous updates that can wait and announce="assertive" only for an urgent failure that interrupts the current task. Static alerts should keep the default announce="off" value.

Scrolling Details ​

Large diagnostic output scrolls once it reaches the details area's maximum height. The copy control remains inset within the scrolling content, so a native scrollbar only affects its alignment when one is present.

Icons and Dismissal ​

Each variant supplies an icon. Set hideIcon when the message doesn't need one, or provide an icon slot for a product-specific symbol.

Set dismissible only when hiding the alert won't conceal a condition that still blocks the task. The onPkDismiss event is cancelable, and the alert hides itself unless the event is prevented.

API ​

Slots ​

NameDescription
titleAlert heading. Takes precedence over the heading property.
iconCustom icon. The component supplies a variant icon by default.
(default)Alert message or other primary content.
actionsOptional primary alert actions.
detailsOptional content inside the collapsible details region.

Props ​

NameDescription
announceType PkAlertAnnouncement
Default off
appearanceVisual treatment, independent from the alert's semantic variant.
Type PkAlertAppearance
Default accent
copiedLabelType string
Default Details copied.
copyableType boolean
Default false
copyErrorLabelType string
Default Copy failed. Select the details and copy them manually.
copyLabelType string
Default Copy details
detailsLabelType string
Default Details
detailsOpenType boolean
Default false
dismissibleType boolean
Default false
dismissLabelType string
Default Dismiss
headingType string
hideIconType boolean
Default false
sizeOverall density, including typography, icons, spacing, details, and actions.
Type PkAlertSize
Default default
variantType PkAlertVariant
Default info

Methods ​

NameDescription
copyDetails()Copy the plain text assigned to the details slot.
dismiss()Request dismissal and hide the alert unless the event is prevented.
show()Show an alert hidden by dismiss().

Events ​

NameDescription
onPkCopyEmitted when the details are copied successfully.
onPkCopyErrorEmitted when the details cannot be copied.
onPkDismissEmitted before a dismissible alert hides. Prevent to keep it visible.

CSS Custom Properties ​

NameDescription
--pk-alert-accentAccent, title and icon colour.
--pk-alert-backgroundAlert background.
--pk-alert-body-colorPrimary content colour.
--pk-alert-borderAlert and divider border colour.
--pk-alert-colorAlert host colour.
--pk-alert-details-max-heightMaximum height of diagnostic details.
--pk-alert-paddingAlert inner padding.
--pk-alert-radiusAlert corner radius.
--pk-alert-title-colorHeading colour.
--pk-alert-title-sizeHeading font size.

CSS Parts ​

NameDescriptionCSS selector
actionsAlert actions wrapper.::part(actions)
baseAlert container.::part(base)
bodyDefault content wrapper.::part(body)
contentHeading and message wrapper.::part(content)
copy-buttonCopy-details button.::part(copy-button)
copy-statusCopy result status.::part(copy-status)
detailsCollapsible details element.::part(details)
details-contentDetails content wrapper.::part(details-content)
details-summaryDetails disclosure label.::part(details-summary)
dismiss-buttonDismiss button.::part(dismiss-button)
iconIcon wrapper.::part(icon)
noticeIcon, content and dismiss-button row.::part(notice)
titleAlert heading.::part(title)

Dependencies ​

This component registers the following elements when it loads.

NameDescription
pk-copy-buttonCompact copy-details action.
Edit this page
Last updated: Oct 7, 2026, 2:27 PM