stylexcn

Components

Implemented StyleX components. Each page is a live demo - click, type, and open overlays. Pixel-perfect with official shadcn/ui.

Install

Add a component with the official shadcn CLI. The consumer project must already compile StyleX (@stylexjs/stylex plus a bundler plugin). Tailwind init is not enough.

pnpm dlx shadcn@latest add https://stylexcn.vercel.app/r/button.json

Optional namespace:

pnpm dlx shadcn@latest registry add @stylexcn=https://stylexcn.vercel.app/r/{name}.json
pnpm dlx shadcn@latest add @stylexcn/button

Dark mode

Add the optional theme item to install the dark StyleX token values. Apply its theme class and the dark class to the same ancestor.

pnpm dlx shadcn@latest add https://stylexcn.vercel.app/r/theme.json
pnpm dlx shadcn@latest add @stylexcn/theme
import * as stylex from '@stylexjs/stylex';
import { darkTheme } from '@/lib/theme.stylex';

const themeProps = stylex.props(darkTheme);

<div
  {...themeProps}
  className={['dark', themeProps.className].filter(Boolean).join(' ')}
/>

List the catalog:

pnpm dlx shadcn@latest list https://stylexcn.vercel.app/r/registry.json

Catalog

AccordionA vertically stacked set of headings that reveal related content.AlertInline callout for default or destructive messages.Alert DialogA modal for confirming destructive actions.Aspect RatioConstrains content to a ratio. Fill is up to the caller.AvatarUser image or initials, with sizes, badge, and group.BadgeSmall status labels: default, secondary, destructive, outline, ghost, link.BreadcrumbTrail of links to the current page, with an optional ellipsis.ButtonPrimary actions across variant and size.Button GroupJoins related buttons, inputs, or selects into one control.CalendarA monthly date grid. Pick a day or a range. Month is pinned so the preview does not drift.CardContainer for header, body, and footer.CarouselA carousel with motion and swipe. Horizontal by default; Previous and Next. Slide is pinned so the preview does not drift.ChartThemed Recharts charts with tooltip and legend. Data is pinned and animation is off so the preview does not drift.CheckboxBoolean control with checked, disabled, and invalid states.CollapsibleShow and hide a panel from a trigger. Chrome is up to you.ComboboxAutocomplete with a suggestion list. Open, type, select, and chips.CommandCommand menu for search and quick actions. Type to filter, select an item, or open CommandDialog.Context MenuRight-click menu. Use the dashed box on the demo page.DialogCentered modal you can open, edit, and close.DrawerA panel that slides in from an edge of the screen. Open bottom, left, right, or top.Dropdown MenuMenu from a button, including items, checkboxes, and radios.EmptyPlaceholder for a vacant list or page. Media, title, description, and optional action.FieldCompose labels, controls, descriptions, and errors into a form field.FormReact Hook Form bindings for labels, controls, descriptions, and messages. Values and errors are pinned so the preview does not drift.Hover CardPreview card on hover or focus.InputSingle-line field. Try typing, disabled, and invalid.Input GroupInput or textarea with inline or block addons: text, icons, buttons, and kbd.Input OTPOne-time password slots. Type into the group, including a separator.KbdKeyboard shortcut glyphs, alone or grouped.LabelCaption for a form control. Pair it with Input.MenubarApplication menu bar. Open File to pick an item.Native SelectNative HTML select with shadcn/ui styling. Default and sm.Navigation MenuA collection of links for site navigation. Open a trigger to show the viewport.PaginationPage navigation with an active page and ellipsis.PopoverFloating panel opened from a click.ProgressProgress bar at empty, in-progress, and complete.Radio GroupSingle-choice radios, including disabled.ResizableSplit panes. Drag the handle to change the ratio.Scroll AreaScrollable region. Vertical list and horizontal strip.SelectCustom dropdown. Open default and sm sizes.SeparatorHorizontal or vertical divider.SheetEdge panel from right, left, top, or bottom.SidebarA collapsible sidebar with menu groups. Open and collapsed states are pinned so the preview does not drift.SkeletonLoading placeholder. Rounded bar and circle.SliderNumeric slider. Single thumb, range, and disabled.SonnerA toast. Built on sonner.SpinnerLoading indicator at size 3, 4, 6, and 8.SwitchOn/off toggle you can click.TableData table with header, rows, footer, and caption.TabsSwitch between panels.TextareaMultiline field. Try typing, disabled, and invalid.ToggleLatching button with variant and size.Toggle GroupGrouped toggles. Single-select Bold / Italic / Underline.TooltipShort hint on hover.