Data JS behaviour

Usage card

A usage card with a segmented bar that fills segment by segment; past 75% the percentage turns warning, past 90% danger — and the upgrade button is slot-friendly.

Real scenarios

The component as it is used in a product — not a specimen grid.

Storage on the Pro plan

The bar fills segment by segment as the card scrolls in; at 74% the percentage is still calm — one more upload and it turns warning.

Storage

Pro

7.4 GB of 10.0 GB used 74%

  • Documents 3.2 GB 32%
  • Voice notes 2.1 GB 21%
  • Images 1.4 GB 14%
  • Embeddings 0.7 GB 7%

Model tokens, past the line

93% used: the percentage reads danger and the slot button carries a live wire:click with a spinner while it works.

Model tokens

Growth

4.66 M of 5.00 M used 93%

  • Replies 2.90 M 58%
  • Summaries 1.10 M 22%
  • Translations 0.66 M 13%

93% used: agents pause at 100%

Important props

Important props
Prop Type Default What it does
limit / used / unit / decimals number 100 / null / null / 0 The cap, the used amount (the categories’ sum by default), the unit and the fraction digits.
categories array [] ['Label' => value] or a list of ['label', 'value'] — each category a coloured share of the bar.
plan / note / action string / string / array null The plan name, a note (like the reset date) and the action ['label' => …, 'href' => …].
slot:actions slot — Replaces the button — say a Livewire button with wire:click.

Snippet

<x-nx::usage-card title="فضای ذخیره" plan="پرو" :limit="10" unit="GB" :decimals="1"
    :categories="['اسناد' => 3.2, 'یادداشت‌های صوتی' => 2.1, 'تصویرها' => 1.4]"
    :action="['label' => 'ارتقای پلن', 'href' => '/billing']" />