mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-28 23:24:13 +00:00
# Conflicts: # apps/v4/examples/base/ui/combobox.tsx # apps/v4/examples/base/ui/context-menu.tsx # apps/v4/examples/base/ui/dropdown-menu.tsx # apps/v4/examples/base/ui/hover-card.tsx # apps/v4/examples/base/ui/menubar.tsx # apps/v4/examples/base/ui/popover.tsx # apps/v4/examples/base/ui/select.tsx # apps/v4/examples/base/ui/tooltip.tsx # apps/v4/examples/radix/ui/menubar.tsx # apps/v4/examples/radix/ui/select.tsx # apps/v4/public/r/styles/base-lyra/context-menu.json # apps/v4/public/r/styles/base-lyra/dropdown-menu.json # apps/v4/public/r/styles/base-lyra/hover-card.json # apps/v4/public/r/styles/base-lyra/popover.json # apps/v4/public/r/styles/base-lyra/tooltip-example.json # apps/v4/public/r/styles/base-lyra/tooltip.json # apps/v4/public/r/styles/base-maia/context-menu.json # apps/v4/public/r/styles/base-maia/dropdown-menu.json # apps/v4/public/r/styles/base-maia/hover-card.json # apps/v4/public/r/styles/base-maia/popover.json # apps/v4/public/r/styles/base-maia/tooltip-example.json # apps/v4/public/r/styles/base-maia/tooltip.json # apps/v4/public/r/styles/base-mira/context-menu.json # apps/v4/public/r/styles/base-mira/dropdown-menu.json # apps/v4/public/r/styles/base-mira/hover-card.json # apps/v4/public/r/styles/base-mira/popover.json # apps/v4/public/r/styles/base-mira/tooltip-example.json # apps/v4/public/r/styles/base-mira/tooltip.json # apps/v4/public/r/styles/base-nova/context-menu.json # apps/v4/public/r/styles/base-nova/dropdown-menu.json # apps/v4/public/r/styles/base-nova/hover-card.json # apps/v4/public/r/styles/base-nova/popover.json # apps/v4/public/r/styles/base-nova/tooltip-example.json # apps/v4/public/r/styles/base-nova/tooltip.json # apps/v4/public/r/styles/base-vega/context-menu.json # apps/v4/public/r/styles/base-vega/dropdown-menu.json # apps/v4/public/r/styles/base-vega/hover-card.json # apps/v4/public/r/styles/base-vega/popover.json # apps/v4/public/r/styles/base-vega/tooltip-example.json # apps/v4/public/r/styles/base-vega/tooltip.json # apps/v4/public/r/styles/radix-mira/menubar.json # apps/v4/public/r/styles/radix-nova/menubar.json # apps/v4/registry/bases/base/examples/tooltip-example.tsx # apps/v4/registry/bases/base/ui/hover-card.tsx # apps/v4/registry/bases/base/ui/popover.tsx # apps/v4/registry/bases/base/ui/tooltip.tsx
Examples
This directory contains demo components for the component documentation.
Directory Structure
examples
├── base
│ ├── ui # Auto-generated by build-registry.mts
│ ├── lib # Auto-generated by build-registry.mts
│ ├── hooks # Auto-generated by build-registry.mts
│ ├── button-demo.tsx
│ └── ...
├── radix
│ ├── ui # Auto-generated by build-registry.mts
│ ├── lib # Auto-generated by build-registry.mts
│ ├── hooks # Auto-generated by build-registry.mts
│ └── ...
└── __index__.tsx # Auto-generated by build-registry.mts
Adding a New Example
- Create a new
.tsxfile inexamples/baseorexamples/radix:
// examples/base/button-loading.tsx
import { Button } from "@/examples/base/ui/button"
export function ButtonLoading() {
return <Button disabled>Loading...</Button>
}
- Run the examples build to regenerate the index:
pnpm examples:build
- Use the example in documentation by referencing its name (filename without
.tsx):
<ComponentPreview name="button-loading" />
Notes
- The
ui,lib, andhooksdirectories are auto-generated duringpnpm registry:build. Do not edit files in these directories directly. - Example files should be placed directly in
examples/baseorexamples/radix, not in subdirectories. - Both named exports and default exports are supported.
- After adding or removing examples, run
pnpm examples:buildto update the index.