Tax-Inclusive Input

Tax-Inclusive Input is a copy-paste React component that stops gst added twice to a price before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/tax-inclusive-input
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsGST added twice to a price

Was this component page useful?

How do I install Tax-Inclusive Input?

pnpm dlx shadcn@latest add @bollard/tax-inclusive-input

The files land in your project. They're yours to edit.

How do I use Tax-Inclusive Input in React?

tax-inclusive-input-usage.tsx
import { TaxInclusiveInput } from "@/components/ui/tax-inclusive-input"

<TaxInclusiveInput label="Plan price" defaultValue={{ amount: 1180, rate: 18, includesTax: false }} />

What input mistakes does Tax-Inclusive Input catch?

  • An "excludes tax" price that looks already taxed (divides back to a round number)
  • Switching mode that changed the total, with keep-the-total fix
  • Rates typed as a fraction (0.18), multiplier (1.18) or slipped digit (180)
  • Rates above 50%

What props does Tax-Inclusive Input accept?

TaxInclusiveInput props
PropTypeDefault
label

Visible label of the amount field.

string"Price"
value

Amount, rate and includes-tax flag (controlled).

TaxPrice—
defaultValue

Starting price when uncontrolled.

TaxPrice{ amount: null, rate: 18, includesTax: true }
onValueChange

Called with the price after every change.

(value: TaxPrice) => void—
currency

ISO currency code.

string"INR"
locale

Locale for money formatting.

string"en-IN"
taxName

"GST", "VAT", "sales tax".

string"GST"
rates

Rates that are normal where you sell; others get a gentle note. Pass [] to skip that check.

number[]GST_RATES
inclusiveReadback

Templates: {net}, {tax}, {gross}, {rate}, {taxName} and {amount} are filled in.

string"{gross} incl. {rate}% {taxName} = {net} + {tax}"
exclusiveReadback

Readback when the amount excludes tax.

string"{net} + {rate}% {taxName} ({tax}) = {gross}"
includesLabel

Label of the includes-tax option.

string"Includes {taxName}"
excludesLabel

Label of the excludes-tax option.

string"Excludes {taxName}"
alreadyTaxedText

Warning when an excludes-tax amount looks already taxed.

string"{amount} is exactly {net} + {rate}%. Is {taxName} alread…
switchedText

Warning when switching mode changed the total.

string"Switching changed the total from {before} to {gross}."
keepTotalLabel

Label of the keep-the-total fix.

string"Keep {before}"
useRateLabel

Label of the use-likely-rate fix.

string"Use {rate}%"
alreadyTaxedFixLabel

Label of the treat-as-inclusive fix.

string"Yes, it includes {taxName}"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Tax-Inclusive Input accessible?

  • Visible <label> on the amount; readback via aria-describedby
  • Rate input has an aria-label; includes/excludes is a radiogroup
  • Warnings and fixes in a polite live region
  • Total highlight respects reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Default rate list is India's main GST slabs (0, 5, 18, 40); special rates (e.g. 3% on gold, 0.25%) and tobacco still on old rates are not included
  • Rounds to the currency's minor unit; invoice rounding rules may differ
  • Does not decide which rate applies to an item

What validation rules apply to Tax-Inclusive Input?

Rules last verified:

Re-checked 2026-10-17 against PIB release 2164586 (8 Sep 2025): the 56th GST Council moved GST from four slabs (5/12/18/28%) to two main rates, 5% (merit) and 18% (standard), plus a 40% special rate for sin/luxury goods, effective 22 Sep 2025. The default list [0, 5, 18, 40] (0 = nil-rated) matches; special rates such as 3% on gold and 0.25% on rough diamonds, and tobacco items still on 28% plus cess, are not in it. Informational; check CBIC rate notifications for an item's rate. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Tax-Inclusive Input stop?

GST added twice to a price

Also known as

gst · tax inclusive · tax exclusive · mrp · price · invoice · vat · net gross

Field type

What dependencies does Tax-Inclusive Input require?

Tax-Inclusive Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameTax-Inclusive Input
Registry identifier@bollard/tax-inclusive-input
Install commandnpx shadcn@latest add @bollard/tax-inclusive-input
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Tax-Inclusive Input

How does Tax-Inclusive Input validate Indian financial identifiers?

Tax-Inclusive Input stops gST added twice to a price. Complies with national standards for An "excludes tax" price that looks already taxed (divides back to a round number), Switching mode that changed the total, with keep-the-total fix, Rates typed as a fraction (0.18), multiplier (1.18) or slipped digit (180), Rates above 50%. Limitation: verify tax-inclusive-input with issuer gateway.

How do I install tax-inclusive-input with shadcn?

Run `npx shadcn@latest add @bollard/tax-inclusive-input`. Sources added: registry/default/tax-inclusive-input/tax-inclusive-input.tsx. Package requirements: lucide-react.

What props customize Tax-Inclusive Input?

Tax-Inclusive Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `currency`. Configures gst, tax inclusive, tax exclusive behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of tax-inclusive-input?

Default rate list is India's main GST slabs (0, 5, 18, 40); special rates (e.g. 3% on gold, 0.25%) and tobacco still on old rates are not included. Rounds to the currency's minor unit; invoice rounding rules may differ. Does not decide which rate applies to an item Server requirement: backend verification for tax-inclusive-input.

How does Tax-Inclusive Input meet accessibility guidelines?

Visible <label> on the amount; readback via aria-describedby. Rate input has an aria-label; includes/excludes is a radiogroup. Warnings and fixes in a polite live region. Total highlight respects reduced motion. Minimizes errors: gst inclusive exclusive, tax added twice.

Which components pair with Tax-Inclusive Input?