ecommerce-template/packages/ui
2025-06-22 20:56:14 +08:00
..
src doc: update readme 2025-06-21 22:47:31 +08:00
components.json chore: add shadcn 2025-06-19 03:46:59 +08:00
eslint.config.mjs feat(create-turbo): create kitchen-sink 2025-06-19 02:40:01 +08:00
package.json chore: fix shadcn imports again 2025-06-20 23:12:56 +08:00
postcss.config.mjs chore: add shadcn 2025-06-19 03:46:59 +08:00
README.md docs: update @repo/ui readme 2025-06-22 20:56:14 +08:00
tailwind.config.ts chore: use tsup to build ui instead of bunchee 2025-06-20 17:40:59 +08:00
tsconfig.json chore: use tsup to build ui instead of bunchee 2025-06-20 17:40:59 +08:00
tsup.config.ts chore: use tsup to build ui instead of bunchee 2025-06-20 17:40:59 +08:00
turbo.json chore: add shadcn integration for remix 2025-06-19 22:45:11 +08:00

@repo/ui

Shared UI components for frontend use. This package has already been set up with dummy React UI library (<CounterButton> and <Link> components) and shadcn/ui components (<Button> and <Card>).

What's inside?

This repo includes the following packages and apps:

Apps and Packages

  • tailwindcss: Tailwind CSS configuration for styling
  • postcss: PostCSS configuration for processing CSS
  • shadcn/ui: shadcn/ui components for UI
  • tsup: TypeScript bundler for building the UI components

Building and Running

Building the UI will require exporting the components in the package.json file.

For Vite apps, vite-tsconfig-paths package is required to ensure the UI components are properly built and available for use.

For Next.js apps, the next.config.ts file needs to have transpilePackages: ["@repo/ui"] to ensure the UI components are properly built and available for use.

Although not required, adding:

"paths": {
	"@repo/ui/*": ["../../packages/ui/src/*"]
}

in the tsconfig.json file of each app can help with TypeScript path resolution during development.

More Information

shadcn/ui for UI components

To use the CLI, run npx shadcn@latest add <component-name> in the @repo/ui package directory.

It can also be run at each app directory and the CLI will automatically install @radix-ui/react-slot add the components to the shared @repo/ui package. Each app will need its own components.json file and the paths in the tsconfig.json file should be updated accordingly.

Tailwind CSS v4 for styling and to use shadcn/ui

Each app needs its own tailwind.config.jsfile and postcss.config.js file but they all extend from the shared @repo/ui/tailwind.config.js and @repo/ui/postcss.config.js files.