Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

Diba design system

Diba («دیبا», a fine Persian silk brocade) is Kaladan’s design system: one set of tokens, and the components cut from it. Kaladan’s own admin, its hub and its hosted checkout are built with it, and so is this site’s colour. Use it, and what you build looks like it belongs in Kaladan.

  • Tokens all the way down. Every colour and measure is a CSS variable in OKLCH, namespaced --db-, in light and dark. Re-theming is overriding variables, never forking components.
  • Accessible by construction. Behaviour comes from React Aria: keyboard, focus and screen readers are handled the same way in every component.
  • Describable as data. @kaladan/diba-schema checks a UI written as a JSON tree, which @kaladan/diba-react renders. A server can send a screen instead of shipping code for it.

Diba’s Storybook shows every component with its variants, sizes and states, in light and dark, right to left and left to right, with a playground for each one’s props.

Button Storybook ↗
Tabs Storybook ↗
PackageWhat it is
@kaladan/diba-tokensThe tokens: CSS variables, a Tailwind v4 theme layer and TypeScript types.
@kaladan/diba-reactThe React components, on React 19, React Aria and Tailwind v4.
@kaladan/diba-schemaThe component manifest, and the JSON Schema a server-driven UI tree is checked against.

All three are 0.1.0. Until 1.0.0, a change that breaks an app is released as a minor version, so pin ~0.1.0 if you want only fixes.

The source is public at github.com/KaladanDev/diba.

Terminal window
npm install @kaladan/diba-react

React 19, react-dom 19 and Tailwind CSS 4 are peer dependencies.

Import the stylesheet into your Tailwind entry, once:

@import 'tailwindcss';
@import '@kaladan/diba-react/tailwind.css';

Wrap the app in the provider, which sets the theme, the direction and the locale:

import { DibaProvider, Button } from '@kaladan/diba-react';
export function App() {
return (
<DibaProvider locale="fa-IR" theme="light">
<Button variant="primary">افزودن به سبد</Button>
</DibaProvider>
);
}

The font files are yours to load, under a licence you hold. The tokens name the faces: --db-font-family-fa (Yekan Bakh, then Vazirmatn) and --db-font-family-sans.

Not on React? The tokens stand alone. Import the variables and switch themes with data-theme on any element:

@import '@kaladan/diba-tokens/theme.css';
.my-button {
background: var(--db-primary);
color: var(--db-primary-fg);
}
<html data-theme="dark" dir="rtl" lang="fa-IR">
[data-theme='light'] {
--db-primary: oklch(0.823 0.115 69);
--db-primary-fg: oklch(0.397 0.055 288);
--db-radius-md: 8px;
}

Change the pairs together: --db-primary is a fill chosen to hold --db-primary-fg. Anything drawn on a surface (a focus ring, a checked box) uses --db-primary-emphasis, because a colour picked to sit behind dark text is rarely legible as ink.

Diba is free to use for building apps, extensions and themes for Kaladan, and only for that: not as a standalone kit or design system for other products. Each package’s LICENSE has the terms. Some parts of @kaladan/diba-react are third-party code under their own licences, named in its notices file.