Kokonut UI Documentation
repository·main·Indexed 22 days ago
https://github.com/kokonut-labs/kokonutuiAn open-source library of high-quality UI components built with Tailwind CSS, shadcn/ui, and Motion for modern web applications. The library includes specialized AI interface components (AI_Input_Search, AILoadingState, AI_Prompt), animated backgrounds (BackgroundPaths, BeamsBackground, FlowField), interactive buttons (HoldButton, ParticleButton, GradientButton), and advanced card layouts (BentoGrid, CardStack, CarouselCards).
What's inside Kokonut UI
- Kokonut UI is an open-source collection of UI components designed for websites. The components are built using a stack of Tailwind CSS, shadcn/ui, and Motion (formerly Framer Motion).
Install KokonutUI components via CLI
mainThe recommended way to install components is using the
shadcnCLI, which ensures all necessary files and dependencies (likelucide-iconsorshadcn/uicomponents) are included automatically.To add a component, use the
@kokonutui/namespace followed by the component name. For example, to add theparticle-button:- Bun:
bunx --bun shadcn@latest add @kokonutui/particle-button - npx:
npx shadcn@latest add @kokonutui/particle-button - pnpm:
pnpm dlx shadcn@latest add @kokonutui/particle-button
Once installed, import and use the component in your React or Next.js project:
import ParticleButton from "@/components/kokonutui/particle-button"; export default function Page() { return <ParticleButton />; }npx shadcn@latest add @kokonutui/particle-button- Bun:
Install KokonutUI components in a Monorepo
mainIf you are working within a monorepo, use the
-cflag with theshadcnCLI to specify the path to your workspace directory.Example for adding
particle-buttonto the./apps/wwwdirectory:- Bun:
bunx --bun shadcn@latest add @kokonutui/particle-button -c ./apps/www - npx:
npx shadcn@latest add @kokonutui/particle-button -c ./apps/www - pnpm:
pnpm dlx shadcn@latest add @kokonutui/particle-button -c ./apps/www
npx shadcn@latest add @kokonutui/particle-button -c ./apps/www- Bun:
Install required utilities
mainKokonutUI components require Tailwind CSS v4. Additionally, most components rely on a
cnutility function. You can install this utility via the CLI using the following commands:- Bun:
bunx --bun shadcn@latest add https://kokonutui.com/r/utils.json - npx:
npx shadcn@latest add https://kokonutui.com/r/utils.json - pnpm:
pnpm dlx shadcn@latest add https://kokonutui.com/r/utils.json
npx shadcn@latest add https://kokonutui.com/r/utils.json- Bun:
Initialize KokonutUI with components.json
mainTo use the
shadcnCLI to install KokonutUI components, you must first initialize acomponents.jsonfile in your project. This file acts as the configuration for component installation.Note: The
components.jsonfile is optional if you prefer the manual copy-and-paste method. It is only required for CLI usage.Run the initialization command for your preferred package manager:
- Bun:
bunx --bun shadcn@latest init - npx:
npx shadcn@latest init - pnpm:
pnpm dlx shadcn@latest init
- Bun:
Update your
components.jsonto include the KokonutUI registry:
{ "registries": { "@kokonutui": "https://kokonutui.com/r/{name}.json" } }npx shadcn@latest initAccess Kokonut UI documentation
mainFor detailed installation guides, component usage, and API references, visit the official documentation website at https://kokonutui.com/docs.Use the Morphic Navbar component
mainThe
MorphicNavbaris a navigation bar component where the active link morphs into a rounded pill using smooth CSS transitions. It is built using React, Next.jsLink, and Tailwind CSS. To use it, import the component from its local path and render it within your application.import MorphicNavbar from "@/components/kokonutui/morphic-navbar"; // Usage in a component <MorphicNavbar />Use the Slide Text Button component
mainThe
SlideTextButtonis an animated link button that performs a vertical text slide transition when hovered. It is built using React, Motion, and Tailwind CSS. It supportsdefaultandghostvariants and allows you to specify the text that appears during the hover state via thehoverTextprop.import SlideTextButton from "@/components/kokonutui/slide-text-button"; <SlideTextButton hoverText="Click to see more" />Use the V0Button component
mainThe
V0Buttoncomponent is a specialized button designed to send a component registry JSON tov0.dev, enabling instant editing of the component in the v0 environment. It is built using React, the shadcnButtoncomponent, and Tailwind CSS.To use it, import
V0Buttonfrom its component path and provide asizeprop.import V0Button from "@/components/kokonutui/v0-button"; // Example usage with an extra large size <V0Button size="xl" />Use the SwooshText component
mainThe
SwooshTextcomponent creates a hover text effect featuring layered colorful shadows that snap flat when the user mouses over the text. It is built using React, Tailwind CSS, and Motion for animations.To use it, import the component and provide the
textprop for the content and aclassNameprop to control the text size and styling via Tailwind CSS.import SwooshText from "@/components/kokonutui/swoosh-text"; <SwooshText text="Hover" className="text-6xl" />Use the DynamicText component
mainDynamicTextis an animated text switcher component that cycles through a list of greetings or strings in multiple languages. It is built using React, Tailwind CSS, and Motion to handle enter and exit transitions smoothly.To use it, import the component from its package path and place it within your React component tree. By default, it demonstrates a cycling animation of greetings.
Use the SwitchButton component
mainTheSwitchButtonis a theme toggle component designed for switching between light and dark modes. It features a rotating sun icon and a shimmer hover effect. It is built using React,next-themes, and Tailwind CSS.