Alert

An inline message about the thing the user is looking at.

<Alert.Root variant="warning">
	<WarningIcon />
	<Alert.Title>Report due soon</Alert.Title>
	<Alert.Description>Submit the report within 48 hours.</Alert.Description>
</Alert.Root>

Alert.Action and Alert.Close are optional slots the layout knows about, so a button or a dismiss control lands in the right place without wrapper markup.

API

Alert.Root

PropTypeDefault
variant"default" | "destructive" | "success" | "warning"Severity. destructive for an error the reader has to act on, warning for something that will bite later, success for a completed outcome; default is neutral information.
renderComponentRenderFn<HTMLProps, {}> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.

Plus every <div> prop. Source: alert/components/alert-root.tsx.

Alert.Action

PropTypeDefault
renderComponentRenderFn<HTMLProps, {}> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.

Plus every <div> prop. Source: alert/components/alert-action.tsx.

Alert.Close

PropTypeDefault
renderComponentRenderFn<HTMLProps, {}> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.

Plus every <button> prop. Source: alert/components/alert-close.tsx.

Alert.Description

PropTypeDefault
renderComponentRenderFn<HTMLProps, {}> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.

Plus every <div> prop. Source: alert/components/alert-description.tsx.

Alert.Title

PropTypeDefault
renderComponentRenderFn<HTMLProps, {}> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.

Plus every <div> prop. Source: alert/components/alert-title.tsx.