惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
爱范儿
爱范儿
量子位
Martin Fowler
Martin Fowler
V
V2EX
博客园 - 三生石上(FineUI控件)
I
InfoQ
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
Engineering at Meta
Engineering at Meta

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Meet kovax-react: a typed React UI library with CSS-varia...
Aleksey Alek · 2026-05-15 · via DEV Community

I just shipped kovax-react 0.5 — a small, typed React UI library aimed at apps that want layout primitives + forms + overlays + tables + design tokens without dragging in a framework. This post is a quick tour: what's inside, what's new, and how to try it in 60 seconds.


TL;DR

  • Typed design tokens (themeToken, colorToken) for colors, spacing, radii, typography, shadows, motion, z-index, breakpoints.
  • ThemeProvider injects CSS variables (--kx-*), supports light / dark / system color modes, scoped subtrees, palette overrides, and CSP nonce — SSR-safe with hex fallbacks.
  • 30+ components: Box, Flex, Grid, Stack, Heading, Text, Button, Input, Textarea, Checkbox, Radio, Switch, Select / useCombobox, FormControl, Tabs, Accordion, Alert, Progress, Tooltip, Popover, Dialog, Modal, Toast, DatePicker, Table / DataTable, and now Avatar + Badge.
  • Deep imports for smaller bundles: kovax-react/layout, /form, /overlays, /table, /badge, /avatar, …
  • React 16+ peer; react-day-picker only when you use date pickers.
  • MIT-licensed, written in TypeScript, tested with Jest.

Install

npm install kovax-react
# only if you use the date pickers
npm install react-day-picker

Enter fullscreen mode Exit fullscreen mode

Theming in 6 lines

Wrap your app once, and everything reads from CSS variables:

import { ThemeProvider, Button, themeToken } from "kovax-react";

export function App() {
  return (
    <ThemeProvider defaultColorMode="system">
      <Button color="primary" style={{ marginTop: themeToken("spacing.md") }}>
        Hello, kovax
      </Button>
    </ThemeProvider>
  );
}

Enter fullscreen mode Exit fullscreen mode

Switching modes is instant — components consume var(--kx-…, fallback) under the hood, so SSR has no flash and "no provider" still renders with the original palette.

Need a brand palette? Override per side, the rest is inherited:

import { ThemeProvider, lightPalette } from "kovax-react";

const brandPrimary = {
  50: "#f5f3ff",  100: "#ede9fe", 200: "#ddd6fe", 300: "#c4b5fd",
  400: "#a78bfa", 500: "#7c3aed", 600: "#6d28d9", 700: "#5b21b6",
  800: "#4c1d95", 900: "#3b0a76",
};

<ThemeProvider
  palettes={{ light: { colors: { ...lightPalette.colors, primary: brandPrimary } } }}
/>

Enter fullscreen mode Exit fullscreen mode

You can also scope a ThemeProvider to a ref — render a dark widget inside an otherwise light page (or vice-versa) without forking components.

New in 0.5

ThemeProvider + dark mode

  • colorMode: light | dark | system
  • useColorMode() and useTheme() hooks
  • target: documentElement or a RefObject for scoped theming
  • palettes per side, storageKey persistence, onColorModeChange callback
  • nonce for strict CSP

Avatar

Photo, initials from name, or a custom fallback (icon, emoji, anything). Sizes xs–xl, circle / rounded, semantic fallback colorScheme. Robust to broken image URLs (auto fallback on onError).

import { Avatar, HStack } from "kovax-react";

<HStack gap={12}>
  <Avatar name="Jane Doe" />               {/* → "JD" */}
  <Avatar src="/jane.jpg" alt="Jane Doe" name="Jane Doe" size="lg" />
  <Avatar name="Live" colorScheme="success" />
</HStack>

Enter fullscreen mode Exit fullscreen mode

Badge

Compact status / count pill. Variants solid / outline / subtle, semantic colors, optional leading dot, sizes sm / md.

import { Badge, HStack } from "kovax-react";

<HStack gap={8}>
  <Badge dot color="success">Live</Badge>
  <Badge color="primary" variant="outline">Pro</Badge>
  <Badge color="neutral" size="sm">12</Badge>
</HStack>

Enter fullscreen mode Exit fullscreen mode

What I actually use it for

  • Layout primitives (Box, HStack, VStack, Grid, Container, Sticky) keep markup boring and consistent.
  • Forms (FormControl, Input, Textarea, Select, useCombobox, Switch, Checkbox, Radio) play nice with react-hook-form (used in the playground demos, but not a library dep).
  • Overlays (Tooltip, Popover, Dialog, Modal, Toast) cover most app needs without a separate floating-ui setup.
  • TablesTable.* primitives plus a DataTable with controlled sort and row headers.

Try it without installing

The live playground is statically prerendered (so SEO works) and includes Preview / Code tabs per example, EN/RU UI, and the same Markdown docs from the repo. Sections to peek at:

  • Components → ThemeProvider — color modes, scoped themes, brand palette overrides
  • Components → Avatar / Badge — the new bits
  • Components → TableDataTable + sortable columns
  • Components → Design tokens — every palette / spacing / radius / shadow / motion / z-index / breakpoint, live

What's next

Likely candidates for 0.6: a richer Skeleton, Breadcrumb, Pagination, a Menu built on the same Popover primitives, and a small useMediaQuery exposing the design tokens' breakpoints.

If you find something missing, file an issue or PR on GitHub — or just leave a comment here, I read them all.

Thanks for reading 🙏 — happy to answer questions in the comments.