# Cube UI Kit

Cube UI Kit is the open-source React design system behind Cube Cloud. The `@cube-dev/ui-kit` package combines production-ready components, accessible interaction patterns, a token-aware styling engine, and a runtime-configurable color system.

## Built for product interfaces

- **Production-ready components** — From layout and typography primitives to forms, tables, navigation, dialogs, notifications, and complex pickers.
- **Accessible interactions** — React Aria provides the foundation for keyboard navigation, focus management, and screen-reader behavior.
- **Composable styling** — Components share design tokens, style properties, state-driven values, and responsive syntax.
- **Integrated forms** — Fields connect directly to validation and form state without an extra wrapper component.
- **TypeScript-first APIs** — Component props, tokens, themes, and styling values are typed and discoverable.

## The foundations

Cube UI Kit is built on two independent open-source projects:

- [Tasty](https://tasty.style) is the declarative styling engine. It turns token-aware style objects, responsive values, and component states into conflict-free CSS.
- [Glaze](https://github.com/tenphi/glaze) generates the semantic color palette. A small set of brand and status seeds resolves into light, dark, and high-contrast token sets.

Use the [Theme Builder](https://cube-ui-kit.vercel.app/?path=/story/getting-started-theming--theme-builder) to tune a palette and preview the result across schemes and contrast levels.

## Get started

Install the package alongside React:

```bash
pnpm add @cube-dev/ui-kit react react-dom
```

Wrap the application in `Root`, then compose components normally:

```tsx
import { Button, Root, Space, TextInput } from '@cube-dev/ui-kit';

export function App() {
  return (
    <Root>
      <Space flow="column" gap="2x" padding="4x">
        <TextInput name="email" label="Email" type="email" isRequired />
        <Button type="primary">Continue</Button>
      </Space>
    </Root>
  );
}
```

`Root` installs the design tokens and providers used by overlays, navigation, internationalization, and other shared behaviors. See the [Root reference](./components/Root.md) for application-level options.

## Style with the system

Most components accept style properties directly. Values can reference semantic units and color tokens, so custom layouts stay aligned with the design system:

```tsx
<Space
  flow="column"
  gap={['2x', '3x']}
  padding={['2x', '4x']}
  fill="#surface-2"
  radius="1cr"
>
  <Button width="max-content">Create workspace</Button>
</Space>
```

For component states, reusable styled components, sub-elements, presets, and the complete token reference, continue to [Usage](./Usage.md) or the [Tasty project](https://tasty.style).

## Configure the palette

Pass palette seeds to `Root` to apply a product theme. Glaze resolves the complete semantic palette from this compact configuration:

```tsx
<Root
  palette={{
    accent: '#2F5BFF',
    themes: { danger: '#B91C1C' },
  }}
>
  <App />
</Root>
```

The [Theming guide](./Theming.md) covers palette zones, runtime updates, regional previews, dark mode, and high-contrast behavior.

## Where to go next

- Browse the sidebar for live component examples and API documentation.
- Learn the shared styling model in [Usage](./Usage.md).
- Build validated workflows with the [Form documentation](./components/form/Form.md).
- Review [Base Properties](./BaseProperties.md) shared by components across the kit.
