# Why PyColors UI

import { Callout } from "fumadocs-ui/components/callout";
import { Tabs, Tab } from "fumadocs-ui/components/tabs";
import {
  Badge,
  Card,
  CardContent,
  CardHeader,
  CardTitle,
} from "@pycolors/ui";
import {
  ArrowRight,
  Boxes,
  CheckCircle,
  Code2,
  Layers3,
  LayoutDashboard,
  LayoutTemplate,
  MousePointerClick,
  Palette,
  Rocket,
  ShieldCheck,
  Sparkles,
  XCircle,
} from "lucide-react";
import { PreferAvoid } from '@/components/docs/prefer-avoid';
import { DocsLinks } from "@/components/docs/docs-links";
import { DocsFeatureGrid } from "@/components/docs/docs-feature-grid";
import { DocsConceptTabs } from "@/components/docs/docs-concept-tabs";

<div className="flex flex-wrap items-center gap-2">
  <Badge variant="outline">
    UI
  </Badge>

  <Badge>
    Philosophy
  </Badge>
</div>

## Built for products that evolve

Most UI libraries help you ship the first screen.

PyColors UI is designed to help your product stay coherent after the first screen, the tenth feature, and the first real customer.

It is built for:

* SaaS dashboards
* settings pages
* auth flows
* billing interfaces
* admin panels
* long-lived product surfaces

The goal is not to give you the most components.

The goal is to give you a system that remains understandable as your product grows.

<Callout title="Core idea">
  PyColors UI is not a demo component library. It is a product system for builders who care about clarity, consistency, and long-term control.
</Callout>

## The problem

Most products do not break at the beginning.

They break later.

At first, everything feels manageable. Then the product grows and the UI starts drifting:

* hardcoded colors
* duplicated components
* inconsistent spacing
* local visual decisions
* unclear component ownership
* different pages solving the same problem differently
* product surfaces that stop feeling related

The issue is rarely React, Tailwind, or the team.

The issue is the absence of a system.

## What PyColors UI does differently

PyColors UI is intentionally opinionated. Not to limit you.

To remove ambiguity where ambiguity becomes expensive.

<DocsFeatureGrid
  columns={3}
  tone="platform"
  items={[
  {
    title: 'Tokens first',
    description:
      'Components consume semantic roles instead of inventing visual decisions locally.',
    icon: Palette,
  },
  {
    title: 'Small primitives',
    description:
      'UI components stay predictable. Complex product behavior belongs in Guides and Patterns.',
    icon: Boxes,
  },
  {
    title: 'You own the code',
    description:
      'Plain React and Tailwind. No black box. No runtime magic. No unnecessary lock-in.',
    icon: Code2,
  },
]}
/>

### Principles

<DocsConceptTabs
  items={[
  {
    value: 'Tokens',
    title: 'Tokens define the system',
    icon: Palette,
    description:
      'Colors, typography, radius, and shadows are expressed as reusable decisions. Components consume those roles instead of hardcoding local styles.',
  },
  {
    value: 'Primitives',
    title: 'Components stay small',
    icon: Boxes,
    description:
      'Components are building blocks. They should be simple, predictable, accessible, and easy to compose into real product surfaces.',
  },
  {
    value: 'Patterns',
    title: 'Patterns handle product complexity',
    icon: LayoutDashboard,
    description:
      'Tables, overlays, forms, async actions, and SaaS layouts belong at the pattern level, where UX behavior and state can be documented clearly.',
  },
]}
/>

### Tokens first

Design tokens are the foundation of PyColors UI.

They define the reusable visual decisions that make the system feel coherent:

* semantic colors
* typography roles
* radius scale
* shadow scale
* surface hierarchy
* readable contrast

Components should use utilities such as:

```tsx title="semantic-usage.tsx"
<div className="rounded-lg border bg-card text-card-foreground">
  <p className="text-sm text-muted-foreground">
    Semantic roles keep surfaces coherent.
  </p>
</div>
```

Not local one-off values.

<Callout title="Why this matters">
  When a component consumes tokens, the system can evolve globally. When a component hardcodes values, the system starts drifting.
</Callout>

### Components stay small

PyColors UI components are primitives.

They are not meant to solve every product scenario by themselves.

A good primitive should be:

* predictable
* composable
* accessible
* token-driven
* easy to understand
* easy to override when needed

If a component starts needing too many product-specific props, the problem probably belongs in a pattern, not in the primitive.

Examples:

| Need                     | Better layer    |
| ------------------------ | --------------- |
| Button styling           | UI component    |
| Form validation flow     | Guide           |
| Data table with filters  | Pattern         |
| Async mutation with undo | Pattern         |
| SaaS dashboard shell     | Guide / Starter |

### You own the code

PyColors UI is designed for teams that want control.

It uses:

* React
* TypeScript
* Tailwind CSS
* semantic tokens
* accessible primitives

It avoids:

* hidden runtime magic
* unnecessary abstraction
* opaque design decisions
* framework lock-in beyond the stack you already use

This makes the system easier to adapt, audit, and evolve.

### Documentation is part of the product

Documentation is not an afterthought.

It is part of the system.

PyColors documents:

* what a component is for
* when to use it
* when not to use it
* how it behaves in real product surfaces
* how it connects to design system rules

This reduces hidden knowledge and helps the product feel more intentional over time.

<Callout type="info" title="Documentation principle">
  A component without usage guidance is only half a system.
</Callout>

## Built for real SaaS surfaces

PyColors UI is designed around the surfaces most SaaS products actually need:

* dashboards
* settings
* billing
* authentication
* admin tools
* data tables
* empty states
* forms
* overlays
* account flows

This is why the docs do not stop at components.

They also include:

* Design System foundations
* Guides
* Patterns
* Starter Free
* Starter Pro

The component layer is only one part of the product system.

### What this is not

PyColors UI is not:

* a visual editor
* a no-code builder
* a drag-and-drop system
* a theme marketplace
* a monolithic enterprise framework
* a replacement for product thinking

It gives you the structure to move faster with more consistency.

It does not remove the need to make product decisions.

## Tradeoffs

Every good system makes tradeoffs.

<PreferAvoid
  preferTitle="You gain"
  avoidTitle="You accept"
  prefer={[
  'better long-term consistency',
  'clearer design decisions',
  'easier maintenance',
  'less UI drift',
  'stronger product readability',
]}
  avoid={[
  'more explicit structure',
  'fewer magical abstractions',
  'design rules instead of random styling',
  'patterns for complex UX instead of oversized primitives',
  'ownership of product decisions',
]}
/>

## Where this fits in PyColors

PyColors is structured in layers.

| Layer         | Purpose                                     |
| ------------- | ------------------------------------------- |
| Design System | Tokens, colors, typography, radius, shadows |
| UI Components | Small reusable primitives                   |
| Guides        | Product composition and UX rules            |
| Patterns      | Feature-level product blocks                |
| Starter Free  | Validate product surfaces                   |
| Starter Pro   | Wire auth, billing, backend, and delivery   |

<Callout title="System mental model">
  Tokens define the system. Components stay small. Patterns handle complexity. Starters connect everything into product foundations.
</Callout>

### When PyColors UI is a good fit

Use PyColors UI if:

* you are building a SaaS product
* you care about long-term consistency
* you want control over your code
* you prefer explicit architecture over magic
* you want components that align with docs, guides, and starters
* you want to build product surfaces, not isolated demos

Do not use it if:

* you want a full no-code builder
* you want a visual editor
* you want every product decision made for you
* you do not want to own the implementation

### Why it matters

UI is not just visuals.

It affects:

* product clarity
* team velocity
* user trust
* onboarding speed
* long-term maintainability

Without structure, every new feature adds friction.

With a system, your product can grow without becoming chaotic.

## Next steps

<DocsLinks
  variant="grid"
  tone="platform"
  items={[
  {
    title: 'Design System',
    href: '/docs/design-system',
    description:
      'Understand the tokens, colors, typography, radius, and shadows behind PyColors UI.',
    icon: Palette,
  },
  {
    title: 'Button',
    href: '/docs/ui/button',
    description:
      'Start with the primitive used for actions, intent, and interaction hierarchy.',
    icon: MousePointerClick,
  },
  {
    title: 'Patterns',
    href: '/docs/patterns',
    description:
      'See how primitives become product-level blocks for real SaaS features.',
    icon: LayoutTemplate,
  },
  {
    title: 'Starter Pro',
    href: '/docs/starter-pro',
    description:
      'Move from UI foundations to real auth, billing, backend, and delivery.',
    icon: Rocket,
  },
]}
/>