# KokonutUI - Full Documentation > Collection of 100+ stunning UI components free and open source built with Next.js, React, Tailwind CSS, and Motion. Every documentation page, concatenated. Index: https://kokonutui.com/llms.txt --- # Installation > Install KokonutUI components in any React or Next.js project with the shadcn CLI, using namespaces or direct registry URLs. No extra setup required. Source: https://kokonutui.com/docs ### 1. Add namespaces with components.json [#1-add-namespaces-with-componentsjson] The components.json file holds configuration for your project, and allow easy installation of any components. It is only required if you're using the CLI to add components to your project. If you're using the copy and paste method, you don't need this file. You can create a components.json file in your project by running the following command: ```bash bunx --bun shadcn@latest init ``` ```bash npx shadcn@latest init ``` ```bash pnpm dlx shadcn@latest init ``` Then, you'll need to add this to your `components.json` to allow kokonutUI registry. ```json { "registries": { "@kokonutui": "https://kokonutui.com/r/{name}.json" } } ``` ### 2. Install utilities [#2-install-utilities] All components use [Tailwind CSS v4](https://tailwindcss.com/docs/installation/framework-guides/nextjs), so ensure it's installed in your project. Many components also use the `cn` utility functionβ€”install it with the following command: ```bash bunx --bun shadcn@latest add https://kokonutui.com/r/utils.json ``` ```bash npx shadcn@latest add https://kokonutui.com/r/utils.json ``` ```bash pnpm dlx shadcn@latest add https://kokonutui.com/r/utils.json ``` ### 3. That's it πŸŽ‰ [#3-thats-it-] We use [lucide-icons](https://lucide.dev/guide/installation) for most components that include icons, along with some [shadcn/ui](https://ui.shadcn.com/) components. These dependencies will be automatically installed when using the CLI. For exemple to add `particle-button` component to your project, it will be easy as: ```bash bunx --bun shadcn@latest add @kokonutui/particle-button ``` ```bash npx shadcn@latest add @kokonutui/particle-button ``` ```bash pnpm dlx shadcn@latest add @kokonutui/particle-button ``` *While we provide a convenient 'copy' button for the code, we strongly recommend using the CLI for installing components, as it ensures all necessary files are included.* Add to your page and it works! ```jsx import ParticleButton from "@/components/kokonutui/particle-button"; export default function Page() { return ; } ``` ### 4. Using an AI assistant? [#4-using-an-ai-assistant] KokonutUI works with the shadcn MCP server, so Claude Code, Cursor, VS Code, and Codex can browse and install components through natural language. See the [MCP Server guide](/docs/mcp) to set it up. ### 5. Optionnal dependencies [#5-optionnal-dependencies] Some components require additional libraries, listed at the bottom of each components. Make sure to install them to ensure the component works properly. ### 6. Monorepo [#6-monorepo] For monorepo `shadcn/ui` CLI contain the options `-c` to the path to your workspace for exemple: ```bash bunx --bun shadcn@latest add @kokonutui/particle-button -c ./apps/www ``` ```bash npx shadcn@latest add @kokonutui/particle-button -c ./apps/www ``` ```bash pnpm dlx shadcn@latest add @kokonutui/particle-button -c ./apps/www ``` --- # MCP Server > Browse, search, and install KokonutUI components from Claude Code, Cursor, VS Code, or Codex using natural language via the shadcn MCP server. Source: https://kokonutui.com/docs/mcp KokonutUI works out of the box with the [shadcn MCP server](https://ui.shadcn.com/docs/mcp). Once configured, your AI assistant can list every KokonutUI component, read its dependencies, and install it into your project β€” no manual CLI commands needed. ```text "Add @kokonutui/particle-button to my project" ``` ### 1. Add the KokonutUI registry [#1-add-the-kokonutui-registry] The MCP server discovers registries through your `components.json`. Make sure the `@kokonutui` namespace is configured β€” see the [installation guide](/docs) if you haven't set it up yet: ```json { "registries": { "@kokonutui": "https://kokonutui.com/r/{name}.json" } } ``` ### 2. Set up the MCP server [#2-set-up-the-mcp-server] The fastest way is the `mcp init` command, which configures the server for your client automatically: ```bash bunx --bun shadcn@latest mcp init --client claude ``` ```bash npx shadcn@latest mcp init --client claude ``` ```bash pnpm dlx shadcn@latest mcp init --client claude ``` Use `--client claude`, `--client cursor`, `--client vscode`, or `--client codex` depending on your editor. You can also configure it manually: ```json title=".mcp.json" { "mcpServers": { "shadcn": { "command": "npx", "args": ["shadcn@latest", "mcp"] } } } ``` ```json title=".cursor/mcp.json" { "mcpServers": { "shadcn": { "command": "npx", "args": ["shadcn@latest", "mcp"] } } } ``` ```json title=".vscode/mcp.json" { "servers": { "shadcn": { "command": "npx", "args": ["shadcn@latest", "mcp"] } } } ``` ```toml title="~/.codex/config.toml" [mcp_servers.shadcn] command = "npx" args = ["shadcn@latest", "mcp"] ``` For Cursor, enable the server in **Settings β†’ MCP** after adding the file. For VS Code, click **Start** next to the server entry in `.vscode/mcp.json`. ### 3. Use it [#3-use-it] Restart your editor or MCP client, then ask in plain language: ```text "Show me all available components in the @kokonutui registry" ``` ```text "Add @kokonutui/ai-prompt to my project" ``` ```text "Build a pricing section using @kokonutui components" ``` The assistant resolves each component's `registryDependencies` (shadcn/ui primitives like `button` or `textarea`) and npm `dependencies` (like `motion` or `lucide-react`) automatically, exactly like the CLI does. The shadcn MCP server follows the standard Model Context Protocol, so any MCP-capable client can use it β€” the four above are just the ones with first-class `mcp init` support. --- # AI Input Search > AI search chat input with toggleable web search mode, file attachment and auto-resizing textarea. Built with React, Tailwind CSS and Motion. Source: https://kokonutui.com/docs/ai/ai-input-search ## Installation ```bash npx shadcn@latest add @kokonutui/ai-input-search ``` ## Source ```tsx "use client"; /** * @author: @kokonutui * @description: AI Input Search * @version: 1.0.0 * @date: 2025-06-26 * @license: MIT * @website: https://kokonutui.com * @github: https://github.com/kokonut-labs/kokonutui */ import { Globe, Paperclip, Send } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; import { useState } from "react"; import { Textarea } from "@/components/ui/textarea"; import { useAutoResizeTextarea } from "@/hooks/use-auto-resize-textarea"; import { cn } from "@/lib/utils"; interface AIInputSearchProps { placeholder?: string; searchLabel?: string; onSubmit?: (value: string) => void; className?: string; } export default function AI_Input_Search({ placeholder = "Search the web...", searchLabel = "Search", onSubmit, className, }: AIInputSearchProps) { const [value, setValue] = useState(""); const { textareaRef, adjustHeight } = useAutoResizeTextarea({ minHeight: 52, maxHeight: 200, }); const [showSearch, setShowSearch] = useState(true); const [isFocused, setIsFocused] = useState(false); const handleSubmit = () => { onSubmit?.(value); setValue(""); adjustHeight(true); }; const handleFocus = () => { setIsFocused(true); }; const handleBlur = () => { setIsFocused(false); }; const handleContainerClick = () => { if (textareaRef.current) { textareaRef.current.focus(); } }; return (
{ if (e.key === "Enter" || e.key === " ") { handleContainerClick(); } }} role="textbox" tabIndex={0} >