# Xertica UI — Compact Reference > 97-component React design system. Tailwind CSS v4 + Radix UI + Lucide Icons. v2.5.3 > Full docs: llms-full.txt | Component index: llms.txt | Decision guide: docs/decision-tree.md --- ## CRITICAL RULES ``` NEVER raw Title Content {/* scrollable */} ``` ### AlertDialog (destructive confirmation) ```tsx Are you sure? This action cannot be undone. Cancel Delete ``` ### Table (CRUD list) ```tsx NameStatus {items.map(item => ( {item.name} {item.status} ))}
``` ### Toast (via sonner) ```tsx import { toast } from 'sonner'; toast.success('Saved!'); toast.error('Failed to save'); toast.info('Processing...'); // Never render — auto-injected by XerticaProvider ``` ### Select ```tsx ``` ### Sidebar ```tsx import { Sidebar } from 'xertica-ui/layout'; import { useLayout } from 'xertica-ui/hooks'; import { useNavigate, useLocation } from 'react-router-dom'; function AppSidebar({ user, onLogout }) { const { sidebarExpanded, sidebarWidth, toggleSidebar } = useLayout(); return ( ); } // Sub-items (children) — desktop: ChevronRight opens a lateral DropdownMenu // mobile: ChevronRight expands items inline (accordion) navigationGroups={[{ id: 'main', label: 'Principal', items: [{ path: '/dashboard', label: 'Dashboard', icon: BarChart, children: [ { path: '/dashboard/overview', label: 'Visão Geral', icon: BarChart }, { path: '/dashboard/reports', label: 'Relatórios', icon: FileEdit }, ], }], }]} ``` ### Header ```tsx import { Header } from 'xertica-ui/layout';
``` ### Empty state ```tsx No results Try adjusting your filters. ``` ### StatsCard (dashboard KPI) ```tsx } /> ``` --- ## QUICK COMPONENT SELECTION | Need | Use | |---|---| | User must confirm before proceeding | `AlertDialog` | | Form or detail view in overlay | `Dialog` | | Wide form from the side | `Sheet` | | Mobile overlay from bottom | `Drawer` | | Anchored interactive panel | `Popover` | | Short hover hint | `Tooltip` | | Rich hover preview | `HoverCard` | | Ephemeral message | `toast()` (sonner) | | Persistent inline message | `Alert` | | Loading state | `Skeleton` | | No data | `Empty` | | Multi-step flow | `Stepper` | | Tab switching | `Tabs` | | Collapsible FAQ/list | `Accordion` | | Single expandable | `Collapsible` | | Date input | `Calendar` + `Popover` | | Numeric range | `Slider` | | One of many options | `RadioGroup` or `Select` | | On/off setting | `Switch` | | Multi-select list | `Checkbox` group | | Search/filter | `Search` or `Command` | | Row actions | `DropdownMenu` | | Right-click actions | `ContextMenu` | --- ## FORM PATTERN (react-hook-form + zod) ```tsx import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from 'xertica-ui/ui'; const schema = z.object({ name: z.string().min(2) }); function MyForm() { const form = useForm({ resolver: zodResolver(schema) }); return (
( Name )} /> ); } ```