Skip to content
RefineUI

Alert

Prominent message communicating status or warning.

Overview

Machine-readable contract from Component Spec.

component: alertexport: Alertversion: 1recipe: alerttokens.visual: alertattributes: data-refineui=alert, data-variant=variant

Anatomy

Partdata-refineui
rootalert
iconalert-icon
contentalert-content
rowalert-row
bodyalert-body
titlealert-title
descriptionalert-description
actionsalert-actions
actionalert-action
closealert-close

Variants

AxisValues
variantdefault, info, success, warning, danger, custom

States

ScopeCategoryValues
componentpseudofocus-visible
componentenvironmentforced-colors, dir, prefers-contrast
alertpseudofocus-visible

Accessibility

SlotElementRole
alertdivalert

Focus

SectionPropertyValue
visualrequiredtrue
visualselector:focus-visible

Layout

PropertyValue
directionlogical
rtltrue

Variant

Select a recipe variant — preview and Recipe → Tokens update together.

Recipe → Tokens

Slot bindings for variant="info" — declared in alert.recipe.ts.

SlotVariantPropertyTraceSemanticLight → foundationDark → foundationRecipe class
rootbackgroundalert.backgroundbackgroundPrimaryneutralWhiteneutral900bg-refineui-alias-background-primary
rootborderalert.borderborderDefaultneutral300neutral650border-refineui-alias-border-default
iconinfoforegroundsemantic.foregroundInfoforegroundInfoblue700blue200text-refineui-alias-foreground-info
titleinfoforegroundsemantic.foregroundInfoforegroundInfoblue700blue200text-refineui-alias-foreground-info
descriptioninfoforegroundsemantic.backgroundInfobackgroundInfoblue500blue500text-refineui-alias-background-info

Component token trace

All paths in token-trace-v2.json prefixed with alert.

TraceSemanticLight foundationDark foundationLightDark
alert.accent.defaultforegroundPrimaryprimaryBlackneutralWhite#212121#FFFFFF
alert.backgroundbackgroundPrimaryneutralWhiteneutral900#FFFFFF#1A1A1A
alert.borderborderDefaultneutral300neutral650#DBDBDB#5B5B5B
alert.description.defaultforegroundBrandprimaryBlackprimaryGray#212121#D4D4D4
alert.titleforegroundPrimaryprimaryBlackneutralWhite#212121#FFFFFF
npm install @refineui/react @refineui/tokens
import {
Alert,
AlertIcon,
AlertRow,
AlertBody,
AlertTitle,
AlertDescription,
AlertClose,
AlertActions,
AlertAction,
} from "@refineui/react";
<Alert variant="warning">
<AlertRow>
<AlertIcon />
<AlertBody>
<AlertTitle>Warning</AlertTitle>
<AlertDescription>Review before continuing.</AlertDescription>
</AlertBody>
<AlertClose type="button" />
</AlertRow>
<AlertActions>
<AlertAction type="button">Review</AlertAction>
</AlertActions>
</Alert>

Contract source: packages/react/spec/components/alert.json — rendered by SpecRenderer above.

Token trace source: packages/react/dist/spec/token-trace-v2.json + packages/tokens/dist/spec/trace-v2.json.