Files
ONE-OS/axhub-make/skills/ui-ux-pro-max/data/stacks/shadcn.csv
王冕 a27e3b8e43 feat: sync full workspace including web modules, docs, and configurations to Gitea
Optimized the root .gitignore to exclude virtual environments, node modules,
and temp folders to ensure clean and lightweight version tracking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 18:12:25 +08:00

16 KiB

1NoCategoryGuidelineDescriptionDoDon'tCode GoodCode BadSeverityDocs URL
21SetupUse CLI for installationInstall components via shadcn CLI for proper setupnpx shadcn@latest add component-nameManual copy-paste from docsnpx shadcn@latest add buttonCopy component code manuallyHighhttps://ui.shadcn.com/docs/cli
32SetupInitialize project properlyRun init command to set up components.json and globals.cssnpx shadcn@latest init before adding componentsSkip init and add components directlynpx shadcn@latest initnpx shadcn@latest add button (without init)Highhttps://ui.shadcn.com/docs/installation
44ThemingUse CSS variables for colorsDefine colors as CSS variables in globals.css for themingCSS variables in :root and .darkHardcoded color values in componentsbg-primary text-primary-foregroundbg-blue-500 text-whiteHighhttps://ui.shadcn.com/docs/theming
55ThemingFollow naming conventionUse semantic color names with foreground patternprimary/primary-foreground secondary/secondary-foregroundGeneric color names--primary --primary-foreground--blue --light-blueMediumhttps://ui.shadcn.com/docs/theming
66ThemingSupport dark modeInclude .dark class styles for all custom CSSDefine both :root and .dark color schemesOnly light mode colors.dark { --background: 240 10% 3.9%; }No .dark class stylesHighhttps://ui.shadcn.com/docs/dark-mode
711DialogUse Dialog for modal contentDialog component for overlay modal windowsDialog for confirmations forms detailsAlert for modal content<Dialog><DialogContent><Alert> styled as modalHighhttps://ui.shadcn.com/docs/components/dialog
812DialogHandle dialog state properlyUse open and onOpenChange for controlled dialogsControlled state with useStateUncontrolled with default open only<Dialog open={open} onOpenChange={setOpen}><Dialog defaultOpen={true}>Mediumhttps://ui.shadcn.com/docs/components/dialog
913DialogInclude proper dialog structureUse DialogHeader DialogTitle DialogDescriptionComplete semantic structureMissing title or description<DialogHeader><DialogTitle><DialogDescription><DialogContent><p>Content</p></DialogContent>Highhttps://ui.shadcn.com/docs/components/dialog
1016FormUse Form with react-hook-formIntegrate Form component with react-hook-form for validationuseForm + Form + FormField patternCustom form handling without Form<Form {...form}><FormField control={form.control}><form onSubmit={handleSubmit}>Highhttps://ui.shadcn.com/docs/components/form
1117FormUse FormField for inputsWrap inputs in FormField for proper labeling and errorsFormField + FormItem + FormLabel + FormControlInput without FormField wrapper<FormField><FormItem><FormLabel><FormControl><Input><Input onChange={...}>Highhttps://ui.shadcn.com/docs/components/form
1218FormDisplay form messagesUse FormMessage for validation error displayFormMessage after FormControlCustom error text without FormMessage<FormControl><Input/></FormControl><FormMessage/><Input/>{error && <span>{error}</span>}Mediumhttps://ui.shadcn.com/docs/components/form
1319FormUse Zod for validationDefine form schema with Zod for type-safe validationzodResolver with form schemaManual validation logiczodResolver(formSchema)validate: (values) => { if (!values.email) }Mediumhttps://ui.shadcn.com/docs/components/form
1420SelectUse Select for dropdownsSelect component for option selectionSelect for choosing from listNative select element<Select><SelectTrigger><SelectContent><select><option>Mediumhttps://ui.shadcn.com/docs/components/select
1521SelectStructure Select properlyInclude Trigger Value Content and ItemsComplete Select structureMissing SelectValue or SelectContent<SelectTrigger><SelectValue/></SelectTrigger><SelectContent><SelectItem><Select><option>Highhttps://ui.shadcn.com/docs/components/select
1625TableInclude proper table structureUse TableHeader TableBody TableRow TableCellSemantic table structureMissing thead or tbody<TableHeader><TableRow><TableHead><Table><TableRow> without headerHighhttps://ui.shadcn.com/docs/components/table
1726DataTableUse DataTable for complex tablesCombine Table with TanStack Table for featuresDataTable pattern for sorting filtering paginationCustom table implementationuseReactTable + Table componentsCustom sort filter pagination logicMediumhttps://ui.shadcn.com/docs/components/data-table
1827TabsUse Tabs for content switchingTabs component for tabbed interfacesTabs for related content sectionsCustom tab implementation<Tabs><TabsList><TabsTrigger><TabsContent><div onClick={() => setTab(...)}Mediumhttps://ui.shadcn.com/docs/components/tabs
1929AccordionUse Accordion for collapsibleAccordion for expandable content sectionsAccordion for FAQ settings panelsCustom collapse implementation<Accordion><AccordionItem><AccordionTrigger><div onClick={() => setOpen(!open)}>Mediumhttps://ui.shadcn.com/docs/components/accordion
2032ToastAdd Toaster to layoutInclude Toaster component in root layout<Toaster /> in app layoutToaster in individual pagesapp/layout.tsx: <Toaster />page.tsx: <Toaster />Highhttps://ui.shadcn.com/docs/components/sonner
2136DropdownMenuUse DropdownMenu for actionsDropdownMenu for action lists and context menusDropdownMenu for user menu actionsPopover for action lists<DropdownMenu><DropdownMenuTrigger><DropdownMenuContent><Popover> for menu actionsMediumhttps://ui.shadcn.com/docs/components/dropdown-menu
2237DropdownMenuGroup menu itemsUse DropdownMenuGroup and DropdownMenuSeparatorOrganized menu with separatorsFlat list of items<DropdownMenuGroup><DropdownMenuItem><DropdownMenuSeparator><DropdownMenuItem> without organizationLowhttps://ui.shadcn.com/docs/components/dropdown-menu
2339TooltipAdd TooltipProviderWrap app or section in TooltipProviderTooltipProvider at app levelTooltipProvider per tooltip<TooltipProvider><App/></TooltipProvider><Tooltip><TooltipProvider>Highhttps://ui.shadcn.com/docs/components/tooltip
2442AlertDialogUse AlertDialog for confirmsAlertDialog for destructive action confirmationAlertDialog for delete confirmationsDialog for confirmations<AlertDialog><AlertDialogTrigger><AlertDialogContent><Dialog> for delete confirmationHighhttps://ui.shadcn.com/docs/components/alert-dialog
2543AlertDialogInclude action buttonsUse AlertDialogAction and AlertDialogCancelStandard confirm/cancel patternCustom buttons in AlertDialog<AlertDialogCancel>Cancel</AlertDialogCancel><AlertDialogAction><Button>Cancel</Button><Button>Confirm</Button>Mediumhttps://ui.shadcn.com/docs/components/alert-dialog
2645SidebarWrap in SidebarProviderUse SidebarProvider for sidebar state managementSidebarProvider at layout levelSidebar without provider<SidebarProvider><Sidebar></SidebarProvider><Sidebar> without providerHighhttps://ui.shadcn.com/docs/components/sidebar
2746SidebarUse SidebarTriggerInclude SidebarTrigger for mobile toggleSidebarTrigger for responsive toggleCustom toggle button<SidebarTrigger/><Button onClick={() => toggleSidebar()}>Mediumhttps://ui.shadcn.com/docs/components/sidebar
2847ChartUse Chart for data vizChart component with Recharts integrationChart component for dashboardsDirect Recharts without wrapper<ChartContainer config={chartConfig}><ResponsiveContainer><BarChart>Mediumhttps://ui.shadcn.com/docs/components/chart
2949ChartUse ChartTooltipApply ChartTooltip for interactive chartsChartTooltip with ChartTooltipContentRecharts Tooltip directly<ChartTooltip content={<ChartTooltipContent/>}/><Tooltip/> from rechartsLowhttps://ui.shadcn.com/docs/components/chart
3050BlocksUse blocks for scaffoldingStart from shadcn blocks for common layoutsnpx shadcn@latest add dashboard-01Build dashboard from scratchnpx shadcn@latest add login-01Custom login page from scratchMediumhttps://ui.shadcn.com/blocks
3151BlocksCustomize block componentsModify copied block code to fit needsEdit block files after installationUse blocks without modificationCustomize dashboard-01 layoutUse dashboard-01 as-isLowhttps://ui.shadcn.com/blocks
3253A11yMaintain focus managementDialog Sheet handle focus automaticallyLet components manage focusCustom focus handling<Dialog> traps focusdocument.querySelector().focus()Highhttps://ui.shadcn.com/docs/components/dialog
3356PerformanceLazy load dialogsDynamic import for heavy dialog contentReact.lazy for dialog contentImport all dialogs upfrontconst HeavyContent = lazy(() => import('./Heavy'))import HeavyContent from './Heavy'Medium