
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@codapet/design-system
Advanced tools
A comprehensive React component library built with Shadcn UI, Radix UI, Tailwind CSS, and TypeScript.
A comprehensive React component library built with Shadcn UI, Radix UI, Tailwind CSS, and TypeScript.
npm install @codapet/design-system
The library requires React and React DOM as peer dependencies. Make sure you have them installed:
npm install react react-dom
Note for CI/builders (e.g., Vercel, GitHub Actions): since this package is public on npm, no extra auth or .npmrc
is required. Just run your normal install command.
Note: The library supports React 18.0.0 and above. For best compatibility, use React 18.2.0 or later.
Follow these steps to integrate the design system in a brand-new Next.js app.
npx create-next-app@latest my-app
cd my-app
npm install -D @tailwindcss/postcss
Create postcss.config.mjs
(if you don't have one):
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
'@tailwindcss/postcss': {},
},
}
export default config
npm install @codapet/design-system
Edit app/globals.css
:
@import "tailwindcss";
/* Tell Tailwind where to scan for class usage */
@source "../**/*.{js,ts,jsx,tsx,mdx}";
@source "../../node_modules/@codapet/design-system/dist/**/*.{js,mjs,ts,tsx}";
/* Import the design system tokens and base styles (after Tailwind) */
@import "@codapet/design-system/styles";
// app/layout.tsx
import type { Metadata } from 'next'
import './globals.css'
export const metadata: Metadata = { title: 'My App' }
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
// app/page.tsx
import { Button, Card, CardContent, CardHeader, CardTitle } from '@codapet/design-system'
export default function Page() {
return (
<main className="p-8">
<Card>
<CardHeader>
<CardTitle>Hello</CardTitle>
</CardHeader>
<CardContent>
<Button>Works!</Button>
</CardContent>
</Card>
</main>
)
}
npm run dev
If you are on Tailwind v3, use a config-based content scan instead of @source
(see below in Styling).
import { Button, Card, Input } from '@codapet/design-system'
function App() {
return (
<div>
<Card>
<Input placeholder="Enter your name" />
<Button>Click me</Button>
</Card>
</div>
)
}
The library exports all UI components from the components/ui
directory:
import {
Accordion,
Alert,
AlertDialog,
AspectRatio,
Avatar,
Badge,
Breadcrumb,
Button,
Calendar,
Card,
Carousel,
Chart,
Checkbox,
Collapsible,
Command,
ContextMenu,
Dialog,
Drawer,
DropdownMenu,
Form,
HoverCard,
Input,
InputOTP,
Label,
Menubar,
NavigationMenu,
Pagination,
Popover,
Progress,
RadioGroup,
Resizable,
ScrollArea,
Select,
Separator,
Sheet,
Sidebar,
Skeleton,
Slider,
Sonner,
Switch,
Table,
Tabs,
Textarea,
Toggle,
ToggleGroup,
Tooltip,
} from '@codapet/design-system'
import { cn } from '@codapet/design-system'
// Utility function for merging class names
const className = cn('base-class', 'conditional-class')
import { useIsMobile } from '@codapet/design-system'
function MyComponent() {
const isMobile = useIsMobile()
// ...
}
npm install
npm run dev
- Start the development servernpm run build:lib
- Build the library for distributionnpm run build:all
- Build both the library and the demo appnpm run lint
- Run ESLintnpm run test:lib
- Test the library buildnpm run check:deps
- Check dependency treenpm run clean:deps
- Clean and reinstall dependenciesTo build the library as an npm package:
npm run build:lib
This will generate:
dist/index.mjs
- ES Module bundledist/index.d.mts
- TypeScript declarationsReleases are automated via GitHub Actions on semver tags.
Setup once:
NPM_TOKEN
with publish access to the @codapet
org.Release steps:
# update version in package.json
git commit -am "chore(release): v1.2.3"
git tag v1.2.3
git push --follow-tags
The workflow builds, tests, and runs npm publish --access public
.
The design system uses Tailwind CSS for styling. Make sure to include Tailwind CSS in your project and configure Tailwind to scan this package so utilities used inside it are generated.
app/globals.css
), add @source
to include the design system and import its stylesheet after Tailwind:@import "tailwindcss";
/* Tell Tailwind to scan the design system in node_modules */
@source "../**/*.{js,ts,jsx,tsx,mdx}";
@source "../../node_modules/@codapet/design-system/dist/**/*.{js,mjs,ts,tsx}";
/* Import the design system CSS tokens and base layers */
@import "@codapet/design-system/styles";
// app/layout.tsx
import "./globals.css";
If you are still on Tailwind v3, use the content globs instead of @source
:
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./app/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./node_modules/@codapet/design-system/dist/**/*.{js,mjs,ts,tsx}',
],
theme: { extend: {} },
plugins: [],
}
globals.css
contains @source
that points to the design system in node_modules
(Tailwind must see class usage to emit utilities).@source
or Tailwind config.@import "@codapet/design-system/styles";
comes after @import "tailwindcss";
.content
globs as shown above.@tailwindcss/postcss
is installed and present in postcss.config.*
.tw-animate-css
, install it in the app: npm i -D tw-animate-css
.rm -rf .next
then npm run dev
.For detailed information about how dependencies are organized and managed, see DEPENDENCIES.md.
MIT License - see LICENSE file for details.
FAQs
A comprehensive React component library built with Shadcn UI, Radix UI, Tailwind CSS, and TypeScript.
The npm package @codapet/design-system receives a total of 123 weekly downloads. As such, @codapet/design-system popularity was classified as not popular.
We found that @codapet/design-system demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.