# Introduction
Beautifully designed components for Remix 3. A faithful port of shadcn/ui, works with the shadcn CLI.
**shadcn-remix** is shadcn/ui for [Remix 3](https://remix.run): the same components, the same API and the same styles, written with `remix/component` and its `css()` mixin, with behavior from the [@remix-run/ui](https://www.npmjs.com/package/@remix-run/ui) headless primitives.
## Philosophy
shadcn-remix follows the shadcn model: copy-paste components you own, with zero lock-in and sensible defaults that work immediately. It is not a component library you install — it is the source, distributed through a shadcn registry.
Remix 3 components are not React components. A component is a setup function that returns a render function, styles are mixins instead of class names, and interactivity hydrates per `clientEntry`. shadcn-remix keeps the shadcn/ui API — names, props, variants and `data-*` attributes — and translates only what the runtime requires.
## Why shadcn-remix?
- **Own Your Code:** Every component is one file in `app/ui`. Change anything.
- **Exact Port:** Tailwind classes are translated declaration by declaration, so components match ui.shadcn.com pixel for pixel.
- **Server First:** Components render on the server; only interactive ones hydrate.
- **No Build Step:** Styles are generated by `css()` at render time — no Tailwind, no PostCSS.
## Features
- **Zero Config:** Works out of the box with sensible defaults. No build step, no Tailwind.
- **Theme Aware:** Built on the shadcn/ui CSS variables, with light and dark themes.
- **Composable:** The same component composition and data attributes as shadcn/ui.
- **TypeScript:** Typed props for every component, down to each host element.
- **Copy & Paste:** Own your code. Each component is a single file you copy into app/ui.
- **shadcn Compatible:** Uses the shadcn registry format — add components with npx shadcn add.
## From shadcn/ui to Remix
| shadcn/ui (React) | shadcn-remix |
| --- | --- |
| `className="w-40"` | `mix={css({ width: '10rem' })}` |
| `` | `` |
| `` | `` |
| `useState` + `onCheckedChange` | `let checked = false` + `handle.update()` |
| `lucide-react` | `#app/ui/icons.tsx` (same icon names) |
# Installation
How to install and set up shadcn-remix in a Remix 3 app.
### 1. Create a Remix app
Start from the Remix 3 starter, or use an existing Remix 3 app.
```bash
npx remix@latest new my-app
```
### 2. Install the headless primitives
Interactive components (dialogs, menus, selects, tabs, …) build on `@remix-run/ui`.
```bash
npm install @remix-run/ui
```
### 3. Add the global styles
The `globals` item adds `app/ui/globals.css`: the theme tokens, the Tailwind-equivalent reset, and the animation keyframes.
```bash
npx shadcn@latest add https://www.shadcn-remix.com/r/globals.json
```
Serve it through your asset server and link it before anything else in `
`. It declares `@layer base, rmx;` so component styles always win over the reset.
```tsx title="app/actions/document.tsx"
import { ImportMap } from 'remix/component/server'
import { assets, scriptEntry } from '../assets.ts'
const globalStylesHref = await assets.getHref('app/ui/globals.css')
export function Document(handle: Handle<{ children?: RemixNode }>) {
return () => (
{handle.props.children}
)
}
```
### 4. Make app/ui browser-reachable
Components run in the browser when they hydrate, so allow `app/ui` (and `@remix-run/ui`) in your asset server, and add the `#app/*` import alias the examples use.
```ts title="app/assets.ts"
export const assets = createAssetServer({
basePath: '/assets',
allowFiles: ['app/routes.ts', 'app/**/public/**', 'app/ui/**'],
allowPackages: ['remix', '@remix-run/ui'],
})
```
```json title="package.json"
{
"imports": {
"#app/*": "./app/*"
}
}
```
### 5. Add components
```bash
npx shadcn@latest add https://www.shadcn-remix.com/r/button.json
```
Components that respond to events must render inside a `clientEntry(...)` boundary so they hydrate:
```tsx title="app/actions/public/settings.tsx"
import { clientEntry, type Handle } from 'remix/component'
import { Switch } from '#app/ui/switch.tsx'
export const Settings = clientEntry(import.meta.url, function Settings(handle: Handle) {
return () =>
})
```
# Theming
Using CSS variables and the css() mixin to theme components.
## How it works
Components read colors and radii from CSS variables defined in `app/ui/globals.css` — exactly the shadcn/ui tokens. Change a variable and every component follows.
```css title="app/ui/globals.css"
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--radius: 0.625rem;
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
}
```
## Dark mode
Add the `dark` class to `` to switch themes. Component styles target `.dark &`, the same as Tailwind’s `dark:` variant.
## Convention
Every color comes as a pair: `--x` for the background and `--x-foreground` for the text on it.
| Variable | Used for |
| --- | --- |
| `--background` / `--foreground` | Page background and default text |
| `--card` / `--card-foreground` | Cards |
| `--popover` / `--popover-foreground` | Popovers, menus, selects |
| `--primary` / `--primary-foreground` | Primary buttons, active states |
| `--secondary` / `--secondary-foreground` | Secondary buttons |
| `--muted` / `--muted-foreground` | Muted backgrounds and descriptions |
| `--accent` / `--accent-foreground` | Hover and highlighted items |
| `--destructive` | Destructive actions and errors |
| `--border`, `--input`, `--ring` | Borders, inputs, focus rings |
| `--sidebar-*` | The sidebar component |
| `--chart-1` … `--chart-5` | Charts |
## Radius
`--radius` drives every corner: `calc(var(--radius) - 4px)` for small elements, `calc(var(--radius) - 2px)` for controls, `var(--radius)` for surfaces and `calc(var(--radius) + 4px)` for cards.
## Customizing components
Every component accepts `mix`, applied after its own styles. Each `css()` call is its own cascade layer, ordered by first use, so your mix always wins over the component — no `!important`, no class merging.
```tsx
```
# Registry
How the shadcn-remix registry is structured and how to consume it with the shadcn CLI.
shadcn-remix is a [shadcn registry](https://ui.shadcn.com/docs/registry) — a collection of components distributed as source code over HTTP. The `shadcn` CLI reads a JSON descriptor for each item and copies its files straight into your project.
## Installing an item
Point the CLI at any item’s JSON URL:
```bash
npx shadcn@latest add https://www.shadcn-remix.com/r/button.json
```
The CLI installs the npm dependencies, pulls in the registry dependencies, and writes the files to `app/ui/`. You own the code from that point on.
## Namespaced registry
Add the registry to `components.json` under `registries` to install items by name.
```json title="components.json"
{
"registries": {
"@shadcn-remix": "https://www.shadcn-remix.com/r/{name}.json"
}
}
```
```bash
npx shadcn@latest add @shadcn-remix/button @shadcn-remix/dialog
```
## Registry structure
[/r/registry.json](/r/registry.json) lists every item, and `/r/.json` serves one item with its file contents. A component item looks like this:
```json title="/r/dialog.json"
{
"name": "dialog",
"type": "registry:ui",
"dependencies": ["remix"],
"registryDependencies": [
"https://www.shadcn-remix.com/r/globals.json",
"https://www.shadcn-remix.com/r/button.json",
"https://www.shadcn-remix.com/r/icons.json"
],
"files": [
{
"path": "app/ui/dialog.tsx",
"type": "registry:file",
"target": "app/ui/dialog.tsx",
"content": "…"
}
]
}
```
- `dependencies` — npm packages the CLI installs for you. Every component needs `remix`; components built on its headless primitives also need `@remix-run/ui`.
- `registryDependencies` — other items of this registry, installed automatically. Every component depends on `globals`.
- `files` — each component is one `registry:file` with an explicit `target`, so the CLI writes it to `app/ui/` without a Tailwind or framework preset.
## Support items
| Item | File | Contents |
| --- | --- | --- |
| `globals` | `app/ui/globals.css` | Theme tokens, preflight, and keyframes |
| `icons` | `app/ui/icons.tsx` | Lucide icons as Remix components |
## No build step
The registry is served straight from the component sources in `app/ui/`, so there is nothing to rebuild after editing a component — the next request returns the new file.
> Want to publish your own registry? Follow the official [registry guide](https://ui.shadcn.com/docs/registry/getting-started).
# MCP
Install components from this registry with your AI coding agent via the shadcn MCP server.
The [shadcn MCP server](https://ui.shadcn.com/docs/mcp) lets AI coding agents browse and install registry items for you. Point it at this registry and you can ask for “the button and dialog components” and the agent runs the install.
## Configure the registry
Add this registry to your project’s `components.json` under `registries`:
```json title="components.json"
{
"registries": {
"@shadcn-remix": "https://www.shadcn-remix.com/r/{name}.json"
}
}
```
## Add the MCP server
### Claude Code
Run the shadcn MCP init command, or add the server to `.mcp.json` manually:
```bash
npx shadcn@latest mcp init --client claude
```
```json title=".mcp.json"
{
"mcpServers": {
"shadcn": {
"command": "npx",
"args": ["shadcn@latest", "mcp"]
}
}
}
```
### Cursor
Run the shadcn MCP init command, or add the server to `.cursor/mcp.json` manually:
```bash
npx shadcn@latest mcp init --client cursor
```
```json title=".cursor/mcp.json"
{
"mcpServers": {
"shadcn": {
"command": "npx",
"args": ["-y", "shadcn@latest", "mcp"]
}
}
}
```
### VS Code
Run the shadcn MCP init command, or add the server to `.vscode/mcp.json` manually:
```bash
npx shadcn@latest mcp init --client vscode
```
```json title=".vscode/mcp.json"
{
"servers": {
"shadcn": {
"command": "npx",
"args": ["shadcn@latest", "mcp"]
}
}
}
```
## Use it
Once configured, prompt your agent naturally:
```text
Show me the components available in the @shadcn-remix registry.
Add the dialog and dropdown-menu components to my project.
```
The agent reads each item’s JSON, installs the npm dependencies, and writes the sources into `app/ui/` — the same result as running the CLI yourself.
> The MCP server reads the registries from `components.json`. Make sure the `@shadcn-remix` entry above is present before starting your agent.
## Docs for LLMs
Agents that read documentation directly can start from [/llms.txt](/llms.txt), an index of every page, or fetch all of it at once from [/llms-full.txt](/llms-full.txt). Append `.md` to any docs URL for its markdown, like [/docs/installation.md](/docs/installation.md).
# Changelog
Notable changes to the shadcn-remix registry and docs.
## November 2026
### Initial release
The first release of shadcn-remix: 36 shadcn/ui components ported to Remix 3.
Install them with the shadcn CLI or MCP from the registry at `/r/registry.json`.
# Components
- [Accordion](/docs/components/accordion): A vertically stacked set of interactive headings that each reveal a section of content.
- [Alert](/docs/components/alert): Displays a callout for user attention.
- [Avatar](/docs/components/avatar): An image element with a fallback for representing the user.
- [Badge](/docs/components/badge): Displays a badge or a component that looks like a badge.
- [Breadcrumb](/docs/components/breadcrumb): Displays the path to the current resource using a hierarchy of links.
- [Button](/docs/components/button): Displays a button or a component that looks like a button.
- [Card](/docs/components/card): Displays a card with header, content, and footer.
- [Checkbox](/docs/components/checkbox): A control that allows the user to toggle between checked and not checked.
- [Combobox](/docs/components/combobox): Autocomplete input with a list of suggestions.
- [Context Menu](/docs/components/context-menu): Displays a menu of actions triggered by a right click.
- [Dialog](/docs/components/dialog): A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.
- [Dropdown Menu](/docs/components/dropdown-menu): Displays a menu to the user — such as a set of actions or functions — triggered by a button.
- [Empty](/docs/components/empty): Use the Empty component to display an empty state.
- [Field](/docs/components/field): Combine labels, controls, and help text to compose accessible form fields and grouped inputs.
- [Hover Card](/docs/components/hover-card): For sighted users to preview content available behind a link.
- [Input](/docs/components/input): A text input component for forms and user data entry with built-in styling and accessibility features.
- [Input Group](/docs/components/input-group): Add addons, buttons, and helper content to inputs.
- [Item](/docs/components/item): A versatile component for displaying content with media, title, description, and actions.
- [Kbd](/docs/components/kbd): Used to display textual user input from keyboard.
- [Label](/docs/components/label): Renders an accessible label associated with controls.
- [Popover](/docs/components/popover): Displays rich content in a portal, triggered by a button.
- [Progress](/docs/components/progress): Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
- [Radio Group](/docs/components/radio-group): A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
- [Select](/docs/components/select): Displays a list of options for the user to pick from—triggered by a button.
- [Separator](/docs/components/separator): Visually or semantically separates content.
- [Sheet](/docs/components/sheet): Extends the Dialog component to display content that complements the main content of the screen.
- [Sidebar](/docs/components/sidebar): A composable, themeable and customizable sidebar component.
- [Skeleton](/docs/components/skeleton): Use to show a placeholder while content is loading.
- [Spinner](/docs/components/spinner): An indicator that can be used to show a loading state.
- [Switch](/docs/components/switch): A control that allows the user to toggle between checked and not checked.
- [Table](/docs/components/table): A responsive table component.
- [Tabs](/docs/components/tabs): A set of layered sections of content—known as tab panels—that are displayed one at a time.
- [Textarea](/docs/components/textarea): Displays a form textarea or a component that looks like a textarea.
- [Toggle](/docs/components/toggle): A two-state button that can be either on or off.
- [Toggle Group](/docs/components/toggle-group): A set of two-state buttons that can be toggled on or off.
- [Tooltip](/docs/components/tooltip): A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
# Accordion
A vertically stacked set of interactive headings that each reveal a section of content.
```tsx
import { css } from 'remix/component'
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '#app/ui/accordion.tsx'
const contentStyles = css({
display: 'flex',
flexDirection: 'column',
gap: '1rem',
textWrap: 'balance',
})
export function AccordionDemo() {
return () => (
Product Information
Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it
offers unparalleled performance and reliability.
Key features include advanced processing capabilities, and an intuitive user interface designed for both
beginners and experts.
Shipping Details
We offer worldwide shipping through trusted courier partners. Standard delivery takes 3-5 business days,
while express shipping ensures delivery within 1-2 business days.
All orders are carefully packaged and fully insured. Track your shipment in real-time through our dedicated
tracking portal.
Return Policy
We stand behind our products with a comprehensive 30-day return policy. If you're not completely
satisfied, simply return the item in its original condition.
Our hassle-free return process includes free return shipping and full refunds processed within 48 hours of
receiving the returned item.
)
}
```
## Installation
```bash
npx shadcn@latest add https://www.shadcn-remix.com/r/accordion.json
```
## Usage
```tsx
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from '#app/ui/accordion.tsx'
```
```tsx
Is it accessible?
Yes. It adheres to the WAI-ARIA design pattern.
```
## Composition
Use the following composition to build an `Accordion`:
```tsx
Accordion
└── AccordionItem
├── AccordionTrigger
└── AccordionContent
```
## API Reference
### Accordion
Root `