Personal project
Design system
Custom React components themed with CSS tokens, including a select and date picker built from scratch, with documentation for each one.
- React
- TypeScript
- CSS tokens
The problem
A portfolio, a dashboard and a restaurant website should each look like themselves, without three separate copies of every button, field and table to keep in step.
Design decisions
- Each site’s theme is a CSS class that sets tokens, so the components do not change between sites.
- There is no third-party component library underneath.
- The select and date picker have their own popups, which move to stay inside the window and work inside dialogs.
- Checkboxes are drawn over real inputs, so keyboards and forms still work.
- Every component has a documentation page with live examples. The example code shown is read from the file that runs.
Try it
- Switch the theme in the documentation and watch every component follow.
- Open a select near the bottom of the window.
- Move around the calendar with the arrow keys.
- Change the accent, shape and typeface on the Playground page.
Still to do
The custom controls have not yet been tested with a screen reader, in Safari or Firefox, or on a real phone. The date picker does not accept typed dates and shows US English only.
How it is built
React and TypeScript, with plain CSS for the components and tokens for theming. It runs inside this Next.js site, and popups use the browser’s popover support.