Upgrade prompt
The panel shown when an allowance is nearly or wholly used: a usage meter, a headline for where the reader stands, what the next plan adds, and the way to it.

Plain Blade, no script, including its close control.
Use it
@if ($team->credits_used >= $team->credits_limit * 0.8)
<x-ds::upgrade-prompt
label="AI credits"
:used="$team->credits_used"
:limit="$team->credits_limit"
unit="credits"
plan="Pro"
:href="route('billing.upgrade', 'pro')"
:secondaryHref="route('pricing')"
:benefits="['2,000 credits a month', 'Longer documents', 'Priority support']"
>
You have used most of this month's credits.
</x-ds::upgrade-prompt>
@endif
Variants
card(default): a bordered panel, for the top of a page or a sidebar.inline: no box, for inside a section that already has one, such as a settings panel.gate: stands where locked content would be. A dimmed placeholder fills the space and the prompt sits over it, centred.
The gate never holds the locked content
@can('use', $feature)
<x-reports.builder />
@else
<x-ds::upgrade-prompt variant="gate" label="Reports" :used="3" :limit="3" plan="Pro" :href="route('billing')">
<x-slot:placeholder><x-ds::skeleton variant="block" size="lg" /></x-slot:placeholder>
Reports past three a month are on Pro.
</x-ds::upgrade-prompt>
@endcan
The content behind a gate is not rendered: you leave it out, as above.
Blurring real content is not a lock; the data is in the page source and in the
accessibility tree. The placeholder slot is for a picture of the feature, a
skeleton or a screenshot, and it is aria-hidden and inert. Without the slot
it is a few still bars.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
variant | card inline gate | card | See above. |
label | string | — | What is used up, as the meter's label. Required. |
used | number | — | How much has been used. Required. |
limit | number | — | The allowance. Required. |
unit | string | — | The noun after the numbers. |
warnAt | int | 80 | Percent of the limit at which the meter turns warning. |
plan | string | — | The plan to upgrade to: names the action "Upgrade to Pro". |
href | string | — | Where the upgrade happens. Draws the primary action. |
actionLabel | string | Upgrade to {plan}, or Upgrade | The primary action's words. |
secondaryHref | string | — | A second link. |
secondaryLabel | string | Compare plans | Its words. |
benefits | array of strings | [] | What the plan adds, each with a tick. |
nearTitle | string | You are close to your limit | Headline under the limit. |
atTitle | string | You have reached your limit | Headline at it. |
overTitle | string | You are over your limit | Headline past it. |
icon | string | sparkles | The mark beside the headline. |
dismissible | bool | false | A close control, for card and inline (never on a gate, which would leave a hole). |
| Slot | |
|---|---|
| default | A line under the headline. |
placeholder | With gate: the dimmed picture behind the prompt. |
States
The state comes from the numbers, the way usage meter colours its bar: over past the limit, at on it, and near anything under, since you show the prompt only once the reader is getting close. Near is warning; at and over are danger. Each has its own headline, so the words say it as well as the colour.
Dismissing
The ✕ is a plain handler, as alert's is: it works in a page with no
script, dispatches dismiss from the prompt, and removes it. To keep it away,
listen and remember it on the server:
<x-ds::upgrade-prompt … :dismissible="true" x-on:dismiss="$wire.snoozeUpgrade()" />
Accessibility
- It is a
sectionnamed by its headline, so it is listed among a screen reader's regions with its state in its name. - The meter is a
meterwith its value in words, over the limit included. - The gate's placeholder is
aria-hiddenandinert: nothing in it is read or reached.
Don't
- Don't show it under the threshold. A prompt on every page is an advert, and readers learn to skip it.
- Don't lock with CSS. Render the gate instead of the content.
- Don't hide the way out. The page around a gate should still work.
More in specs/upgrade-prompt.md.
From the package repo: edit this page on GitHub.