uikit
Reusable React components with one consistent look. Inputs, pickers, forms, data views, charts and feedback. Import one component at a time. Theme everything with CSS variables.
Most component libraries are all or nothing. You take their weight and their look. I wanted a small set I can import piece by piece and restyle with CSS variables. It also covers the heavy parts: a kanban board, a calendar, a data list and a form from a schema.
What it does
Calendar
Month, week, day and agenda views. Drag to move or resize an event. Drag across empty time to pick a range.
<EventCalendar
events={events}
eventId={(e) => e.id}
eventStart={(e) => e.start}
eventEnd={(e) => e.end}
eventTitle={(e) => e.title}
/>Data lists
Tabs, search, filters, sorting and paging in one component. Pass a fetch function. It loads one page at a time.
<ListView
data={fetchPeople}
idField="id"
title="Team"
columns={[
{ id: 'name', label: 'Name', sortable: true },
{ id: 'email', label: 'Email' },
]}
/>Forms from a schema
Describe the sections and fields. The form lays them out, checks them and returns the values.
const schema: FormSchema = {
sections: [{
title: 'Basics',
columns: 2,
fields: [
{ name: 'name', type: 'text', label: 'Project name' },
{ name: 'active', type: 'switch', label: 'Active' },
],
}],
}Charts
Line, bar and donut charts, progress meters and sparklines. No chart library underneath.
Light and dark
Every colour comes from a --uikit-* CSS variable. Set data-theme="dark" on the page for dark mode.
:root {
--uikit-color-primary: #0f766e;
}- 06
Import only what you use
Each component has its own entry point. Its styles load with it. There is no CSS file to import.
Get started
- 1
Install
React 18 or 19.
$npm i @dinesh-gamage/uikit - 2
Import a component
From the main entry, or from its own path.
import { Input } from '@dinesh-gamage/uikit/input' import { DatePicker } from '@dinesh-gamage/uikit/datetime' - 3
Turn on dark mode
Set the theme on the html element.
<html data-theme="dark">