Kumo Design System
repository·main·Indexed 25 days ago
https://github.com/cloudflare/kumoCloudflare's design system and component library providing accessible, design-system-compliant UI components built on Base UI. It includes a CLI for component documentation and scaffolding, support for Tailwind CSS and standalone styles, and a collection of customizable blocks like PageHeader and DeleteResource.
What's inside Kumo
- The Kumo component registry is a machine-readable JSON file containing metadata for all Kumo components, including props, variants, examples, and semantic tokens. It is designed for use by AI agents, code generation tools, and other automated workflows. You can access this registry via the CLI, a remote HTTP API, or by reading the local JSON file directly.
Use the Timeseries Chart
mainThe timeseries chart is a specialized component for displaying time-based data. Each data point must be provided as a tuple of[timestamp_in_ms, value].Complete Kumo component update workflow
mainWhen you modify Kumo components in code, follow this sequence to ensure Figma stays in sync:
- Edit components: Modify files in
packages/kumo/src/components/.... - Regenerate registry: Run the codegen command to update the component registry.
- Sync tokens: If colors changed, run the Figma token sync.
- Build plugin: Rebuild the Figma plugin.
- Run in Figma: Execute the plugin via the Figma Desktop menu.
# 1. Make changes to Kumo components # ...edit packages/kumo/src/components/... # 2. Regenerate component registry pnpm --filter @cloudflare/kumo codegen:registry # 3. Sync tokens to Figma (if colors changed) pnpm --filter @cloudflare/kumo-figma figma:sync # 4. Build the plugin pnpm --filter @cloudflare/kumo-figma build # 5. Run in Figma: Plugins > Development > Kumo UI Kit Generator- Edit components: Modify files in
Install the PageHeader block
mainPageHeader is a block—a component installed via the CLI that is copied directly into your project, allowing for full customization.
Follow these steps to install it:
- Initialize Kumo config (if not already done):
npx @cloudflare/kumo init - Install the block:
npx @cloudflare/kumo add PageHeader - Import the component from your local directory. The path depends on your
kumo.jsonblocksDirsetting (the default issrc/components/kumo/).
// The path depends on your kumo.json blocksDir setting // Default: src/components/kumo/ import { PageHeader } from "./components/kumo/page-header/page-header";- Initialize Kumo config (if not already done):
Install Kumo beta versions
mainBeta releases are automatically generated for pull requests and follow the format{base-version}-beta.{commit-hash}. You can install them directly from npm or pnpm using the specific version string provided in the PR comment.Install the Grid components
mainImport
GridandGridItemfrom the@cloudflare/kumopackage to use the responsive grid layout system.import { Grid, GridItem } from "@cloudflare/kumo";Apply themes with data-theme
mainThemes override semantic token values while preserving token names. Apply a theme by setting the
data-themeattribute on a parent element.Available themes include:
kumo(Default)fedramp(Government compliance styling)
Themes work in conjunction with
data-mode:<div data-theme="fedramp"> <Button>FedRAMP Styled</Button> </div> // Full app example <html data-mode="dark" data-theme="fedramp"><div data-theme="fedramp"> <Button>FedRAMP Styled</Button> </div> <html data-mode="dark" data-theme="fedramp">Install the LayerCard component
mainYou can import theLayerCardcomponent from the main@cloudflare/kumobarrel export or use granular imports to improve tree-shaking efficiency.Migrate from legacy Code/CodeBlock components
mainThe legacy
CodeandCodeBlockcomponents from@cloudflare/kumoare deprecated and will be removed in v2.0. Migrate toCodeHighlightedandShikiProviderfrom@cloudflare/kumo/code.// Before (deprecated) import { Code, CodeBlock } from "@cloudflare/kumo"; <CodeBlock code="const x = 1;" lang="ts" /> // After import { ShikiProvider, CodeHighlighted } from "@cloudflare/kumo/code"; // Once at app root <ShikiProvider engine="javascript" languages={["tsx"]}> <App /> </ShikiProvider> // In components <CodeHighlighted code="const x = 1;" lang="tsx" />Install the Collapsible component
mainYou can import theCollapsiblecomponent using either the main barrel export or via granular imports for better tree-shaking.Customize Meter value display
mainThe
Metercomponent provides several ways to customize how values are displayed:- Custom String: Use the
customValueprop to show a specific string instead of the calculated percentage. - Hide Value: Set
showValue={false}to hide the numeric/percentage display entirely.
- Custom String: Use the
Display Autocomplete error states
mainUse theerrorprop to display validation errors within the component.