Skip to content
Discussion options

You must be logged in to vote

The safest way to customize shadcn-ui components in production is to treat them as your internal design system — not as a dependency you modify directly.

Since shadcn-ui copies components into your project, you have full control. But to keep things maintainable:

  1. Prefer wrapping over editing core logic.

Instead of heavily modifying the original component file, create wrapper components:

// components/ui/custom-button.tsx
import { Button } from "@/components/ui/button"
export function PrimaryButton(props) {
  return (
    <Button
      className="bg-blue-600 hover:bg-blue-700 text-white"
      {...props}
    />
  )
}

This keeps upstream structure intact.

  1. Use variants properly.

If a co…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xqbuilds12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants