### Initialize HextaUI in Project Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite This command uses `npx` to execute the `hextaui` package's `init` command without requiring a global installation. The `init` command typically sets up necessary configurations or files for HextaUI within your project, preparing it for component usage. ```Shell npx hextaui@latest init ``` -------------------------------- ### Install HextaUI Package Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite This command installs the latest version of the HextaUI library as a project dependency. HextaUI provides a collection of UI components for building web applications. This step is a prerequisite for using HextaUI components in your project. ```Shell npm install hextaui@latest ``` -------------------------------- ### Install HextaUI Skeleton Components Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/skeleton Command to add the Skeleton components to your project using `npx` for quick setup. ```Shell npx hextaui@latest add skeleton ``` -------------------------------- ### HextaUI Sidebar Installation Command Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/sidebar This command provides a quick way to add the HextaUI sidebar components to your project using `npx`. It streamlines the setup process by automatically installing and configuring the necessary files. ```Shell npx hextaui@latest add sidebar ``` -------------------------------- ### Create a new React project with Vite Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite This command initializes a new Vite project. Follow the interactive prompts and select 'React + Typescript' as the framework to set up your project. ```npm npm create vite@latest ``` -------------------------------- ### Install Hextaui Tree Component Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/tree This command uses `npx` to quickly add the `tree` component from the `hextaui` library to your project. It streamlines the setup process for integrating the component. ```shell npx hextaui@latest add tree ``` -------------------------------- ### Full Basic HextaUI Sidebar Component Example Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/sidebar This comprehensive example provides a complete, runnable React component demonstrating a basic HextaUI sidebar setup. It includes imports, state management, a header with an image and text, multiple navigation items with icons, and a main content area that adjusts based on the sidebar's collapsed state, showcasing a typical application layout. ```jsx "use client"; import * as React from "react"; import { Sidebar, SidebarBody, SidebarItem, SidebarContent, SidebarHeader, SidebarText, } from "./sidebar"; import { cn } from "@/lib/utils"; import { Home, Search, Settings, FileText } from "lucide-react"; export function SidebarBasic() { const [collapsed, setCollapsed] = React.useState(false); return (
HextaUI

Welcome to HextaUI

This is the main content area. The sidebar will affect the width of this content.

); } ``` -------------------------------- ### Add Specific HextaUI Component Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite This command uses `npx` to run the `hextaui` package's `add` command, specifically for the 'button' component. It adds the `Button` component's files to your project, making it available for import and use. This allows for selective inclusion of components. ```Shell npx hextaui@latest add button ``` -------------------------------- ### Install Node.js Type Definitions for Vite Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite This command installs the `@types/node` package as a development dependency. It provides TypeScript type definitions for Node.js APIs, which helps resolve type-related errors in Vite projects, especially when dealing with path resolution or Node.js built-in modules. ```Shell npm install -D @types/node ``` -------------------------------- ### Install Accordion Component via CLI Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/accordion Provides the command-line instruction to add the Accordion component to a project using the `hextaui` CLI tool, simplifying the setup process. ```Shell npx hextaui@latest add accordion ``` -------------------------------- ### Install Radix Direction Package Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/getting-started/rtl-setup Instructions for installing the `@radix-ui/react-direction` package, which provides the core context provider and hook for managing layout direction in React applications. This package is essential for enabling RTL support. ```Shell pnpm add @radix-ui/react-direction # or npm install @radix-ui/react-direction # or yarn add @radix-ui/react-direction ``` -------------------------------- ### Install Tailwind CSS and its Vite plugin Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite This command installs the core Tailwind CSS package along with `@tailwindcss/vite`, which is the necessary plugin for integrating Tailwind CSS into a Vite project. ```npm npm install npm install tailwindcss @tailwindcss/vite ``` -------------------------------- ### Install HextaUI Command Menu Component via CLI Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/command-menu This command uses `npx` to add the `command-menu` component from the `hextaui` library to your project. It's the recommended and quickest way to integrate the component without manual setup, ensuring you get the latest version. ```Shell npx hextaui@latest@latest add command-menu ``` -------------------------------- ### Install Marquee Component via Hextaui CLI Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/marquee Command-line instruction to add the Marquee component to a project using the `npx hextaui` utility, simplifying the setup process. ```Shell npx hextaui@latest add marquee ``` -------------------------------- ### Install TagInput Component with npx Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/tag-input Provides the command-line instruction to add the `tag-input` component to your project using `npx` from the `hextaui` library, simplifying the setup process. ```shell npx hextaui@latest add tag-input ``` -------------------------------- ### Skeleton Card Layouts Example Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/skeleton Provides examples of `SkeletonCard` usage with different configurations (e.g., with/without image, header, or footer) to simulate various card layouts during loading. ```HTML
{/* Full card with image, header, content, and footer */} {/* Card without image */}
{/* Card without footer */} {/* Card without header */} {/* Card with only content */}
``` -------------------------------- ### Kbd Component Default Styling Example Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/kbd An example showcasing the `Kbd` component with its default styling, typically used for single key presses like 'Enter'. ```JSX
Press Enter to submit
``` -------------------------------- ### Configure tsconfig.app.json for IDE path resolution Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/vite Add the same `baseUrl` and `paths` configuration to your `tsconfig.app.json` file. This ensures that your Integrated Development Environment (IDE) correctly resolves the configured path aliases, providing proper autocompletion and navigation. ```json { "compilerOptions": { // ... "baseUrl": ".", "paths": { "@/*": [ "./src/*" ] } // ... } } ``` -------------------------------- ### Install Hextaui Core Dependencies Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/file-upload This `npm install` command adds the necessary libraries for Hextaui UI components, including `class-variance-authority` for variant-based styling, `lucide-react` for icons, and `motion` for animations. ```bash npm install class-variance-authority lucide-react motion ``` -------------------------------- ### Install HextaUI DatePicker Component Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/date-picker Command to add the DatePicker component to your project using `npx` from the HextaUI library. This command fetches and installs the latest version of the component. ```Shell npx hextaui@latest add date-picker ``` -------------------------------- ### Install Core Dependencies for Hextaui Components Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/button This command installs the foundational libraries, `@radix-ui/react-slot` and `class-variance-authority`, which are essential for the Hextaui Button component and other UI elements built with similar patterns. ```shell npm install @radix-ui/react-slot class-variance-authority ``` -------------------------------- ### Install Menubar Component using Hextaui CLI Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/menubar This command demonstrates how to add the `menubar` component to a project using the `hextaui` command-line interface. It utilizes `npx` to execute the `hextaui` package directly, simplifying the installation process for UI components. ```Shell npx hextaui@latest add menubar ``` -------------------------------- ### Initialize HextaUI Configuration Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/installation/nextjs After installation, this command initializes HextaUI within your project, setting up necessary configurations and files. It prepares the project to use HextaUI components. ```bash npx hextaui@latest init ``` -------------------------------- ### Get Placeholder Text for Color Input by Format Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/color-picker This function provides example placeholder strings for various color input formats (hex, rgb, hsl, hsv, oklch, lab). It's useful for guiding user input in UI elements that accept color values. ```TypeScript export function getFormatPlaceholder(format: ColorFormat): string { switch (format) { case "hex": return "#3b82f6"; case "rgb": return "rgb(59, 130, 246)"; case "hsl": return "hsl(220, 91%, 64%)"; case "hsv": return "hsv(220, 76%, 96%)"; case "oklch": return "oklch(65% 0.15 230)"; case "lab": return "lab(55% -10 40)"; default: return ""; } } ``` -------------------------------- ### Install SpotlightCard via Shadcn CLI Source: https://www.hextaui.com/docs/ui/getting-started/introduction/og-blocks/animation/spotlight-card This command uses the Shadcn CLI to add the `SpotlightCard` component to a project, simplifying the installation process for HextaUI components. It fetches the component directly from the specified URL. ```shell npx shadcn@latest add "https://21st.dev/r/hextaui/spotlight-card" ``` -------------------------------- ### Checkbox Basic Usage Example with State Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/checkbox Demonstrates a basic interactive Checkbox setup within a React functional component, including state management for the checked status and examples of disabled checkboxes. It shows how to handle `onCheckedChange` events. ```jsx function CheckboxBasic() { const [checked, setChecked] = useState(false); return (
setChecked(!!checked)} />
); } ``` -------------------------------- ### Basic Textarea Usage Source: https://www.hextaui.com/docs/ui/getting-started/introduction/ui/components/textarea A simple example demonstrating how to render the Textarea component with a placeholder. This snippet shows the minimal setup required to display a functional textarea. ```jsx