Cookest
UI Components

UI Components Overview

CUCL — the Cookest React component library built with TailwindCSS 4 and Framer Motion

UI Components Overview

CUCL (Cookest UI Components Library) is the shared React design system powering the Cookest web layer. It ships 12 production-ready components, a typed design-token API, and full Storybook integration.

Repository: Cookest/cookest-ui-components-library
Package name: @cookest/ui
Version: 0.1.0

Tech stack

ToolVersionRole
React19UI runtime
TypeScript6Type safety
TailwindCSS4Utility-first styling
Framer Motion12Animations and transitions
clsx + tailwind-mergelatestConditional class utilities
Storybook10Component development and documentation
Vitest4Unit and integration tests
Testing Library16DOM interaction helpers
tsup8Library bundler (ESM + CJS)
Bun1.xPackage manager and script runner

Installation

bun add @cookest/ui

Peer dependencies

bun add react react-dom framer-motion

Import the stylesheet

Import @cookest/ui/styles.css once at the root of your application — it loads the design tokens as CSS custom properties and the Playfair Display + Inter web fonts:

// app/layout.tsx (Next.js) or main.tsx (Vite)
import "@cookest/ui/styles.css";

Quick start

import { Button, Card, Input } from "@cookest/ui";
import "@cookest/ui/styles.css";

export default function LoginCard() {
  return (
    <Card>
      <Input label="Email" type="email" placeholder="you@example.com" />
      <Input label="Password" type="password" />
      <Button variant="primary" fullWidth>
        Sign in
      </Button>
    </Card>
  );
}

Design tokens

Access the typed token objects directly — useful for theme-aware logic or Storybook decorators:

import { colors, spacing, typography } from "@cookest/ui/tokens";

// e.g. get the primary brand colour at runtime
const primary = colors.primary.DEFAULT; // "#7A9A65"

Component list

ComponentExportDescription
ButtonButtonPrimary, secondary, ghost, danger variants with loading state
InputInputText input with label, helper text, error state, icon slots
CardCard, CardHeader, CardBody, CardFooterContainer with optional header, body, footer sections
BadgeBadgeStatus indicators with optional dot and remove button
AvatarAvatar, AvatarGroupUser avatar — image or initials fallback; stacked groups
ModalModalAccessible dialog with focus trap and keyboard dismiss
TooltipTooltipPositioned tooltip with arrow and Framer Motion animation
ToggleToggleSwitch input with label and disabled state
SelectSelectCustom dropdown with optional keyboard navigation and search
SkeletonSkeleton, SkeletonCardLoading placeholder with pulse animation
AlertAlertContextual feedback — info, success, warning, error
DividerDividerHorizontal or vertical visual separator

Project structure

cookest-ui-components-library/
  src/
    components/
      Alert/
        Alert.tsx
        Alert.test.tsx
        Alert.stories.tsx
        index.ts
      Avatar/    Badge/    Button/
      Card/      Divider/  Input/
      Modal/     Select/   Skeleton/
      Toggle/    Tooltip/
    tokens/
      colors.ts
      typography.ts
      spacing.ts
      effects.ts
      index.ts
    utils/
      cn.ts          ← clsx + tailwind-merge helper
    styles.css       ← TailwindCSS 4 @theme + CSS custom properties
    index.ts         ← Public API barrel
  .storybook/        ← Storybook configuration

Development workflow

# Install dependencies
bun install

# Start Storybook (component sandbox)
bun run storybook

# Run unit tests
bun run test

# Run tests in watch mode
bun run test:watch

# Check TypeScript
bun run lint

# Format source files
bun run format

# Build the library
bun run build

Exports

The library has three export paths:

PathContents
@cookest/uiAll components and the cn utility
@cookest/ui/tokensDesign token objects (colors, spacing, typography, effects)
@cookest/ui/styles.cssCSS custom properties and web font imports

The library ships both ESM (dist/index.js) and CJS (dist/index.cjs) builds, so it works in Next.js App Router, Vite, and any CommonJS environment.

On this page