mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-30 16:14:13 +00:00
* feat(v4): update home page * fix * fix: cards * feat(v4): charts page * feat: update pages * feat: colors * fix * feat: add docs * feat: mdx work * fix * fix * fix: sidebar * fix: lint * feat: updates * feat: update components * feat: fix docs * fix: responsive * feat: implement cmdk * fix: update navigation menu demo * fix: code style * fix: themes * feat: implement blocks page * fix: docs config * refactor * fix: outputFileTracingIncludes * fix * fix: output * fix * fix: registry * refactor: move docs * debug: docs * debug * revert * fix: mjs * deps: pin fumadocs * debug * fix: downgrade next * fix: index page * refactor: move mdx components * fix: remove copy button * fix * was it zod * yes it was * remove copy page * fix: color page * fix: colors page * fix: meta colors * fix: copy button * feat: sync registry * fix: registry build script * feat: update port * feat: clean up examples * fix * fix: mobile nav * fix: blur for mobile * fix: sidebar nav * feat: update examples * fix: build scripts * feat: update components * feat: restyle * fix: types * fix: styles * fix: margins * fix: screenshots * fix * feat: update theme * fix: charts nav * fix: image * feat: optimize images * fix: menu * fix: card * fix: border * check * feat: implement charts page * fix: charts * fix: og images * feat: extend touch * fix: static * fix: sizing * fix: mobile screenshots * fix: page nav * fix * feat: update favicon * fix: theme selector * fix: feedback * fix: sink * docs: update * fix: styles * chore: update registry * fix: command * fix * fix: minor updates * fix: typography on smaller devices * fix: format * fix: remove unused icon * feat: update favicon * fix: typography * docs: typography page * fix: steps
78 lines
4.3 KiB
Plaintext
78 lines
4.3 KiB
Plaintext
---
|
||
title: Introduction
|
||
description: shadcn/ui is a set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks and AI models. Open Source. Open Code.
|
||
---
|
||
|
||
**This is not a component library. It is how you build your component library.**
|
||
|
||
You know how most traditional component libraries work: you install a package from NPM, import the components, and use them in your app.
|
||
|
||
This approach works well until you need to customize a component to fit your design system or require one that isn’t included in the library. **Often, you end up wrapping library components, writing workarounds to override styles, or mixing components from different libraries with incompatible APIs.**
|
||
|
||
This is what shadcn/ui aims to solve. It is built around the following principles:
|
||
|
||
- **Open Code:** The top layer of your component code is open for modification.
|
||
- **Composition:** Every component uses a common, composable interface, making them predictable.
|
||
- **Distribution:** A flat-file schema and command-line tool make it easy to distribute components.
|
||
- **Beautiful Defaults:** Carefully chosen default styles, so you get great design out-of-the-box.
|
||
- **AI-Ready:** Open code for LLMs to read, understand, and improve.
|
||
|
||
## Open Code
|
||
|
||
shadcn/ui hands you the actual component code. You have full control to customize and extend the components to your needs. This means:
|
||
|
||
- **Full Transparency:** You see exactly how each component is built.
|
||
- **Easy Customization:** Modify any part of a component to fit your design and functionality requirements.
|
||
- **AI Integration:** Access to the code makes it straightforward for LLMs to read, understand, and even improve your components.
|
||
|
||
_In a typical library, if you need to change a button’s behavior, you have to override styles or wrap the component. With shadcn/ui, you simply edit the button code directly._
|
||
|
||
<Accordion collapsible>
|
||
<AccordionItem value="faq-1" className="border-none">
|
||
<AccordionTrigger>
|
||
How do I pull upstream updates in an Open Code approach?
|
||
</AccordionTrigger>
|
||
<AccordionContent>
|
||
<p>
|
||
shadcn/ui follows a headless component architecture. This means the core
|
||
of your app can receive fixes by updating your dependencies, for
|
||
instance, radix-ui or input-otp.
|
||
</p>
|
||
<p className="mt-4">
|
||
The topmost layer, i.e., the one closest to your design system, is not
|
||
coupled with the implementation of the library. It stays open for
|
||
modification.
|
||
</p>
|
||
</AccordionContent>
|
||
</AccordionItem>
|
||
</Accordion>
|
||
|
||
## Composition
|
||
|
||
Every component in shadcn/ui shares a common, composable interface. **If a component does not exist, we bring it in, make it composable, and adjust its style to match and work with the rest of the design system.**
|
||
|
||
_A shared, composable interface means it's predictable for both your team and LLMs. You are not learning different APIs for every new component. Even for third-party ones._
|
||
|
||
## Distribution
|
||
|
||
shadcn/ui is also a code distribution system. It defines a schema for components and a CLI to distribute them.
|
||
|
||
- **Schema:** A flat-file structure that defines the components, their dependencies, and properties.
|
||
- **CLI:** A command-line tool to distribute and install components across projects with cross-framework support.
|
||
|
||
_You can use the schema to distribute your components to other projects or have AI generate completely new components based on existing schema._
|
||
|
||
## Beautiful Defaults
|
||
|
||
shadcn/ui comes with a large collection of components that have carefully chosen default styles. They are designed to look good on their own and to work well together as a consistent system:
|
||
|
||
- **Good Out-of-the-Box:** Your UI has a clean and minimal look without extra work.
|
||
- **Unified Design:** Components naturally fit with one another. Each component is built to match the others, keeping your UI consistent.
|
||
- **Easily Customizable:** If you want to change something, it's simple to override and extend the defaults.
|
||
|
||
## AI-Ready
|
||
|
||
The design of shadcn/ui makes it easy for AI tools to work with your code. Its open code and consistent API allow AI models to read, understand, and even generate new components.
|
||
|
||
_An AI model can learn how your components work and suggest improvements or even create new components that integrate with your existing design._
|