### Shared Registry Items Installation Example Source: https://github.com/joncoronel/cubby-ui/blob/main/REGISTRY_SYSTEM.md Shows the installation paths for shared hooks and utilities from the registry's default hooks and lib directories. ```text - `hooks/cubby-ui/use-fuzzy-filter.ts` - `lib/cubby-ui/highlight-text.tsx` ``` -------------------------------- ### Multi-File Component Structure Example Source: https://github.com/joncoronel/cubby-ui/blob/main/REGISTRY_SYSTEM.md Illustrates the directory structure for multi-file components in the source registry and how they are installed using the shadcn CLI. ```text # Source structure registry/default/drawer/ ├── drawer.tsx ├── drawer.css ├── hooks/ │ ├── use-scroll-snap.ts │ └── use-virtual-keyboard.ts └── lib/ └── drawer-utils.ts # Installed structure (via shadcn CLI) components/ui/cubby-ui/drawer/ ├── drawer.tsx ├── drawer.css ├── hooks/ │ ├── use-scroll-snap.ts │ └── use-virtual-keyboard.ts └── lib/ └── drawer-utils.ts ``` -------------------------------- ### Start Development Server Source: https://github.com/joncoronel/cubby-ui/blob/main/CLAUDE.md Starts the development server. Use a timeout when running this command. ```bash pnpm run dev ``` -------------------------------- ### Auto-Generated Installation Instructions Source: https://github.com/joncoronel/cubby-ui/blob/main/MDX_DOCUMENTATION.md ComponentInstall automatically generates installation instructions, including CLI and manual tabs with package manager selection. ```mdx ``` -------------------------------- ### Kbd Component: Keyboard Shortcuts List Example Source: https://github.com/joncoronel/cubby-ui/blob/main/content/docs/components/(primitives)/kbd.mdx Provides an example of displaying a comprehensive list of available keyboard shortcuts using the Kbd component. ```javascript import { Kbd, } from "@/registry/default/kbd/kbd"; export default function KbdDemo() { const shortcuts = [ { key: "Ctrl", action: "Save" }, { key: "Shift", action: "Redo" }, { key: "Alt", action: "Undo" }, ]; return ( ); } ``` -------------------------------- ### Fancy Button Installation Source: https://github.com/joncoronel/cubby-ui/blob/main/content/docs/components/(composables)/fancy-button.mdx Provides instructions for installing the fancy button component. ```javascript ``` -------------------------------- ### Vitest Setup File Source: https://github.com/joncoronel/cubby-ui/blob/main/TESTING.md Setup file for Vitest tests, importing necessary extensions for testing libraries like `@testing-library/jest-dom`. ```typescript import "@testing-library/jest-dom/vitest"; ``` -------------------------------- ### Drawer Directions Example Source: https://github.com/joncoronel/cubby-ui/blob/main/content/docs/components/(composables)/drawer.mdx Demonstrates opening the drawer from different screen edges. ```javascript import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/registry/default/drawer/drawer"; export default function DrawerDemo() { return ( Open drawer Drawer Title Drawer Description Drawer Body Close ); } ``` -------------------------------- ### Complete Form Example Source: https://github.com/joncoronel/cubby-ui/blob/main/content/docs/components/(primitives)/form.mdx A comprehensive form example demonstrating the integration of various field types and validation methods. ```react import { Form } from "@/registry/default/form/form"; import { FormField } from "@/registry/default/form/form-field"; import { FormLabel } from "@/registry/default/ui/form-label"; import { Input } from "@/registry/default/ui/input"; import { FormMessage } from "@/registry/default/ui/form-message"; import { FormError } from "@/registry/default/ui/form-error"; import { Textarea } from "@/registry/default/ui/textarea"; import { Checkbox } from "@/registry/default/ui/checkbox"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/registry/default/ui/select"; import { RadioGroup, RadioGroupItem } from "@/registry/default/ui/radio-group"; import { Button } from "@/registry/default/ui/button"; import { z } from "zod"; const formSchema = z.object({ name: z.string().min(2, { message: "Name must be at least 2 characters.", }), email: z.string().email({ message: "Invalid email address.", }), bio: z.string().max(200, { message: "Bio cannot be longer than 200 characters.", }), terms: z.boolean().refine(term => term === true, { message: "You must accept the terms and conditions.", }), plan: z.enum(["free", "pro", "enterprise"]), newsletter: z.enum(["daily", "weekly", "monthly"]), }); export default function FormComplete() { const onSubmit = (values) => { console.log(values); }; return (
Name Email Bio