Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Card
- Checkbox
- Collapsible
- Combobox
- Context Menu
- Date Picker (Lite)
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP (Lite)
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
Create a project
Create a HonoX project with the x-basic template, or use your own:
pnpm create hono@latest my-appnpm create hono@latest my-appyarn create hono@latest my-appbun create hono@latest my-appAdd Tailwind CSS
pnpm add tailwindcss @tailwindcss/vitenpm install tailwindcss @tailwindcss/viteyarn add tailwindcss @tailwindcss/vitebun add tailwindcss @tailwindcss/viteAdd the plugin and the stylesheet to vite.config.ts:
import tailwindcss from "@tailwindcss/vite"
import honox from "honox/vite"
import { defineConfig } from "vite"
export default defineConfig({
plugins: [
honox({
client: { input: ["/app/client.ts", "/app/style.css"] },
}),
tailwindcss(),
],
// The CLI installs components into ./components/ui.
resolve: { alias: { "@": import.meta.dirname } },
})Run the CLI
pnpm dlx shadcnui-hono-jsx@latest init --preset b0npx shadcnui-hono-jsx@latest init --preset b0yarn dlx shadcnui-hono-jsx@latest init --preset b0bunx shadcnui-hono-jsx@latest init --preset b0Import the theme
@import "tailwindcss" source("../app");
@import "../styles/shadcn/theme.css";
@source "../components";Load the stylesheet in your renderer:
import { jsxRenderer } from "hono/jsx-renderer"
import { Link, Script } from "honox/server"
export default jsxRenderer(({ children }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<Link href="/app/style.css" rel="stylesheet" />
<Script src="/app/client.ts" async />
</head>
<body>{children}</body>
</html>
))Add components
pnpm dlx shadcnui-hono-jsx@latest add buttonnpx shadcnui-hono-jsx@latest add buttonyarn dlx shadcnui-hono-jsx@latest add buttonbunx shadcnui-hono-jsx@latest add buttonUse them
import { createRoute } from "honox/factory"
import { Button } from "@/components/ui/button"
export default createRoute((c) =>
c.render(<Button>Click me</Button>)
)Add the same alias to tsconfig.json ("paths": { "@/*": ["./*"] }) for type checking. HonoX serves public/ already, so the client scripts that add installs in public/shadcn/ are available at /shadcn/.