Installation
Add Hextech UI to your React project.
Use React 19 and Tailwind CSS v4. The shadcn CLI adds editable components to your source.
This setup applies Hextech to the whole app. For an existing shadcn app with a separate Hextech region, follow Using with shadcn.
Prepare your project
In an existing Next.js or Vite project, initialize shadcn if you haven't already:
npx shadcn@latest initNeed an app first? Follow the Next.js or Vite setup guide, then return here.
Add a component
Run this from your app directory:
npx shadcn@latest add https://hextech-ui.vercel.app/r/button.jsonThis installs the Button source, its dependencies and theme stylesheets, including an optional global bridge. For JavaScript, set "tsx": false in components.json; the CLI converts the source to JSX/JS. For an existing shadcn app, follow Using with shadcn to keep component files and theme settings separate.
Import the styles
Add these imports after Tailwind in your global stylesheet. These paths assume your app uses a src/ directory.
@import 'tailwindcss';
@import '../styles/hextech-tokens.css';
@import '../styles/hextech-theme.css';
@import '../styles/hextech-tailwind.css';
@import '../styles/hextech-components.css';
@import '../styles/hextech-tailwind-global.css';Keep your app's existing CSS imports and variables. If your directories differ, adjust the relative paths to the installed styles/ folder.
The last import intentionally applies Hextech values to ordinary Tailwind utilities across the app. Omit it when using scoped Hextech regions beside existing shadcn components.
Set the theme
Add these attributes to your existing root <html> element:
<html data-hextech-ui-theme="hextech" data-color-mode="dark"></html>Use data-color-mode="light" for light mode. In Next.js, edit src/app/layout.tsx or .jsx; in Vite, edit index.html.
Try it
Import the Button from your own components directory. Open Code to copy a complete example.
Button
Browse all components or follow Getting started for interactive examples. Registry covers custom addresses and namespace setup.