Salary Input

Salary Input is a copy-paste React component that stops monthly salary entered as yearly 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/salary-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

StopsMonthly salary entered as yearly

Was this component page useful?

How do I install Salary Input?

pnpm dlx shadcn@latest add @bollard/salary-input

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

How do I use Salary Input in React?

salary-input-usage.tsx
import { SalaryInput } from "@/components/ui/salary-input"

<SalaryInput label="Current CTC" defaultValue={{ text: "12", period: "year" }} />

What input mistakes does Salary Input catch?

  • Monthly figure entered as yearly, and the reverse
  • Bare "12" likely meant as 12 LPA (or 85 as 85k outside India)
  • An extra or missing zero against the expected range
  • Units written in the text (LPA, k, lakh, crore, million) overriding the period picker
  • Read-back per month and per year, in lakh/crore for INR

What props does Salary Input accept?

SalaryInput props
PropTypeDefault
label

Visible label.

string"Expected salary"
value

Controlled value.

SalaryValue—
defaultValue

Initial value when uncontrolled.

Partial<SalaryValue>—
onValueChange

Called with the value and the amount it means per year and per month (null while it isn't an amount).

(value: SalaryValue, amount: { yearly: number; monthly: number } | null) => void—
currency

ISO currency. INR reads back in lakh and crore with Indian digit grouping.

string"INR"
expectedRange

The yearly range expected for this role, e.g. [800000, 1400000]. Enables the extra-zero check.

[number, number]—
plausibleRange

Yearly range any salary in this currency falls in, used when there is no expectedRange. Defaults by currency; null turns the generic check off.

[number, number] | null—
delay

Pause in ms before warnings appear while typing. Leaving the field shows them at once.

number600
messages

Override any message or label.

Partial<typeof SALARY_MESSAGES>—

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

How is Salary Input accessible?

  • Visible <label> on the input; read-back and status linked via aria-describedby
  • Period picker is a roving-tabindex radiogroup with arrow keys
  • Status in a polite live region; dismiss has an aria-label
  • After a fix, focus returns to the input

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

What are the limitations and server boundaries?

  • Checks plausibility against the ranges you pass; it can't know the real offer
  • Parses common English and Indian shorthand only
  • Does not handle tax, CTC components or variable pay

What expensive mistakes does Salary Input stop?

Monthly salary entered as yearly

Also known as

salary · expected ctc · current ctc · lpa · lakh · job application · naukri · monthly salary

Field type

What dependencies does Salary Input require?

Salary Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameSalary Input
Registry identifier@bollard/salary-input
Install commandnpx shadcn@latest add @bollard/salary-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 Salary Input

How does Salary Input validate Indian financial identifiers?

Salary Input stops monthly salary entered as yearly. Complies with national standards for Monthly figure entered as yearly, and the reverse, Bare "12" likely meant as 12 LPA (or 85 as 85k outside India), An extra or missing zero against the expected range, Units written in the text (LPA, k, lakh, crore, million) overriding the period picker, Read-back per month and per year, in lakh/crore for INR. Limitation: verify salary-input with issuer gateway.

How do I install salary-input with shadcn?

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

What props customize Salary Input?

Salary Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `currency`. Configures salary, expected ctc, current ctc behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of salary-input?

Checks plausibility against the ranges you pass; it can't know the real offer. Parses common English and Indian shorthand only. Does not handle tax, CTC components or variable pay Server requirement: backend verification for salary-input.

How does Salary Input meet accessibility guidelines?

Visible <label> on the input; read-back and status linked via aria-describedby. Period picker is a roving-tabindex radiogroup with arrow keys. Status in a polite live region; dismiss has an aria-label. After a fix, focus returns to the input. Minimizes errors: salary monthly vs yearly, 12 lpa entered as 12.

Which components pair with Salary Input?