portfolio :: blog
← Back to articles

Why I built a component library before building my systems

November 23, 2026 · 7 min read

l22 DataGrid: table with virtualized rows and columns, tags, statuses and inline editing, in dark mode

Every time I started a new application, the first few days went into deciding how a button looked, what color an invalid field was, what happened when you opened a calendar. And every time I decided a little differently.

So, before moving on to more applications, I built a component library: l22, for SolidJS and MIT-licensed. It isn't public yet, but it will be soon. Here I explain why it seemed like a good idea, what I borrowed from others and what it cost me.

The problem: arguing about the same things every time

At my old office we sometimes argued about trivial matters: which template to use, how to lay out the fields of a form, whether something should go in a modal or not. They were reasonable discussions, but they came back in every project and ended in slightly different answers.

A component library aims to have those decisions made before the system is built. The ones that aren't, once resolved, get added to the library and carry over to later projects. Each discussion happens only once.

Always using the same toolkit has another advantage: improvements reach every system. If I fix a detail in the date picker or improve the table, every application receives it without me going through them one by one.

The design systems I'm drawn to

l22 doesn't try to be a complete design system, but a component library. Even so, before building it I looked at plenty of other people's systems. Almost all the ones I like serve work software, where the screen is used for hours and there's a lot of information.

  • Blueprint, version 3. Serious and built for data interfaces. It isn't afraid of density.
  • The tables from the first version of Material. They made it clear how a data table should look: tidy, readable and free of decoration that gets in the way.
  • ADG, Atlassian's design system. Very well solved, with one big drawback: it can only be used inside Atlassian products. I once asked in the forums and the code was generally Apache 2, but the look and feel was subject only to the previous rule.
  • Linear's. My favorite, and to me one of the best there is. It shows a lot of information without overloading the screen: dense and simple at once, which is hard because you usually get one at the expense of the other.

From all of them I kept one question: how do you show a lot of information and still make it understandable at first glance? I keep it in mind every time I adjust a row height or the spacing of a cell.

Where the look came from

I didn't want to invent a style from scratch. I'm a programmer, not a designer, and I'm better at recognizing something well made than at creating it. l22's look starts from beautiful-ui: its color tokens, its thin-line shadows, the pill-shaped button, the tabs as a segmented control and the menu with a single hover layer that slides between options.

To reproduce that look and feel I used an artificial intelligence agent, which took care of the most mechanical part: reading how each detail was solved and carrying it over to Solid components. I didn't accept that first result as good: I adapted it to my needs and fixed every relevant aspect, component by component, until it looked and behaved the way I wanted.

The goal is for that fidelity to reach everything: the DataGrid tries to mirror beautiful-ui's look and feel perfectly, and so do the flow chart, the cards, the buttons and the rest of the components.

The hard part: the grid and the date picker

A button takes an afternoon. A table with thousands of rows and a date picker that really works are another matter, and for those I didn't want to reinvent anything: I based them on svgrid, an MIT-licensed library for Svelte.

  • DataGrid. It follows SvGrid's API and ports its main ideas: row and column virtualization, cell selection by ranges and merged cells. It also adds inline editing, pinned columns, resizing and tree mode.
  • DatePicker. Its core is ported from svgrid's: a masked field, minimum and maximum limits, token-based formatting and configurable locale. The calendar and the time picker sit on top.
  • Scrollbar. It comes from svgrid's sv-grid-scrollbar.

With dates I have a clear preference: the Windows calendar's mode, where a click on the month opens the list of months and a click on the year opens the list of years. Some pickers you usually find in libraries like shadcn only give you buttons to move around the calendar, and getting to another year means moving like a savage, month by month. l22's calendar follows the Windows calendar's mode: clicking the title opens the list of months and, from there, the list of years.

Note: the date picker I find especially appealing is Vaadin's, because it moves the selection with scroll. Porting it takes more work, but it will probably be available in the date picker as a configurable mode.

The migration from Svelte to SolidJS was also done by an artificial intelligence agent. There were points to fix, but it was relatively accurate, largely because svgrid's logic was decoupled from Svelte. What had to be rewritten was mostly the reactivity and the markup.

What it's built on

For accessible behavior (focus, keyboard, ARIA roles) I used Kobalte, which provides the unstyled parts. It's what I least wanted to write myself: it's easy to get wrong and hard to notice. The styles are my own.

There are about thirty components: buttons, forms, navigation, popups, the grid, the calendar, a flow chart. The logic is covered by Vitest tests: more than two hundred.

Cost vs. benefit

It was time I didn't spend on any specific application, and there's always the suspicion that you're sharpening the axe instead of chopping. To stay on track, I set myself a rule: nothing goes into the library unless a real screen needs it.

One of the reasons was to bring together in one place what I liked from different projects: the look in one, the grid and the calendar in another, almost always for a stack different from mine. There are still many things I'd like to bring over.

I don't know yet whether the balance will come out in my favor. I'll know when I build the third or fourth application on top of it. If not, I'll have learned quite a lot about grids and calendars, which is not nothing.

When will it be public?

l22 isn't public yet. It will be in the next few weeks, after an exhaustive review and polishing the DataGrid's performance, until the Solid implementation covers all the features of the Svelte version and reaches similar performance.

Credits

l22 exists thanks to the work of others: the look is from beautiful-ui, and a good part of the grid, the date picker and the scrollbar come from svgrid. While l22 gets here, take a look at their original projects too.

Your time: 10:14 PM|My time: 05:14 PM
© CStffx