Back to articles
shadcn/ui Has a Free API You Should Know About

shadcn/ui Has a Free API You Should Know About

via Dev.to ReactAlex Spinov

shadcn/ui is not a component library — it's a collection of reusable components you copy into your project. Its CLI, theming system, and customization API give you full control. CLI — Add Components Instantly # Initialize in your project npx shadcn@latest init # Add individual components npx shadcn@latest add button dialog table form # Add all components npx shadcn@latest add --all # Diff — see what changed upstream npx shadcn@latest diff Component API Components you own and customize: import { Button } from " @/components/ui/button " import { Dialog , DialogContent , DialogDescription , DialogHeader , DialogTitle , DialogTrigger , DialogFooter } from " @/components/ui/dialog " import { Input } from " @/components/ui/input " import { Label } from " @/components/ui/label " export function EditProfile () { return ( < Dialog > < DialogTrigger asChild > < Button variant = "outline" > Edit Profile </ Button > </ DialogTrigger > < DialogContent className = "sm:max-w-[425px]" > < DialogHeader

Continue reading on Dev.to React

Opens in a new tab

Read Full Article
7 views

Related Articles