Action Prompt
Tells users of an action they need to, should, or might want to take. Use the intent that matches the urgency — negative for essential tasks, warning for important ones, positive to convey success, and neutral to introduce features. Supports an optional avatar icon, subtitle, dismiss button, and one or two action buttons.
preview
props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | required | Headline text for the prompt. |
subtitle | string | — | Supporting body text below the title. Omit to hide. |
intent | 'negative' | 'positive' | 'warning' | 'neutral' | 'neutral' | Drives the background, text, and button colour scheme. |
avatar | boolean | true | Whether to show the avatar icon circle on the left. |
icon | string | 'ph-user' | Phosphor icon class for the avatar (e.g. 'ph-calendar'). Only the icon variant of avatar is used. |
dismissible | boolean | false | Whether to show the dismiss (×) button in the top-right. |
onDismiss | () => void | — | Called when the dismiss button is clicked. Use to remove the prompt from the UI. |
primaryAction | { label: string; onClick?: () => void } | — | Primary action button. Providing this alone shows a single-action layout. |
secondaryAction | { label: string; onClick?: () => void } | — | Secondary action button. Requires primaryAction — together they show a multiple-action layout. |
usage
Action prompts are contextual and direct. They should appear close to the relevant content — on the same screen, not in a modal. The intent must reflect real urgency. Don’t use negative for something that can wait, and don’t use warning when no action is strictly needed.
When to use
- To surface an essential or time-sensitive task the user hasn't completed
- To confirm a state has changed — e.g. an event going live
- To introduce a feature or action the user may not know about
- When a single, focused call to action is needed without a full modal
Do not use
- Use negative sparingly — until something is truly urgent, use warning instead
- Stack multiple action prompts of the same intent on a single screen
- Trigger a negative prompt for tasks that are optional or informational
- Use as a replacement for toast notifications or system-level alerts
intents
Choose the intent based on the consequence of the user ignoring the prompt — not simply whether the value is high or low. The hierarchy is: neutral (inform), positive (confirm success), warning (urge action), negative (prevent a critical failure).
types
The number of action buttons is determined by which action props you provide. Match the type to how much choice the user should have — fewer options keeps the prompt focused and increases the likelihood of the primary action being taken.
booleans
Three boolean props let you adapt the prompt to its context. The avatar adds visual identity and helps the prompt stand out. The subtitle gives space for explanation. Dismissible lets the user acknowledge and move on without taking action.
Avatar
Subtitle
Dismissible
onDismiss to remove the prompt from the UI.