mds components
mds:price
Money in Toman or Rial — separators, currency label and discount badge from one amount.
Grouping separators and the currency label, from one amount. These docs render the kit configured for English — Latin digits, Toman; the last section shows the Persian output a Persian-configured app gets by default.
<mds:price :amount="2500000" />
With an original price
Pass original and you get the strikethrough and the discount badge for free — the percentage is computed, not passed in.
<mds:price :amount="2500000" :original="3200000" size="lg" />
Currency
toman and rial render تومان / ریال in Persian mode and Toman / Rial in English mode, none drops the label, and any other string is used verbatim.
<div class="flex flex-wrap items-center gap-8">
<mds:price :amount="2500000" />
<mds:price :amount="890000" currency="none" />
<mds:price :amount="890000" currency="AED" />
</div>
Sizes
<div class="flex flex-wrap items-center gap-8">
<mds:price :amount="2500000" size="sm" />
<mds:price :amount="2500000" />
<mds:price :amount="2500000" size="lg" />
</div>
Decimals and no badge
<div class="flex flex-wrap items-center gap-8">
<mds:price :amount="1250.75" :decimals="2" />
<mds:price :amount="2500000" :original="3200000" :badge="false" />
</div>
Persian output
config('mds.persian_digits') — on by default in a real app, off in these docs — switches the digits, the ٬ separator and the currency label to Persian; :fa="true" does it for a single price. The @toman and @rial directives are Persian by definition — money inside a Persian sentence.
قیمت این کالا ۲٬۵۰۰٬۰۰۰ تومان است.
<div class="flex flex-col items-center gap-6">
<div class="flex flex-wrap items-center gap-8">
<mds:price :amount="2500000" :original="3200000" size="lg" :fa="true" currency="toman" />
<mds:price :amount="14500000" :fa="true" currency="rial" />
</div>
<flux:text>قیمت این کالا @toman(2500000) است.</flux:text>
</div>
Reference
mds:price
| Prop | Description |
|---|---|
| amount | The price. Default: 0. |
| original | Pre-discount price; adds the strikethrough and the badge. |
| currency | toman, rial (the Persian words), none, or a literal label. Default: config('mds.currency'). |
| decimals | Decimal places. Default: 0. |
| size | Options: sm, lg. |
| fa | Persian digits, separators and built-in labels. Default: config('mds.persian_digits'). |
| badge | Shows the discount badge when original is set. Default: true. |
@toman / @rial
Blade directives for a formatted amount inline, e.g. @toman($order->total). Persian digits and labels by definition — they exist for Persian sentences.