Feedback

Alert

A static message with an optional icon, title, description and action.

Class nameTypeDescription
alertplf:alertComponentA message; neutral on its own
alert-bodyplf:alert-bodyPartThe icon and content, beside an action
alert-iconplf:alert-iconPartYour own SVG, in place of the color's icon; an icon class there doesn't need it
alert-contentplf:alert-contentPartThe title and description
alert-titleplf:alert-titlePartThe title
alert-descriptionplf:alert-descriptionPartThe description
alert-actionplf:alert-actionPartOne button or link
alert-infoplf:alert-infoColorInfo color
alert-successplf:alert-successColorSuccess color
alert-warningplf:alert-warningColorWarning color
alert-errorplf:alert-errorColorError color

Alert title

This is the alert description.

Alert adds no role: when you insert one after an event, add role="alert" for an urgent error or role="status" for routine feedback.

Info

This is an info alert.

Success

This is a success alert.

Warning

This is a warning alert.

Error

This is an error alert.

Color and icons only support the message, so write a title or description that states it on its own.

Preview only

Changes stay in this browser. Nothing is sent to a server.

Usage guide

Review the destination and permissions before publishing these changes

Check the destination and permissions before publishing changes.

Connection failed

The example service could not be reached. Your existing data is unchanged.

Disabled actions

An action with aria-disabled="true" stays focusable, so your code must ignore its activation.

Import complete

All 24 records were imported successfully. Export is unavailable in this preview.

Awaiting approval

The request is pending.

Alert title

This is the alert description.

React

Alert from @pelatform/react renders this markup from its props, and each part is a component of its own.

Prop Values Default
color info, success, warning, error Neutral

The parts:

Part Element
AlertBody A div with alert-body
AlertContent A div with alert-content
AlertTitle An h3 with alert-title, or h2 to h6 with level
AlertDescription A p with alert-description
AlertAction A button with alert-action; a link takes className="alert-action"

Other props are the element’s own, className and ref included.

CSS variables

Override on a root or on a single alert. On a root, --plf-alert-color and --plf-alert-border reach every variant: scope them to one, such as .alert-info (.plf\:alert-info with Prefixed CSS), or set the semantic colors, such as --plf-color-info-text, which the variant’s text follows, and --plf-color-info, which its border follows.

Variable Default
--plf-alert-bg Transparent; the elevated surface in a Toast
--plf-alert-color Text, or the variant’s text color such as --plf-color-info-text
--plf-alert-border --plf-color-border-subtle, or the variant’s border such as --plf-color-info-border
--plf-alert-radius Large radius (8px)
--plf-alert-padding Space 3 block, space 4 inline
--plf-alert-icon-size 1.25em
--plf-alert-action-bg, --plf-alert-action-color Transparent; the alert’s text color
--plf-alert-action-border --plf-color-input, or the variant’s border
--plf-alert-action-hover-bg Muted surface; a custom --plf-alert-action-bg stays on hover

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons