### Complete Installation Example Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md A comprehensive example demonstrating the installation of a theme, button, and data card, followed by their usage in a React component. ```bash # 1. init shadcn if you haven't npx shadcn@latest init # 2. register the namespace in components.json # "registries": { "@thegridcn": "https://thegridcn.com/r/{name}.json" } # 3. install everything in one shot npx shadcn@latest add @thegridcn/theme-ares @thegridcn/button @thegridcn/data-card ``` -------------------------------- ### Local Development Setup Source: https://github.com/educlopez/thegridcn-ui/blob/main/CONTRIBUTING.md Clone the repository, install dependencies, and start the development server. Ensure Node 20+ and pnpm 9+ are installed. ```bash git clone https://github.com/educlopez/thegridcn-ui.git cd thegridcn-ui pnpm install pnpm dev ``` -------------------------------- ### Install and Run Development Server Source: https://github.com/educlopez/thegridcn-ui/blob/main/README.md Installs project dependencies using pnpm and starts the development server. Ensure Node.js 18+ and pnpm are installed. ```bash pnpm install pnpm dev # http://localhost:3000 ``` -------------------------------- ### Start Production Server Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/configuration.md Run `pnpm start` to launch the production server after a successful build. ```bash pnpm start ``` -------------------------------- ### Install Component from Local URL Source: https://github.com/educlopez/thegridcn-ui/blob/main/src/registry/README.md Use this command to install a component directly from a local registry URL. ```bash npx shadcn@latest add http://localhost:3000/r/button.json ``` -------------------------------- ### Install Multiple Components Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Install several components from The GridCN namespace simultaneously to streamline your workflow. ```bash npx shadcn@latest add @thegridcn/button @thegridcn/data-card @thegridcn/hud ``` -------------------------------- ### Install Component from Published Registry URL Source: https://github.com/educlopez/thegridcn-ui/blob/main/src/registry/README.md Install a component from a deployed registry by providing its public URL. ```bash npx shadcn@latest add https://your-domain.com/r/button.json ``` -------------------------------- ### Install Components via shadcn CLI Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/README.md Install components using the shadcn CLI after registering the namespace. ```bash npx shadcn@latest add @thegridcn/button npx shadcn@latest add @thegridcn/data-card npx shadcn@latest add @thegridcn/theme-ares ``` -------------------------------- ### Install Component using Local Registry File Source: https://github.com/educlopez/thegridcn-ui/blob/main/src/registry/README.md Install a component by referencing the local registry file and component name. ```bash npx shadcn@latest add --registry ./registry.json button ``` -------------------------------- ### Install The GridCN Button Component Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Install the button component from The GridCN namespace using the shadcn CLI. ```bash npx shadcn@latest add @thegridcn/button ``` -------------------------------- ### Render Installed Components Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Example React component demonstrating how to use the installed Button and DataCard components from The GridCN UI. ```tsx // app/page.tsx import { Button } from "@/components/ui/button"; import { DataCard } from "@/components/thegridcn/data-card"; export default function Page() { return (
); } ``` -------------------------------- ### Install The GridCN Theme Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Install a theme from The GridCN namespace. Themes provide pre-defined styles and CSS variables. ```bash npx shadcn@latest add @thegridcn/theme-ares npx shadcn@latest add @thegridcn/theme-tron npx shadcn@latest add @thegridcn/theme-clu npx shadcn@latest add @thegridcn/theme-athena npx shadcn@latest add @thegridcn/theme-aphrodite npx shadcn@latest add @thegridcn/theme-poseidon ``` -------------------------------- ### Production Build and Start Commands Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/INDEX.md Commands to build the project for production and start the production server. Also includes a command to regenerate theme tokens. ```bash pnpm build # Builds registry + Next.js pnpm start # Runs production server pnpm tokens:build # Regenerate theme tokens ``` -------------------------------- ### Install Component by Full URL Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Install a component directly using its full URL without needing to register the namespace in `components.json`. ```bash npx shadcn@latest add https://thegridcn.com/r/button.json npx shadcn@latest add https://thegridcn.com/r/data-card.json ``` -------------------------------- ### Start Development Server Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/configuration.md Run the `pnpm dev` command to start the Next.js development server. This enables hot reloading and TypeScript checking. ```bash pnpm dev ``` -------------------------------- ### Install Tron-Flavored Components Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Install specific Tron-flavored components like data-card and radar from The GridCN namespace. ```bash npx shadcn@latest add @thegridcn/data-card npx shadcn@latest add @thegridcn/radar npx shadcn@latest add @thegridcn/hud ``` -------------------------------- ### Install TheGridCN Components via shadcn Registry Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/INDEX.md Installs TheGridCN components using the shadcn CLI. Ensure your `components.json` is configured with the `@thegridcn` registry. ```bash # Register namespace once # In components.json: { "registries": { "@thegridcn": "https://thegridcn.com/r/{name}.json" } } # Then install components npx shadcn@latest add @thegridcn/button npx shadcn@latest add @thegridcn/data-card npx shadcn@latest add @thegridcn/theme-ares ``` -------------------------------- ### SearchInput Example Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/api-reference/form-input-components.md Example of using the SearchInput component for searching components. Includes debounce and a search handler. ```tsx import { SearchInput } from "@/components/thegridcn" import { useState } from "react" export function ComponentSearch() { const [query, setQuery] = useState("") const [results, setResults] = useState([]) const handleSearch = async (q: string) => { const res = await fetch(`/api/search?q=${q}`) setResults(await res.json()) } return ( ) } ``` -------------------------------- ### LoginTemplate Example Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/api-reference/templates-utilities.md Demonstrates how to use the LoginTemplate component, including handling the login submission. ```tsx import { LoginTemplate } from "@/components/thegridcn" export function LoginPage() { const handleLogin = async (credentials: { email: string; password: string }) => { const res = await fetch("/api/auth/login", { method: "POST", body: JSON.stringify(credentials), }) // Handle response } return ( ) } ``` -------------------------------- ### BlogTemplate Example Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/api-reference/templates-utilities.md Shows how to implement the BlogTemplate with an array of articles and an article selection handler. ```tsx import { BlogTemplate } from "@/components/thegridcn" interface BlogArticle { id: string title: string excerpt: string author: string date: string readTime: number category: string featured: boolean } export function BlogPage() { const articles: BlogArticle[] = [ { id: "1", title: "The Future of UI", excerpt: "Exploring next-generation interfaces...", author: "CLU", date: "2024-01-15", readTime: 5, category: "Design", featured: true, }, ] return ( console.log(`Reading ${id}`)} /> ) } ``` -------------------------------- ### Install 3D Grid Component Source: https://github.com/educlopez/thegridcn-ui/blob/main/docs/install.md Install the 3D grid component, which automatically includes necessary dependencies like three.js and @react-three/fiber. ```bash npx shadcn@latest add @thegridcn/grid ``` -------------------------------- ### Install The GridCN Components via CLI Source: https://github.com/educlopez/thegridcn-ui/blob/main/README.md Use the shadcn CLI to add individual components or multiple components at once. Ensure you have registered the namespace in your components.json first. ```bash npx shadcn@latest add @thegridcn/button npx shadcn@latest add @thegridcn/data-card npx shadcn@latest add @thegridcn/theme-ares # or several at once npx shadcn@latest add @thegridcn/button @thegridcn/hud @thegridcn/radar ``` -------------------------------- ### LandingTemplate Customization Example Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/api-reference/templates-utilities.md Provides an example of how to customize the LandingTemplate with specific titles, subtitles, CTA text, and feature items. ```tsx import { LandingTemplate } from "@/components/thegridcn" export function CustomLanding() { return ( ) } ``` -------------------------------- ### Theme Provider Setup in Layout Source: https://github.com/educlopez/thegridcn-ui/blob/main/_autodocs/configuration.md Configures the ThemeProvider and initializes theme/intensity from localStorage before hydration. ```tsx // app/layout.tsx import { ThemeProvider } from "@/components/theme" export default function RootLayout({ children }: { children: React.ReactNode }) { return (