I built a React component library that speaks Hindi, Gujarati and Tamil. Here's what I learned.
We build apps for India. Then we ship them in English. Not because users asked for it. Because every component library we reach for speaks English, and translating every button, date picker and error message is work nob
We build apps for India. Then we ship them in English.
Not because users asked for it. Because every component library we reach for speaks English, and translating every button, date picker and error message is work nobody budgets for.
So I built a library where Hindi, Gujarati and Tamil are built in. It's called Sparkwire, it's open source under MIT, and it just hit 1.0.
This isn't a feature tour. It's the seven things that surprised me while building it, with the code that fixed them.
phoenix-am
/
spark-ui
Accessible React component library: 45+ components on React Aria, themed with plain CSS variables, with Hindi, Gujarati and Tamil built in. Stable API since 1.0.
Sparkwire
Accessible React components with a live wire.
A complete, stable component library for React 18 and 19: forms, dates, data tables, charts and overlays,
built on React Aria, styled with plain CSS variables, and translated into four languages.
Documentation ยท Getting started ยท Components ยท Theme builder ยท Live demo ยท Changelog
Features
- Accessible by default. Keyboard support, focus management and screen-reader labels come built in. The complex widgets (date pickers, comboboxes, menus, tables) are built on React Aria, and every documented example is checked with axe in CI.
- 45+ components. Everything a product needs, from buttons and form fields to a full DataTable, charts, a command palette and ready-made page blocks.
-
Plain CSS, no runtime. Every design token is a
--spark-*CSS variable and every state is adata-*attribute. Nothing runs at render time, so it works in React Server Components, and a Tailwind preset isโฆ
1. Accessibility is mostly solved. Use the solution.
My first date picker was hand-rolled. It looked great and was useless with a keyboard: arrow keys did nothing, the screen reader announced "button" forty times, and focus vanished when the popup closed.
I threw it away and rebuilt the hard widgets (date pickers, comboboxes, menus, tables) on React Aria. It handles keyboard navigation, focus management and screen-reader announcements, and it's been tested against real assistive technology far more than anything I could build alone.
My job became the part React Aria leaves to you: how it looks, and how it reads in every language.
Lesson: don't compete with a team that has spent years on focus management. Spend your time where you can add something.
2. Translating the UI means translating what nobody sees
Translating visible labels is the easy half. The hard half is everything only a screen reader hears:
- "Previous month" and "Next month" on the calendar buttons
- "Select all rows" on a table checkbox
- "Dismiss" on an invisible button that closes a popover
- "Increase" and "Decrease" on a number field's stepper
React Aria ships strings for many languages, but not Hindi, Gujarati or Tamil. So every one of those labels had to be written, in four languages, and passed down to the right place.
Now it's one prop:
import { SparkProvider } from '@sparkwire/core';
<SparkProvider locale="hi-IN">
<App />
</SparkProvider>
And if a translation is wrong, or you need Marathi tomorrow, you override it:
<SparkProvider locale="mr-IN" messages={{ next: 'เคชเฅเคขเฅ', previous: 'เคฎเคพเคเฅ' }}>
Lesson: if a screen-reader user would hear it, it's part of your UI. Translate it.
3. hi-IN doesn't give you Hindi digits
This one caught me out. I set the locale to hi-IN, opened the date picker, and got 12/12/2026. Hindi labels, Latin digits.
That's correct behaviour: most Hindi speakers read Latin digits day to day, so Intl defaults to them. If you want Devanagari digits, you ask for them with a Unicode extension:
<SparkProvider locale="hi-IN-u-nu-deva"> // เฅงเฅจ/เฅงเฅจ/เฅจเฅฆเฅจเฅฌ
<SparkProvider locale="gu-IN-u-nu-gujr"> // เซงเซจ/เซงเซจ/เซจเซฆเซจเซฌ
<SparkProvider locale="ta-IN-u-nu-tamldec"> // เฏงเฏจ/เฏงเฏจ/เฏจเฏฆเฏจเฏฌ
Because every number in the library goes through Intl, pagination, dates and counters all follow along without any extra code.
Lesson: never format numbers or dates by hand. Let Intl do it, and let the locale string carry the choice.
4. Plain CSS variables beat a styling runtime
I wanted theming without a CSS-in-JS runtime, so it would work inside React Server Components and with Tailwind. Two rules made that possible:
- Every design token is a CSS variable.
- Every state is a
data-*attribute, not a class name computed in JavaScript.
So a rebrand is plain CSS:
:root {
--spark-brand-fill: #3af2ff;
--spark-radius-medium: 12px;
--spark-font: 'Inter', sans-serif;
}
And styling a state needs no JavaScript at all:
.sp-button[data-variant='outlined'] { border-width: 2px; }
Light, dark and system modes are just a different set of variables, switched with one attribute.
Lesson: if your styling needs JavaScript to run, every server component and every framework becomes your problem.
5. Give your animations an off switch
Sparkwire has a look I call "live wire": buttons throw small sparks when pressed, and a current runs along whatever is selected. Fun on a launch page. Exhausting in an admin panel someone uses eight hours a day.
So instead of one animation style, there's a dial:
<SparkProvider energy="calm"> // dashboards
<SparkProvider energy="electric"> // launch pages
<SparkProvider energy="off"> // no effects at all
And whatever the dial says, if the user's system asks for reduced motion, energy is forced to off. Users who get motion sick don't have to find a setting in your app.
Lesson: personality is a feature until it's in the way. Make it adjustable, and let the operating system have the last word.
6. Tests didn't find the worst bugs. A real app did.
I had hundreds of unit tests and cross-browser tests in Chromium, Firefox and WebKit, with axe checking every documented example. Everything was green.
Then I built a small ops console on top of the library, the kind of app someone would actually ship. It found five bugs the tests had missed:
- In light mode, the page background and scrollbars stayed dark, because only the app's wrapper switched theme, not
<html>. That failed contrast checks. - Some screen-reader labels were still in English in Hindi, Gujarati and Tamil: the table's select-all checkbox, the combobox's "Show suggestions" button, the number field's increase and decrease buttons.
- Every row checkbox in the table was announced as just "Select", so a screen-reader user couldn't tell rows apart.
- The sidebar was only as tall as its items, not the page.
- A progress bar at 99.5% said 100%.
None of them were exotic. They only show up when components meet a real layout, real data and a real screen reader.
Lesson: dogfood your library in an app that looks like your users' apps. A test suite only checks what you thought to check.
7. 1.0 is a promise, so make breaking changes loud first
Before freezing the API for 1.0, I renamed a few inconsistent props (one component used inputSize, everything else used size). Removing the old names outright would have broken people silently.
So in the last 0.x release, every deprecated prop logged a warning once, in development only, naming its replacement:
[Sparkwire] Textfield: `inputSize` is deprecated and will be removed in 1.0. Use `size`, like the other components.
Upgrade to the last 0.x, fix the warnings in your console, and 1.0 needs no other changes. Production builds stay silent.
Lesson: a deprecation nobody sees is just a surprise with a delay.
Try it
npm install @sparkwire/core
import '@sparkwire/core/styles.css';
import { Button } from '@sparkwire/core/button';
import { DatePicker } from '@sparkwire/core/date-picker';
export function Checkout() {
return (
<form>
<DatePicker label="Delivery date" presets={['today', 'tomorrow', '+7d']} />
<Button type="submit">Place order</Button>
</form>
);
}
Or copy a component's source into your project and own it:
npx sparkwire add date-picker
- Docs and live examples: https://phoenix-am.github.io/spark-ui/
- Live demo app: https://spark-ui-starter-exa-dh2q.bolt.host
- GitHub: https://github.com/phoenix-am/spark-ui
I'd love to hear from you in the comments:
- If you build for users outside the English-speaking world, how do you handle translations in your UI today?
- Which language should a component library support next?
And if the translations in Hindi, Gujarati or Tamil read wrong to you as a native speaker, please tell me. That's the feedback I can't get any other way.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.