Upgrade promptPro
Shown when an allowance runs out: how much was used, what Pro costs with a monthly or annual toggle, three things it adds (with the logos of the models it mentions), and a choice of Upgrade or Maybe later, every state the same size.
oxyn add upgrade-promptYou've used all 50 AI credits
Upgrade to Pro to keep going, or wait until Dec 1 for a fresh 50.
$192 billed yearly · save 20%
- 2,000 AI credits every month
- Claude Opus 4.1 and GPT-5 in every chat
- Image generation with Gemini
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Turn a hit limit into a clear choice: what was used, what the next plan costs and unlocks, upgrade now or later.
When not to use
- Replays a multi-agent run on one clock: use Agent timeline instead.
- One model at a glance: use Model card instead.
- A small automation on a single rail: use AI workflow instead.
Installation
Upgrade prompt is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add upgrade-promptUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Limit
50 of 50 AI credits, yearly billing.
You've used all 50 AI credits
Upgrade to Pro to keep going, or wait until Dec 1 for a fresh 50.
$192 billed yearly · save 20%
- 2,000 AI credits every month
- Claude Opus 4.1 and GPT-5 in every chat
- Image generation with Gemini
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Under
38 of 50, monthly (Oxyn extra).
You've used 38 of 50 AI credits
Upgrade to Pro to keep going, or wait until Dec 1 for a fresh 50.
Billed monthly · cancel anytime
- 2,000 AI credits every month
- Claude Opus 4.1 and GPT-5 in every chat
- Image generation with Gemini
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Seats
All 3 seats used, card declined (Oxyn extra).
You've used all 3 seats
Upgrade to Pro to keep going, or wait until Dec 1 for a fresh 3.
$192 billed yearly · save 20%
- 2,000 AI credits every month
- Claude Opus 4.1 and GPT-5 in every chat
- Image generation with Gemini
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
UpgradePrompt
| Prop | Type | Default | Description |
|---|---|---|---|
nowrequired | ClockMs | — | Host clock. |
used | u64 | 50 | Used. |
limit | u64 | 50 | Current limit. |
unit | &'static str | "AI credits" | What is counted, plural. |
yearly | bool | true | Start on yearly billing. |
fail | bool | Default::default() | The card is declined (error scenario). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | The billing switch, Maybe later, Upgrade (or Continue, See Pro again) |
| ←or→ | Monthly or yearly on the billing switch |
| EnterorSpace | Press the focused button |
Accessibility
- A named region with its own heading, which suits a modal or popover.
- The allowance bar is a meter that speaks its value in words, e.g. all 50 credits spent.
- Limit reached and credits left are an icon and words; upgrades and snoozes are announced.
From the spec
A labelled section with a heading; the usage bar is role meter with a value text; billing is a radio group with arrow keys; results are announced. Every action returns the line the polite live region announces. The focus outline shows only for keyboard focus.
Motion & interaction
The price rolls when billing switches; the meter refills to the new limit after upgrading; every state shares one footprint so the card never jumps.
Timing
Everything on screen is derived from the host clock now (no timers in the component), so playback, tests and the GPUI view agree.
| Transition | Duration | Easing |
|---|---|---|
| Upgrade | 1200 ms | — |
| Price roll | 200 ms | ease-out |
| Meter | 240 ms | ease-out |
Reduced motion: loops and travel stop; each state shows its end pose and its words.
Responsive behaviour
- Fluid up to 440 px; the billing switch wraps under the price when narrow.
- Buttons stay side by side: Maybe later at its width, Upgrade filling the rest.
Edge cases (spec)
Up to 440 px; the billing switch wraps under the price when narrow; feature lines stay single-line with an ellipsis; buttons stay side by side. Checked at 1440, 768 and 390 px in light and dark with no text overlap. Chrome is monochrome grey; colour is semantic only (success, warning, danger, info) plus the official coloured brand and model marks.
Notes for AI
- Import
UpgradePromptfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
AiKitViewinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.