# Cozy UI > Cozy UI is an open-source (MIT) set of 42 chunky, toy-like React components for shadcn/ui and game UI: buttons you can press, a built-in game kit (inventory with drag and drop, character sheet, collectible cards, world map and minimap, shop and wallet, perks, skill tree), five palettes, Liquid Glass, springy motion and a full data table. Built on Radix UI and Tailwind CSS v4, installed with the shadcn CLI. Every docs page below links to its Markdown version (`.md`). The HTML page is the same URL without `.md`, with a trailing slash. License: MIT. Source: https://github.com/0xtrou/cozy-ui Quick install: - npm (React 18 or 19, no Tailwind needed): `npm install @0xtrou/cozy-ui`, then in the root entry file `import "@0xtrou/cozy-ui/fonts.css"` and `import "@0xtrou/cozy-ui/styles.css"` (on Tailwind CSS v4 import `@0xtrou/cozy-ui/cozy.css` instead of `styles.css`). Components: `import { Button } from "@0xtrou/cozy-ui"` or `from "@0xtrou/cozy-ui/button"`. Mount `` once for `toast`; wrap the app in `` for tooltips. - shadcn registry (components.json and Tailwind CSS v4): add `"registries": { "@cozy": "https://cozy-ui.solo.engineer/r/{name}.json" }` to components.json, run `npx shadcn@latest add @cozy/cozy-theme @cozy/` and `npm install @fontsource/nunito`, then in the global CSS after the shadcn variables: `@import "@fontsource/nunito/400.css"; @import "@fontsource/nunito/200.css"; @import "./styles/cozy.css";`. - CSS only (any stack): `` and ``, then classes such as `cz-button cz-button--reward`. - Palettes: ``. Liquid Glass: `data-material="glass"` on the page or a section. - MCP server: `claude mcp add cozy-ui -- npx -y @0xtrou/cozy-ui-mcp`, or `{ "command": "npx", "args": ["-y", "@0xtrou/cozy-ui-mcp"] }` in other clients. ## Agent install prompt Paste this into an AI coding agent to install Cozy UI in a project: ~~~~text Install Cozy UI in this project. Cozy UI is an MIT React UI kit with shadcn/ui component APIs, built on Radix UI. Docs: https://cozy-ui.solo.engineer/ (plain text: https://cozy-ui.solo.engineer/llms.txt). Do the steps in order. Use the project's package manager (from the lock file: pnpm, yarn, bun or npm) for every install. Do not change unrelated code. 1. Detect the stack. Read package.json, the lock file and the config files, then tell me: - React version ("react" in package.json), or "no React". - Framework or bundler: Next.js (App Router or Pages Router), Vite, Remix / React Router, Astro, or other. - Tailwind CSS v4: yes if "tailwindcss" is version 4 or later, or a CSS file has @import "tailwindcss". - shadcn/ui: yes if components.json exists at the project root. 2. Pick exactly one path and tell me which and why: - A. shadcn registry: components.json exists AND Tailwind CSS v4 is used. The source is copied into the repo. - B. npm package: React 18 or 19, every other React case (no Tailwind, Tailwind v3, or no components.json). - C. CSS only: no React (Vue, Svelte, plain HTML, server templates). If React is older than 18, stop and tell me. 3. Install. - A. In components.json, add this key next to the existing ones: "registries": { "@cozy": "https://cozy-ui.solo.engineer/r/{name}.json" } Then run: npx shadcn@latest add @cozy/cozy-theme @cozy/button Then install @fontsource/nunito. - B. Install @0xtrou/cozy-ui. - C. Nothing to install. 4. Add the styles once, at the app root. - A. In the global CSS file that imports Tailwind (for example app/globals.css or src/index.css), after the shadcn theme variables: @import "@fontsource/nunito/400.css"; @import "@fontsource/nunito/200.css"; @import ""; - B. In the root entry file (Next.js App Router: app/layout.tsx; Pages Router: pages/_app.tsx; Vite: src/main.tsx; Remix / React Router: app/root.tsx): import "@0xtrou/cozy-ui/fonts.css"; import "@0xtrou/cozy-ui/styles.css"; If Tailwind CSS v4 is used, import "@0xtrou/cozy-ui/cozy.css" instead of "@0xtrou/cozy-ui/styles.css", so utilities are not shipped twice. - C. In the of the main HTML template: In every path, give the page the kit's background and type in the global CSS: body { background: var(--cz-page); color: var(--cz-text); font-family: var(--cz-font-family); } 5. Palette (only if I asked for one). Set data-palette on the element: village, meadow, lotus, river or lantern (dark). With no attribute the page follows the system: Village in light mode, Lantern in dark mode. For Liquid Glass, also set data-material="glass". 6. Verify with one sample. Add one button to an existing page: - A. import { Button } from "@/components/ui/button" (use the "ui" alias from components.json), then - B. import { Button } from "@0xtrou/cozy-ui", then - C. If the app uses toast: mount once at the root (B: import { Toaster, toast } from "@0xtrou/cozy-ui"; A: run npx shadcn@latest add @cozy/sonner, then import { Toaster } from "@/components/ui/sonner" and toast from "sonner"). If the app uses Tooltip: wrap the root in (B: from "@0xtrou/cozy-ui"; A: from "@/components/ui/tooltip"). 7. Run the project's build and type check: the "build" and "typecheck" scripts in package.json if they exist, otherwise npx tsc --noEmit. Fix any error you caused. 8. Report the path you chose, every file you changed and the command results. Then suggest the Cozy UI MCP server, so you can look up components and props from the real docs: Claude Code: claude mcp add cozy-ui -- npx -y @0xtrou/cozy-ui-mcp Cursor, VS Code, Claude Desktop (mcpServers config): "cozy-ui": { "command": "npx", "args": ["-y", "@0xtrou/cozy-ui-mcp"] } ~~~~ ## Docs - [Introduction](https://cozy-ui.solo.engineer/docs.md): What Cozy UI is, how it is built and what you get: 3D blocks, five palettes, motion and a shadcn registry. - [Installation](https://cozy-ui.solo.engineer/docs/installation.md): Install Cozy UI your way: npm package for React, the shadcn registry, plain CSS for any stack, an MCP server for AI assistants, Unity and design tokens. - [Palettes](https://cozy-ui.solo.engineer/docs/palettes.md): Five colour palettes (Village, Meadow, Lotus, River, Lantern dark) on one set of colour roles. Switch with one attribute. - [Materials](https://cozy-ui.solo.engineer/docs/materials.md): Two materials for every block: soft plastic and glass. Glass keeps the 3D wall and press with a clear, candy-like face, in every palette. - [Motion](https://cozy-ui.solo.engineer/docs/motion.md): Springy, physical motion for every component and cz-motion utilities, with reduced-motion support. - [Tokens](https://cozy-ui.solo.engineer/docs/tokens.md): Design tokens for radius, borders, depth, shadows, spacing, type and motion, generated from one JSON file. - [Build game UI](https://cozy-ui.solo.engineer/docs/game-ui.md): Ready-made game screens: inventory, item info, character sheet, collection book, collectible cards, a world map and a minimap. Plain data in, events out, for any game state. - [MCP server](https://cozy-ui.solo.engineer/docs/mcp.md): Give AI assistants the Cozy UI docs: an MCP server for Claude, Cursor, VS Code and mcpfs, with component docs, install commands and tokens. - [Unity UI Toolkit](https://cozy-ui.solo.engineer/docs/unity.md): How Cozy UI tokens and class names map to Unity UI Toolkit (USS). ## Components ### Game kit: Items - [Inventory](https://cozy-ui.solo.engineer/docs/components/inventory.md): A bag of item slots with drag and drop (mouse, pen and touch), keyboard moving, stack merging, locked slots, category tabs, search, sort and item tooltips. Controlled or uncontrolled. Exports: `Inventory`, `applyMove`. - [Item Info](https://cozy-ui.solo.engineer/docs/components/item-info.md): The details of an item: rarity, type, description, stats with +/- against the equipped one, value and action buttons. As a card, a compact tooltip or a panel. Exports: `ItemInfo`, `ItemTooltip`. - [Item Card](https://cozy-ui.solo.engineer/docs/components/item-card.md): Ready-made collectible cards for games: an original frame with a rarity edge, an element tint, big art, abilities, flavour text and a set footer. Cards tilt toward the pointer with a foil shine, flip to a custom back, and scale every part from one width. CardHand fans them like a hand; CardGrid lays out a binder. Exports: `ItemCard`, `CardHand`, `CardGrid`, `DEFAULT_ELEMENTS`. - [Gallery](https://cozy-ui.solo.engineer/docs/components/gallery.md): A collection book for anything: items, characters, fish, recipes. Locked entries are silhouettes, a progress bar counts what is found, and opening an entry shows a big view with previous and next. Exports: `Gallery`. ### Game kit: Characters and progression - [Character Info](https://cozy-ui.solo.engineer/docs/components/character-info.md): A character sheet: portrait with level, name and title, XP, bars for health, energy or mood, status chips, attributes with gear bonuses and equipment slots. A compact variant fits a HUD or party list. Exports: `CharacterInfo`. - [Perk Picker](https://cozy-ui.solo.engineer/docs/components/perk-picker.md): A "Level up! Pick one" screen: a few perk cards pop in, the player chooses one and confirms. Rarity colours the card edge, upgrades show "Lv 2 → 3" or "New", and the game can offer rerolls and a skip. Cards are a row on wide containers and a vertical list on narrow ones. Controlled or uncontrolled, with radiogroup keyboard support. Exports: `PerkPicker`. - [Skill Tree](https://cozy-ui.solo.engineer/docs/components/skill-tree.md): A talent tree: skills on a grid, lines for prerequisites, points to spend. Nodes show their state at a glance (locked with a padlock, available with a soft glow, learned in the branch colour, maxed with a gold ring), multi-rank nodes show "2/3", and picking a node opens its details in a side panel (a bottom sheet on phones). Your game owns the ranks and the point balance; the tree tells you what changed. Big trees scale to the box and can be dragged and zoomed. Exports: `SkillTree`. - [Buff Bar](https://cozy-ui.solo.engineer/docs/components/buff-bar.md): Active effects on the HUD. Each buff or debuff is a round icon with a countdown ring, a short time label ("4:32", "2h"), a stacks badge and a tooltip with the name, description, source and time left. Debuffs use the danger colour, and under 10 seconds an icon gently blinks. Timers use absolute end times. Exports: `BuffBar`. ### Game kit: World - [Game Map](https://cozy-ui.solo.engineer/docs/components/game-map.md): A world map and a HUD minimap that share one set of data, laid out like a maps app: small pins whose labels make room for each other, numbered clusters when zoomed out, a place panel (side panel on wide maps, bottom sheet on phones), filter chips, search, "find me", zoom and a scale bar. Regions can sit under clouds until discovered. Everything is in your game's own units, so markers come straight from game state. Exports: `GameMap`, `MiniMap`. ### Game kit: Economy - [Currency Bar](https://cozy-ui.solo.engineer/docs/components/currency-bar.md): The HUD wallet: one chip per currency with its icon and amount. When an amount changes it counts up or down and a small "+120" or "−60" floats off the chip. Chips can show a cap with a fill bar (energy), a "+" button, a clickable state, and a shake with a red face for "not enough coins". Screen readers hear one polite message per change, not every frame. The game owns the wallet; this only draws it. Exports: `CurrencyBar`. - [Shop](https://cozy-ui.solo.engineer/docs/components/shop.md): An in-game store grid: category tabs, a featured deal row with countdowns, discounts, low stock, sold-out and owned states, a wallet check that greys out what the player cannot afford, and currency packs for real money. It only draws the shop. Your game keeps the wallet and the stock, and charges the player from the `onBuy` event. Exports: `Shop`, `DEFAULT_LABELS as DEFAULT_SHOP_LABELS`. - [Purchase Dialog](https://cozy-ui.solo.engineer/docs/components/purchase-dialog.md): The confirm step of any purchase. It shows the item, a quantity stepper for bundles, the total, and "Balance 1,250 → 1,130" for each in-game currency. If the wallet falls short, Buy is disabled and the dialog says "Need 70 more Coins" with an optional Get more button. onConfirm can return a Promise: the button spins, then a success view pops up (or the error appears with a retry). Free items say Claim; real-money prices are shown as given. Exports: `PurchaseDialog`. ### Forms - [Button](https://cozy-ui.solo.engineer/docs/components/button.md): A chunky pressable block. It lifts on hover and sinks into its own wall when pressed. Exports: `Button`. - [Input](https://cozy-ui.solo.engineer/docs/components/input.md): A text field carved into the surface: the opposite of a button, it sinks in. Exports: `Input`. - [Textarea](https://cozy-ui.solo.engineer/docs/components/textarea.md): Multi-line version of Input with the same sunken well. Exports: `Textarea`. - [Label](https://cozy-ui.solo.engineer/docs/components/label.md): Accessible label that also lays out an inline control and its text. Exports: `Label`. - [Checkbox](https://cozy-ui.solo.engineer/docs/components/checkbox.md): Ticks with a little jelly wobble and a stamped check mark. Exports: `Checkbox`. - [Radio Group](https://cozy-ui.solo.engineer/docs/components/radio-group.md): Marbles dropped into sunken cups. Works as plain rows or as choice cards. Exports: `RadioGroup`, `RadioGroupItem`. - [Switch](https://cozy-ui.solo.engineer/docs/components/switch.md): A marble that rolls along a sunken groove and squashes as it lands. Exports: `Switch`. - [Slider](https://cozy-ui.solo.engineer/docs/components/slider.md): Groove and marble thumbs. Supports one value or a range. Exports: `Slider`. - [Select](https://cozy-ui.solo.engineer/docs/components/select.md): A raised trigger that presses in while open, and a floating board of options. The highlighted option lifts. Exports: `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectSeparator`, `SelectTrigger`, `SelectValue`. - [Toggle Group](https://cozy-ui.solo.engineer/docs/components/toggle-group.md): A tray of keys: pressed keys stay pressed. Single or multiple choice, plus a standalone Toggle. Exports: `Toggle`, `ToggleGroup`, `ToggleGroupItem`. - [Calendar](https://cozy-ui.solo.engineer/docs/components/calendar.md): A board of date tiles. Pick one day or a range; marked days get a dot. Full keyboard support and no date library. Exports: `Calendar`. ### Layout - [Card](https://cozy-ui.solo.engineer/docs/components/card.md): A thick paper board with a wall and a soft contact shadow. Exports: `Card`, `CardHeader`, `CardFooter`, `CardTitle`, `CardAction`, `CardDescription`, `CardContent`. - [Tabs](https://cozy-ui.solo.engineer/docs/components/tabs.md): A sunken tray with one raised tile that slides, with a bounce, to the active tab. Exports: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`. - [Accordion](https://cozy-ui.solo.engineer/docs/components/accordion.md): Stacked boards; the open one unfolds and its chevron flips with a bounce. Exports: `Accordion`, `AccordionItem`, `AccordionTrigger`, `AccordionContent`. - [Separator](https://cozy-ui.solo.engineer/docs/components/separator.md): A carved groove between groups, horizontal or vertical. Exports: `Separator`. ### Overlays - [Dialog](https://cozy-ui.solo.engineer/docs/components/dialog.md): A framed board that bounces in over a warm dimmed backdrop, and drops away on close. Exports: `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`. - [Sheet](https://cozy-ui.solo.engineer/docs/components/sheet.md): A framed board that slides in from an edge with a springy settle. Use it for create and edit forms; the bottom sheet suits phones. Exports: `Sheet`, `SheetTrigger`, `SheetClose`, `SheetContent`, `SheetHeader`, `SheetFooter`, `SheetTitle`, `SheetDescription`. - [Popover](https://cozy-ui.solo.engineer/docs/components/popover.md): A small board that pops out of its trigger. Exports: `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverAnchor`. - [Dropdown Menu](https://cozy-ui.solo.engineer/docs/components/dropdown-menu.md): Actions and options on a floating board: items, labels, separators, shortcuts, checkbox and radio items, and an optional full-text search. Exports: `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuLabel`, `DropdownMenuItem`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSearch`. - [Tooltip](https://cozy-ui.solo.engineer/docs/components/tooltip.md): A little hanging tag that swings into place. Exports: `Tooltip`, `TooltipTrigger`, `TooltipContent`, `TooltipProvider`. ### Feedback - [Alert](https://cozy-ui.solo.engineer/docs/components/alert.md): An inline notice board with a glyph, a title and a line of detail. Exports: `Alert`, `AlertTitle`, `AlertDescription`. - [Toast](https://cozy-ui.solo.engineer/docs/components/toast.md): Sonner, unstyled, wearing the kit's skin. Pops in; warnings use a rain cloud, never red. Exports: `Toaster`. - [Progress](https://cozy-ui.solo.engineer/docs/components/progress.md): A rounded tube that fills with a springy ease and rolling stripes. It glints when full. Exports: `Progress`. - [Skeleton](https://cozy-ui.solo.engineer/docs/components/skeleton.md): Sunken clay placeholders with a slow sheen. Size them like the real content so nothing jumps. Exports: `Skeleton`. ### Data display - [Table](https://cozy-ui.solo.engineer/docs/components/table.md): A plain, semantic table on a board: grey sentence-case headers, no header band, no zebra rows, numbers right-aligned. Exports: `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableHead`, `TableRow`, `TableCell`, `TableCaption`, `TableSortButton`. - [Data Table](https://cozy-ui.solo.engineer/docs/components/data-table.md): A full list screen on TanStack Table: frozen ID and action columns, sticky header, sort on every column, search and faceted filters, selection with bulk actions, paging, column choice, URL state and honest loading, empty and error states. Exports: `IconAction`, `DataTableColumnHeader`, `DataTable`. - [Badge](https://cozy-ui.solo.engineer/docs/components/badge.md): Small raised chips for status and counts. Exports: `Badge`. - [Avatar](https://cozy-ui.solo.engineer/docs/components/avatar.md): Round token with a wall. Tilts on hover. Exports: `Avatar`, `AvatarImage`, `AvatarFallback`. ### Navigation - [Breadcrumb](https://cozy-ui.solo.engineer/docs/components/breadcrumb.md): Where you are, and the way back. Used on detail screens opened from a table. Exports: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`. - [Pagination](https://cozy-ui.solo.engineer/docs/components/pagination.md): Page links as small blocks; the current page is the raised primary one. Exports: `Pagination`, `PaginationContent`, `PaginationLink`, `PaginationItem`, `PaginationPrevious`, `PaginationNext`, `PaginationEllipsis`. ## Optional - [Full text for LLMs](https://cozy-ui.solo.engineer/llms-full.txt): every component with install command, usage, props, an example and source. - [Registry index](https://cozy-ui.solo.engineer/r/registry.json) - [Tiny Farm (demo game)](https://cozy-ui.solo.engineer/demos/tiny-farm.md): A small idle farming game built only from Cozy UI: plant, wait, harvest, buy upgrades in a sheet and pick a reward card when you level up. - [Memory Match (demo game)](https://cozy-ui.solo.engineer/demos/memory-match.md): Flip cards to find the pairs. Cards flip in 3D, matches wobble, and a dialog scores you with stars. - [Bop the Mole (demo game)](https://cozy-ui.solo.engineer/demos/bop-the-mole.md): Tap the moles before they hide: 30 seconds a round, three difficulties, a timer bar and a score dialog. - [Village Shop (block)](https://cozy-ui.solo.engineer/blocks/village-shop.md): An in-game store from Cozy UI parts: a wallet with animated amounts, shelves with tabs, deals, stock and gem packs, and a purchase dialog with quantity, balances and "get more" when the player is short. - [Character Screen (block)](https://cozy-ui.solo.engineer/blocks/character-screen.md): A full game character screen from Cozy UI parts: character sheet with equipment, a drag-and-drop backpack, item details with equip and sell, and a collection tab. - [Village HUD (block)](https://cozy-ui.solo.engineer/blocks/village-hud.md): A game HUD over a little village scene built only from Cozy UI parts: resource chips, a minimap that opens the village map, a floating harvest button and a pick-one-of-three level-up sheet. Tap Harvest, then pick a card.