Each page of this documentation covers one component of @synertech/ui: what it is for, implementation examples ready to copy, then its complete API reference — props, defaults, hooks, functions, constants and exported types.
The API reference is generated from the TypeScript source code on every deployment, and the examples are files checked by the compiler: what you read here is what the published version accepts. To play with a component live, every page links to its Storybook story.
Installation
pnpm add @synertech/ui
The package is published on the public npm registry: no .npmrc or token to set up. React 18 or later (react and react-dom) is required as a peer dependency.
Writing with a code assistant? One command gives Claude Code the library’s usage guide, and the same file serves the other assistants: see Code assistants.
Styles
The library ships its compiled stylesheet. Import it once, in the application's entry point (app/layout.tsx with Next.js):
import"@synertech/ui/styles.css";
That sheet carries Tailwind's preflight, the reset that applies to the whole page and not only to the components: margins and paddings to zero, box-sizing: border-box, headings, lists and images stripped of the browser's styles, buttons and fields inheriting the font. The components are drawn on it.
An application that compiles Tailwind itself (@import "tailwindcss" in its stylesheet) already has it. A second copy, loaded after its stylesheet in the same base layer, undoes what it wrote there: a heading size, a link colour. It imports the same sheet without the reset instead:
import"@synertech/ui/styles-no-preflight.css";
Only on a page that has the preflight. Without it a button takes the browser's grey background and border, a field its own font, every box its own sizing.
The application's base rules reach the components where they leave an element as it is: a link the library does not underline takes the underline the application gives links.
Brand colour
A primary button, a checked box, a selected row, an active tab, a focus ring, a link: everything the components paint in the colour of the application reads one ramp of CSS variables, --color-synertech-primary-50 to -950. Out of the box it is Tailwind's blue. Redefine it and the whole kit follows — no prop, no component to wrap:
:root {
--color-synertech-primary-50: #f5f3ff;
--color-synertech-primary-100: #ede9fe;
--color-synertech-primary-200: #ddd6fe;
--color-synertech-primary-300: #c4b5fd;
--color-synertech-primary-400: #a78bfa;
--color-synertech-primary-500: #8b5cf6;
--color-synertech-primary-600: #7c3aed; /* the fill, and text on a light page */
--color-synertech-primary-700: #6d28d9; /* the fill under the pointer */
--color-synertech-primary-800: #5b21b6;
--color-synertech-primary-900: #4c1d95;
--color-synertech-primary-950: #2e1065;
/* What is written on the 600 and 700 fills. White by default. */
--color-synertech-on-primary: #fff;
}
Shape the ramp like Tailwind's, lightest at 50 and darkest at 950. The components use 50 and 100 for tinted backgrounds, 600 for fills and for text on a light page, 400 for text on a dark one, 500 for focus rings.
The 600 and 700 stops do two jobs: they are the fills --color-synertech-on-primary is written on, and they are text on a light page (a link, the label of an active tab). White on a blue or a violet reads at 4.5:1 both ways. On a light hue it does not (3.6:1 on Tailwind's orange-600): put a darker stop at 600 — orange-700 there reads at 5.2:1 both ways. Turning on-primary dark instead keeps a bright fill readable, and leaves the brand-coloured text of a light page as pale as that fill.
Declare it in plain CSS, not inside a Tailwind @theme block. On :root it repaints everything; on any other element, what is under it — but a Modal, a menu or the list of a Select is rendered under <body>, out of that element's reach.
Not everything blue is the brand. The info status of Banner, Toast and Tooltip stays blue, like the red of an error; the chart series have their own palette (--color-chart-1 to -8).
The colour props (bgColor, checkedColor, progressColor…) still win over the ramp, one component at a time.
Changing one component's classes
A className you pass replaces the component's own classes that set the same thing, whatever the order of the stylesheets: the library resolves the conflict with tailwind-merge, and the class written last — yours — wins.
// The fill and the padding are replaced, the rest of the button stays.
<Button className="bg-red-600 px-8">Delete</Button>
A class only replaces one under the same variants.bg-red-600 replaces the fill, not its hover: and dark: shades: write those too (hover:bg-red-700 dark:bg-red-500) for a button that stays red under the pointer and in the dark theme.
Your classes need your Tailwind. The shipped stylesheet only holds the classes the library uses; a class of your own is drawn by the Tailwind of your application.
To change a colour everywhere at once, set the ramp above rather than a className on each component.
Imports
Every component, hook and utility comes from the main entry point:
Only the Markdown editor has its own entry point, @synertech/ui/markdown-editor, because it depends on @mdxeditor/editor (an optional peer dependency). Import that path only when the package is installed.
Server Components and Client Components
Each page says whether the component is server-compatible or client:
Server-compatible — no hooks: usable directly in a Next.js Server Component.
Client — the module carries "use client": pass it event handlers from a Client Component.
Next.js 16 builds with Turbopack by default and needs nothing more. With webpack — what next build uses before Next.js 16, or next build --webpack since — add the package to optimizePackageImports:
Without it, a Server Component that imports anything from @synertech/ui makes webpack send every client component of the library to the browser, on every page: 275 kB of first-load JavaScript for a minimal server page, against 90 kB with the setting (Next.js 14.2).
Translatable labels
Every text the library renders itself (close, confirm, “Rows per page”, validation messages…) is in English by default. UILabelsProvider translates them for the whole application; a prop passed to one instance (closeLabel, submitLabel, or labels for a component that writes many) always wins. Label, Breadcrumb and Avatar, rendered on the server, do not read the provider: their label is passed as a prop (requiredLabel={frenchUILabels.labelRequired}).
labels is the language of the texts, locale the way numbers and dates are written: the charts, Calendar, ChartPeriodPicker, NumberInput and the footer and filters of DataGrid read it, and a locale prop on one instance wins. Without either they follow the language of the runtime, which is not the same on a server and in the browser: an application rendered on the server sets locale, or “1,284.5” becomes “1 284,5” at hydration. StatCard, ChartFacets and ChartScaleLegend, rendered on the server, take it as a prop; Calendar takes a today for the same reason.
Reading the API reference
A required prop is marked with a dot; the others are optional.
The Default column gives the value applied when the prop is left out.
When a component extends an HTML element, its native attributes (id, aria-*, onClick…) are accepted too: the reference sums them up in one line instead of listing them.