Skip to content

UsageMeter

Stable

How many credits are left, with an optional cost estimate, reset date and upgrade button.

Also known as quota meter, usage bar, progress bar

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

With an estimate

340 of 500 credits leftResets Nov 1

This will use about 12 credits.

Shows the cost before the person confirms an action.

When to use it

Shows how many credits are left and what the next action will cost, before it runs. It warns only when the person may need to act.

Made of: Remaining text · Reset time · Bar · Cost estimate · Warning text · Upgrade button

Use it for

  • Before a paid action, to show about how much it will use.
  • A plan's remaining allowance, with when it resets.
  • Offering an upgrade once credits run low.

Not for

Do and avoid

340 of 500 credits leftResets Nov 1

This will use about 12 credits.

Do. Shows what is left and about what the next step costs.
340 of 500 credits leftResets Nov 1
Running low on credits.
Avoid. Amber while most credits are left makes people worry for nothing.

Do

  • Show the estimate before the action runs.
  • Show when the allowance resets.
  • Offer the upgrade only when credits run low.

Avoid

  • Do not use amber while there is plenty left.
  • Do not hide retries that use up credits.
  • Do not give an exact estimate you cannot back up. Say about.

On a phone

  • The meter fills the width, with the amount on the left and the reset time on the right.
  • The warning and your upgrade action share a row that wraps. A button gets a 44px tap area by itself. If your upgrade action is a small link, give it the tap class.

Seen in products

  • Adobe shows generative credits, as its own FAQ describes.
  • Runway shows credit cost per second before generating. Gen-4 is 12 credits per second and Turbo is 5.
  • Notion limits complimentary AI responses and each retry counts.
  • GitHub Copilot coding-agent steering messages consume AI credits.
  • Replit confirms before paid actions.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started