Sections
Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- React Hook Form
- Hover Card
- Input
- Input OTP
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll-area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Pre work
- Create a new React project.
- Get started with Tailwind CSS.
Note: accelya-ui supports Tailwind CSS v4.
Install dependencies
Add the required dependencies and accelya-ui.
npm i class-variance-authority clsx tailwind-merge lucide-react tw-animate-cssnpm i accelya-uiFramework configuration
Configure your bundler for the package.
- Next.js (
next.config.js|next.config.mjs)
const nextConfig = {
// ...
transpilePackages: ["accelya-ui"],
};
export default nextConfig;- Vite (
vite.config.ts|vite.config.js)
export default defineConfig({
optimizeDeps: {
include: ['accelya-ui/**/*.{js,jsx,ts,tsx}'],
},
})Add styles
Import the default styles in your global CSS (e.g. src/styles/globals.css, index.css, or app/globals.css).
/* "accelya-ui/index.css" includes `@import "tailwindcss"` */
@import "accelya-ui/index.css";
/* source detection, adjust the path according to your setup */
@source "../../node_modules/accelya-ui";If you have a fully customized theme in your global CSS, see the Custom Theme section below.
Import and use components
import { Button } from 'accelya-ui/ui/button'
import { cn } from 'accelya-ui/lib/utils'
import { useMobile } from 'accelya-ui/hooks/use-mobile'
export function Example() {
const isMobile = useMobile()
return <Button className={cn(isMobile && 'w-full')}>Hello</Button>
}Type declarations and IDE auto‑import
VS Code auto‑import should work out of the box. If it does not, try one of the following:
- Add a reference in your app entry (e.g.
app/layout.tsxin Next.js):
/// <reference types="accelya-ui" />- Update
tsconfig.jsonto include accelya-ui types:
{
"compilerOptions": {
"types": ["...", "./node_modules/accelya-ui/**/*.ts"]
}
}Custom Theme (optional)
You can customize the theme in your global CSS. Refer to shadcn theme for details.
/* "accelya-ui/index.css" includes `@import "tailwindcss"` */
@import "accelya-ui/index.css";
/* source detection, according to the actual path specified */
@source "../../node_modules/accelya-ui";
@custom-variant dark (&:is(.dark *));
:root {
/* your CSS variables */
}
.dark {
/* your dark mode variables */
}
@theme inline {
/* your theme tokens */
}
@layer base {
/* your base styles */
}That's it
You can now start adding and using components from accelya-ui.