# 9UI Documentation
Beautiful, customizable components built with Base UI and Tailwind CSS.
This is a curated set of components that you can customize to fit your style. You won't install it through npm - instead, you simply select the components you need and add them directly to your project.
## Getting Started
### Astro
Setting up dark mode in your Astro project.
**Create script to handle theme.**
```astro {5-28} title="src/pages/index.astro"
---
import '../styles/global.css';
---
{/* content */}
```
**Create theme utilies.**
Create a utility to handle theme management.
```ts title="src/utils/theme.ts"
export type Theme = "light" | "dark" | "system"
export function getTheme(): Theme {
if (typeof localStorage !== "undefined" && localStorage.getItem("theme")) {
return localStorage.getItem("theme") as Theme
}
return "system"
}
export function setTheme(theme: Theme) {
const isDark =
theme === "dark" ||
(theme === "system" &&
window.matchMedia("(prefers-color-scheme: dark)").matches)
document.documentElement.classList[isDark ? "add" : "remove"]("dark")
}
```
**Add theme toggle component.**
```tsx title="src/components/theme-toggle.tsx"
import * as React from "react"
import { MoonIcon, SunIcon } from "lucide-react"
import { getTheme, setTheme, type Theme } from "../utils/theme"
import { Button } from "./ui/button"
export function ThemeToggle() {
const [theme, setCurrentTheme] = React.useState(() => getTheme())
const toggleTheme = () => {
const newTheme = theme === "dark" ? "light" : "dark"
setTheme(newTheme)
setCurrentTheme(newTheme)
}
return (
)
}
```
**Use the theme toggle in your app**
You can now use the theme toggle component anywhere in your app.
```astro title="src/components/Header.astro"
---
import { ThemeToggle } from "./theme-toggle"
---
```
---
### Changelog
Latest Updates
## 09/08/2025
- Added [`multiple select example`](/docs/components/select#multiple)
- Added [`LLMs`](/docs/getting-started/llms) documentation page with AI-friendly formats
- Added search functionality with command dialog (⌘K)
- Added manual installation documentation
- Updated Base UI to latest version (1.0.0-beta.2)
- Fixed registry build to support shadcn monorepo setup
## 22/07/2025
- Added [`Navigation Menu`](/docs/components/navigation-menu) component
- Added [`Number Field`](/docs/components/number-field) component
- Added [`Pagination`](/docs/components/pagination) component
- Added [`Toast`](/docs/components/toast) component
## 30/06/2025
- New version! 🎉
- Compatible with Tailwind 4 and React 19
## 02/05/2025
- Added [`Checkbox Group`](/docs/components/checkbox-group) component
- Added [`Meter`](/docs/components/meter) component
## 21/03/2025
- Added [`Toolbar`](/docs/components/toolbar) component
- Added [`useRender`](https://base-ui.com/react/utils/use-render) hook to button component that overrides the default rendered element
## 23/02/2025
- Added examples for compose components [`Combobox`](/docs/components/combobox) and [`Date Picker`](/docs/components/date-picker)
## 18/02/2025
- Added [`Chart`](/docs/components/chart) component
## 08/02/2025
- Initial components release
## 31/12/2024
- Project started 🎉
---
### Dark Mode
Setting up dark mode in your project.
[Next.js](/docs/getting-started/dark-mode/next)
[Vite](/docs/getting-started/dark-mode/vite)
[Remix](/docs/getting-started/dark-mode/remix)
[Astro](/docs/getting-started/dark-mode/astro)
---
### Installation
Get started with 9ui by installing dependencies and setting up your project.
### Quick Setup
**Set up your project with 9ui configuration**
Start by initializing your project with 9ui's custom configuration. This approach builds upon the [shadcn installation guide](https://ui.shadcn.com/docs/installation) but uses 9ui-specific settings.
#### Danger Alert
**Don't use the standard command. Instead, use our custom configuration below to ensure proper 9ui theme setup.**
```bash title="Terminal"
npx shadcn@latest init https://9ui.dev/r/init.json
```
This command automatically installs the required dependencies, applies the 9ui theme configuration, and updates your `globals.css` file with the necessary styling.
**Add the root wrapper to your layout**
Add the `root` class to your app layout to ensure proper styling isolation and theme application.
```tsx {2} title="layout.tsx"
```
**Configure components.json (optional)**
Optionally create a `components.json` file to enable shadcn CLI component installation with the correct paths and settings.
```json title="components.json"
{
"$schema": "https://ui.shadcn.com/schema.json",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
```
**Start using 9ui components**
Your project is now fully configured! You can start installing and using 9ui components in your application.
## Icon Libraries
9ui components use [`lucide-react`](https://lucide.dev/) as the default icon library, which provides a comprehensive set of beautiful, consistent icons.
### Alternative Icon Libraries
For additional icon options, consider these popular alternatives:
- **[Monicon](https://monicon-docs.vercel.app/)** - Access over 200,000 icons from various popular libraries in a unified interface
- **[pqoqubbw/icons](https://icons.pqoqubbw.dev/)** - A curated collection of animated icons for enhanced user interactions
These libraries can be used alongside or instead of lucide-react depending on your project's specific needs.
---
### Introduction
Beautiful, customizable components built with Base UI and Tailwind CSS
This isn’t a standard component library. It’s a curated set of components that you can customize to fit your style.
You won’t install it through npm. Instead, you simply select the components you need and add them directly to your project.
Once included, each component is fully adaptable, letting you fine-tune it to meet your exact requirements.
## Why Base UI?
[Base UI](https://base-ui.com) offers unstyled, headless components with built-in accessibility. This makes it perfect for 9ui, allowing us to integrate Tailwind CSS without forcing any default design. It’s a clean foundation that stays lightweight, letting you adapt every detail to fit your exact needs.
## Is it production ready?
It’s built on Base UI, which is in alpha, so there may be changes in the future. However, I'm actively testing and refining it. If you’re comfortable with an early-stage library and ready to adapt as it matures, you can use it in production. Just ensure you perform your own checks and stay updated with any changes.
You can follow the development and updates of Base UI [here](https://base-ui.com/react/overview/releases).
## Why it's called 9ui?
The number **"9"** looks like the letter **"g"**. If you read **"9"** as **"g"**, it becomes **"gui"**, which stands for **"Graphical User Interface"**.
## Thank you
First of all, I would like to thank [shadcn](https://ui.shadcn.com) for the inspiration. I am grateful to everyone who uses 9ui, provides feedback, and helps me improve it. Thank you!
## FAQ
Yes. It is free and open source. You can use it in your projects without
any costs. I would love to see your projects using it.
Yes. It is a design system that allows you to create beautiful and
customizable components.
You can use it with all the frameworks that support React. Such as
Next.js, Remix, Astro, Gatsby, etc.
---
### LLMs
AI-friendly documentation for 9ui
This page provides AI-friendly documentation formats that can be used by large language models (LLMs) to better understand and work with 11ui components.
## Available Formats
We provide two different formats of documentation optimized for AI consumption:
### llms.txt
A concise index format with links to individual component documentation. This format is ideal for:
- Quick reference and component discovery
- Integration with AI tools that need structured navigation
- Systems that work better with linked content
[See llms.txt](/llms.txt)
### llms-full.txt
A comprehensive format containing the complete documentation for all components in a single file. This format is ideal for:
- AI models that need full context in a single document
- Local processing and analysis
- Systems that work better with embedded content
[See llms-full.txt](/llms-full.txt)
## Usage
These files are automatically generated from the same MDX source files used for the website documentation, ensuring consistency and accuracy.
The documentation includes:
- Component descriptions and use cases
- Installation instructions
- Code examples and demos
Both formats are updated automatically when the documentation is built, so they always reflect the latest component information.
---
### Next.js
Setting up dark mode in your Next.js project.
**Install .**
```bash title="Terminal"
npm install next-themes
```
**Create .**
```tsx title="providers/theme-provider.tsx"
"use client"
import { ThemeProvider as NextThemesProvider } from "next-themes"
export function ThemeProvider({
children,
...props
}: React.ComponentProps) {
return {children}
}
```
**Wrap your root layout with the provider.**
```tsx {1,12-19} title="app/layout.tsx"
import { ThemeProvider } from "@/providers/theme-provider"
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
{children}
)
}
```
**Add theme toggle component.**
---
### Remix
Setting up dark mode in your Remix project.
**Update tailwind.css file.**
This will allow you to use `dark` class to apply dark mode styles.
```css {1-2} title="tailwind.css"
.dark,
:root[class~="dark"] {
/* Your dark mode styles */
}
```
**Install .**
```bash title="Terminal"
npm install remix-themes
```
**Create session storage.**
```tsx title="sessions.server.tsx"
import { createCookieSessionStorage } from "@remix-run/node"
import { createThemeSessionResolver } from "remix-themes"
const sessionStorage = createCookieSessionStorage({
cookie: {
name: "__remix-themes",
// domain: 'remix.run',
path: "/",
httpOnly: true,
sameSite: "lax",
secrets: ["s3cr3t"],
// secure: true,
},
})
export const themeSessionResolver = createThemeSessionResolver(sessionStorage)
```
**Create action to set theme.**
```tsx title="routes/action.set-theme.tsx"
import { createThemeAction } from "remix-themes"
import { themeSessionResolver } from "../sessions.server"
export const action = createThemeAction(themeSessionResolver)
```
**Add theme provider to root layout.**
```tsx {18-23, 25-32, 35, 36, 38, 42, 43} title="root.tsx"
import "./tailwind.css"
import { LoaderFunctionArgs } from "@remix-run/node"
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
useLoaderData,
} from "@remix-run/react"
import clsx from "clsx"
import { PreventFlashOnWrongTheme, ThemeProvider, useTheme } from "remix-themes"
import { themeSessionResolver } from "./sessions.server"
export async function loader({ request }: LoaderFunctionArgs) {
const { getTheme } = await themeSessionResolver(request)
return {
theme: getTheme(),
}
}
export default function AppWithProviders() {
const data = useLoaderData()
return (
)
}
export function App() {
const data = useLoaderData()
const [theme] = useTheme()
return (
)
}
```
**Add theme toggle component.**
```tsx title="components/theme-toggle.tsx"
import * as React from "react"
import { MoonIcon, SunIcon } from "lucide-react"
import { Theme, useTheme } from "remix-themes"
import { Button } from "./ui/button"
export function ModeToggle() {
const [theme, setTheme] = useTheme()
const toggleTheme = React.useCallback(() => {
setTheme(theme === Theme.LIGHT ? Theme.DARK : Theme.LIGHT)
}, [theme, setTheme])
return (
)
}
```
---
### Roadmap
What's coming next
We plan to add more components and features as Base UI continues to evolve, and 9ui will grow right alongside it.
Development isn’t just about adding new components. We’ll also improve existing ones and enhance their usability over time.
User feedback is incredibly valuable to us. To share your ideas or issues, feel free to open an issue on [GitHub](https://github.com/borabaloglu/9ui/issues) or reach out to [@borabalogluu](https://x.com/borabalogluu) on X.
There’s no strict deadline, but we do have features in the pipeline. To follow our active development, check out [roadmap](https://9ui.featurebase.app/roadmap) for real-time updates.
---
### Theming
Using CSS variables to customize the theme.
## Color Tokens
The theme system is built with semantic color tokens that represent specific use cases rather than literal colors. Here are the main color tokens and their use cases:
### Base Colors
- `background` / `foreground`: Primary background and text colors
- `card` / `card-foreground`: Used for card components and their content
- `popover` / `popover-foreground`: For popover, dropdown, dialog, etc.
### Interactive Elements
- `primary` / `primary-foreground`: Main brand color, used for primary actions
- `secondary` / `secondary-foreground`: Less prominent actions and elements
- `muted` / `muted-foreground`: Subdued elements like secondary text
- `accent` / `accent-foreground`: Highlighted or featured elements
- `destructive` / `destructive-foreground`: Dangerous or destructive actions
### Status Colors
- `danger` / `danger-foreground` / `danger-border`: Error states and critical alerts
- `warning` / `warning-foreground` / `warning-border`: Warning messages and alerts
- `info` / `info-foreground` / `info-border`: Informational messages
- `success` / `success-foreground` / `success-border`: Success states and confirmations
### Utility Colors
- `border`: Default border color
- `input`: Form input borders
- `ring`: Focus ring color for interactive elements
### Chart Colors
- `chart-1` through `chart-5`: Predefined colors for data visualizations
## Why OKLCH?
1. **Wider Color Gamut**: OKLCH can represent a broader range of colors
2. **Better Color Interpolation**: Smoother transitions and animations
3. **Perceptual Uniformity**: More natural-looking color variations
## Customizing Colors
### Adding New Colors
To add new colors to your theme:
**Add the CSS variables in **
```css title="globals.css"
:root {
/* Existing colors */
--custom-color: oklch(0.627 0.265 303.9);
--custom-color-foreground: oklch(0.977 0.014 308.299);
}
.dark {
/* Existing dark mode colors */
--custom-color: oklch(0.627 0.265 303.9);
--custom-color-foreground: oklch(0.977 0.014 308.299);
}
@theme inline {
/* Existing colors */
--color-custom-color: var(--custom-color);
--color-custom-color-foreground: var(--custom-color-foreground);
}
```
### Using Custom Colors
After adding new colors, you can use them with Tailwind's utility classes:
```jsx title="Usage"
Custom colored content
```
---
### Vite
Setting up dark mode in your Vite project.
**Create a theme provider component.**
```tsx title="providers/theme-provider.tsx"
import { createContext, useContext, useEffect, useState } from "react"
type Theme = "dark" | "light" | "system"
type ThemeProviderProps = {
children: React.ReactNode
defaultTheme?: Theme
storageKey?: string
}
type ThemeProviderState = {
theme: Theme
setTheme: (theme: Theme) => void
}
const ThemeProviderContext = createContext(
undefined
)
export function ThemeProvider({
children,
defaultTheme = "system",
storageKey = "vite-ui-theme",
...props
}: ThemeProviderProps) {
const [theme, setTheme] = useState(
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
)
useEffect(() => {
const root = window.document.documentElement
root.classList.remove("light", "dark")
if (theme === "system") {
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
.matches
? "dark"
: "light"
root.classList.add(systemTheme)
return
}
root.classList.add(theme)
}, [theme])
useEffect(() => {
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)")
// Add listener for system theme changes
const handleChange = () => {
if (theme === "system") {
const root = window.document.documentElement
root.classList.remove("light", "dark")
root.classList.add(mediaQuery.matches ? "dark" : "light")
}
}
mediaQuery.addEventListener("change", handleChange)
return () => mediaQuery.removeEventListener("change", handleChange)
}, [theme])
const value = {
theme,
setTheme: (theme: Theme) => {
localStorage.setItem(storageKey, theme)
setTheme(theme)
},
}
return (
{children}
)
}
export const useTheme = () => {
const context = useContext(ThemeProviderContext)
if (context === undefined)
throw new Error("useTheme must be used within a ThemeProvider")
return context
}
```
**Wrap your app with the provider.**
```tsx {1,5-7} title="main.tsx"
import { ThemeProvider } from "@/providers/theme-provider"
function App() {
return (
{/* Your app content */}
)
}
export default App
```
**Add theme toggle component.**
```tsx title="components/theme-toggle.tsx"
import * as React from "react"
import { MoonIcon, SunIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { useTheme } from "@/providers/theme-provider"
export default function ThemeToggle() {
const { setTheme, theme } = useTheme()
const toggleTheme = React.useCallback(() => {
setTheme(theme === "dark" ? "light" : "dark")
}, [theme, setTheme])
return (
)
}
```
---
## Components
### Accordion
A collapsible section to show or hide content.
### Example
```tsx
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"
export default function AccordionDemo() {
return (
Is it an accordion?
Yes, it is an accordion. It is a component that allows you to collapse
and expand content.
Is it animated?
Yes, it is animated. It is a component that allows you to collapse and
expand content.
Is it customizable?
Yes, it is customizable. It is a component that allows you to collapse
and expand content.
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/accordion.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"
```
```tsx title="Anatomy"
```
---
### Alert
Used to highlight important messages.
### Example
```tsx
import { AlertTriangleIcon } from "lucide-react"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export default function AlertDemo() {
return (
No Internet Connection
Please check your internet connection and try again.
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/alert.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
```
```tsx title="Anatomy"
```
## Examples
### Success
### Example
```tsx
import { CircleCheckIcon } from "lucide-react"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export default function AlertSuccess() {
return (
Your account has been created
You can now sign in with your new account credentials.
)
}
```
---
### Info
### Example
```tsx
import { InfoIcon } from "lucide-react"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export default function AlertInfo() {
return (
Browser Update Available
A new version of your browser is available. Updating your browser
ensures better security and performance.
)
}
```
---
### Warning
### Example
```tsx
import { AlertTriangleIcon } from "lucide-react"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export default function AlertWarning() {
return (
Your session is about to expire
You will be logged out in 5 minutes. Please save your work and refresh
the page.
)
}
```
---
### Danger
### Example
```tsx
import { XCircleIcon } from "lucide-react"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export default function AlertDanger() {
return (
Your subscription has been canceled
Your access to premium features will end in 30 days. You can reactivate
your subscription anytime.
)
}
```
---
### With action
### Example
```tsx
import { AlertTriangleIcon } from "lucide-react"
import { Alert, AlertTitle } from "@/components/ui/alert"
import { Button } from "@/components/ui/button"
export default function AlertWithAction() {
return (
No Internet Connection
)
}
```
---
### Alert Dialog
A modal dialog for critical messages or confirmation actions.
### Example
```tsx
import {
AlertDialog,
AlertDialogClose,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"
export default function AlertDialogDemo() {
return (
(
)}
/>
Are you sure?
This action cannot be undone. Your post will be permanently deleted.
(
)}
/>
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/alert-dialog.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import {
AlertDialog,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
```
```tsx title="Anatomy"
```
---
### Aspect Ratio
Allows you to display an element at a specific aspect ratio.
### Example
```tsx
import { AspectRatio } from "@/components/ui/aspect-ratio"
export default function AspectRatioDemo() {
return (
Content
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/aspect-ratio.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import { AspectRatio } from "@/components/ui/aspect-ratio"
```
```tsx title="Anatomy"
```
---
### Avatar
Displays an avatar with a fallback.
### Example
```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
export default function AvatarDemo() {
return (
BB
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/avatar.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
```
```tsx title="Anatomy"
```
## Examples
### Sizes
### Example
```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
export default function AvatarSizes() {
return (
BBBBBB
)
}
```
---
### With Fallback
### Example
```tsx
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
export default function AvatarWithFallback() {
return (
BB
)
}
```
---
### Badge
Displays a badge for labeling or highlighting content.
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeDemo() {
return Badge
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/badge.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import { Badge } from "@/components/ui/badge"
```
```tsx title="Anatomy"
```
## Examples
### Outline
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeOutline() {
return Outline
}
```
---
### Secondary
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeSecondary() {
return Secondary
}
```
---
### Success
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeSuccess() {
return Success
}
```
---
### Warning
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeWarning() {
return Warning
}
```
---
### Info
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeInfo() {
return Info
}
```
---
### Danger
### Example
```tsx
import { Badge } from "@/components/ui/badge"
export default function BadgeDanger() {
return Danger
}
```
---
### Breadcrumbs
Displays a navigation path for better context.
### Example
```tsx
import {
Breadcrumb,
BreadcrumbEllipsis,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumbs"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
export default function BreadcrumbsDemo() {
return (
HomeToggle menuDocumentationThemesGitHubComponentsBreadcrumb
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/breadcrumbs.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import {
Breadcrumb,
BreadcrumbEllipsis,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumbs"
```
```tsx title="Anatomy"
```
## Examples
### Custom Separator
### Example
```tsx
import { SlashIcon } from "lucide-react"
import {
Breadcrumb,
BreadcrumbEllipsis,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumbs"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
export default function BreadcrumbsCustomSeparator() {
return (
HomeToggle menuDocumentationThemesGitHubComponentsBreadcrumb
)
}
```
---
### Button
Displays a button for user interaction.
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonDemo() {
return
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/button.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import { Button } from "@/components/ui/button"
```
```tsx title="Anatomy"
```
## Examples
### Sizes
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonSizes() {
return (
)
}
```
---
### With Icon
### Example
```tsx
import { PencilIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
export default function ButtonIcon() {
return (
)
}
```
---
### Secondary
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonSecondary() {
return
}
```
---
### Outline
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonOutline() {
return
}
```
---
### Ghost
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonGhost() {
return
}
```
---
### Link
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonLink() {
return
}
```
---
### Destructive
### Example
```tsx
import { Button } from "@/components/ui/button"
export default function ButtonDestructive() {
return
}
```
---
### Loading
### Example
```tsx
import { Loader2Icon } from "lucide-react"
import { Button } from "@/components/ui/button"
export default function ButtonLoading() {
return (
)
}
```
---
### Calendar
Provides a visual interface for date selection.
### Example
```tsx
import { Calendar } from "@/components/ui/calendar"
export default function CalendarDemo() {
return
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/calendar.json
```
**Install dependencies**
```bash title="Terminal"
npm install react-day-picker
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import { Calendar } from "@/components/ui/calendar"
```
```tsx title="Anatomy"
```
## Examples
### Single Date
### Example
```tsx
"use client"
import { useState } from "react"
import { Calendar } from "@/components/ui/calendar"
export default function CalendarSingle() {
const [selectedDate, setSelectedDate] = useState(undefined)
return (
)
}
```
---
### Multiple Dates
### Example
```tsx
"use client"
import { useState } from "react"
import { Calendar } from "@/components/ui/calendar"
export default function CalendarMultiple() {
const [selectedDates, setSelectedDates] = useState(
undefined
)
return (
)
}
```
---
### Date Range
### Example
```tsx
"use client"
import { useState } from "react"
import { DateRange } from "react-day-picker"
import { Calendar } from "@/components/ui/calendar"
export default function CalendarRange() {
const [range, setRange] = useState(undefined)
return (
)
}
```
---
### Disabled
### Example
```tsx
"use client"
import { useState } from "react"
import { Calendar } from "@/components/ui/calendar"
export default function CalendarDisabled() {
const [selectedDate, setSelectedDate] = useState(undefined)
return (
date < new Date()}
selected={selectedDate}
onSelect={setSelectedDate}
/>
)
}
```
---
### Card
Used to group and present information in a structured box.
### Example
```tsx
import Image from "next/image"
import { LinkIcon, SendIcon } from "lucide-react"
import { toast } from "sonner"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Input } from "@/components/ui/input"
export default function CardDemo() {
return (
Invite Team Members
Invite your team members to join your workspace.
You can invite up to 10 team members. You have 8 invites left.
Invited Members
Karen Smith
karen@9.ui
Chris Williams
chris@9.ui
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/card.json
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
```
```tsx title="Anatomy"
```
## Examples
### With image
### Example
```tsx
import Image from "next/image"
import { Button } from "@/components/ui/button"
import {
Card,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
export default function CardWithImage() {
return (
What is 9ui?
Deep dive into the 9ui components and learn how to use them in your
own projects.
)
}
```
---
### Carousel
A slider to display multiple items in a scrollable view.
### Example
```tsx
import { AspectRatio } from "@/components/ui/aspect-ratio"
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel"
const slides = [1, 2, 3, 4, 5]
export default function CarouselDemo() {
return (
{slides.map((slide) => (
{slide}
))}
)
}
```
## Installation
```bash title="Terminal"
npx shadcn@latest add https://9ui.dev/r/carousel.json
```
**Install dependencies**
```bash title="Terminal"
npm install embla-carousel-react embla-carousel
```
**Copy and paste the following code into your project.**
## Usage
```tsx title="Imports"
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel"
```
```tsx title="Anatomy"
```
## Examples
### Vertical
### Example
```tsx
import { AspectRatio } from "@/components/ui/aspect-ratio"
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel"
const slides = [1, 2, 3, 4, 5]
export default function CarouselVertical() {
return (
{slides.map((slide) => (
{slide}
))}
)
}
```
---
### Multiple
### Example
```tsx
import { AspectRatio } from "@/components/ui/aspect-ratio"
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel"
const slides = [1, 2, 3, 4, 5]
export default function CarouselMultiple() {
return (
{slides.map((slide) => (
{slide}
))}
)
}
```
---
### Looped
### Example
```tsx
import { AspectRatio } from "@/components/ui/aspect-ratio"
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel"
const slides = [1, 2, 3, 4, 5]
export default function CarouselLooped() {
return (