A modern component and hooks library for React projects, inspired by shadcn/ui, that lets you easily add beautiful UI components and useful hooks to your projects.
# Initialize Modern UI
npx @modern-core/ui init
# Add components
npx @modern-core/ui add button
npx @modern-core/ui add card
# Add hooks
npx @modern-core/ui add use-media-query
npx @modern-core/ui add use-debounce
Upon initialization, a modern-ui.json
file is created in your project:
{
"style": "default",
"path": "src/components/modern-ui",
"typescript": true,
"tailwind": true,
"tailwindVersion": "v4",
"framework": "next",
"theme": "default",
"aliases": {
"cn": "@/lib/utils",
"hook": "@/hooks"
},
"components": []
}
style
: UI style (currently only "default")path
: Component installation locationtypescript
: TypeScript support toggletailwind
: Tailwind CSS support toggletailwindVersion
: Tailwind version (v3 or v4)framework
: Detected framework (next or vite)theme
: Theme selection for styling (options: "default", "blue")aliases
: Custom import pathscn
: Import path for className utilityhook
: Import path for hookscomponents
: Tracks installed components and hooksModern UI allows you to install both UI components and custom hooks:
# Install components
npx @modern-core/ui add button
npx @modern-core/ui add card
# Install hooks
npx @modern-core/ui add use-media-query
npx @modern-core/ui add use-click-outside
Hooks are automatically installed to your configured hook directory (aliases.hook
path).
Modern UI detects your project framework and configures components accordingly.
If Tailwind CSS isn't detected during initialization, Modern UI will offer to install and configure it.
Modern UI comes with multiple theme options:
During initialization, you'll be asked to select a theme which will set up the appropriate Tailwind CSS configuration. This includes:
You can also manually update your theme by modifying the Tailwind configuration file directly.
cn
utility for className merging is automatically imported from your configured pathWhen adding components with external dependencies:
# List installed components and hooks
npx @modern-core/ui version
# Install specific versions
npx @modern-core/ui add button --version 0.9.0
# Check available versions
npx @modern-core/ui version --available button
# Update components
npx @modern-core/ui version --update button
Modern UI can automatically configure path aliases in your project:
ISC