### Installation
Source: https://reui.io/docs/components/radix/phone-input
Instructions for installing the Shadcn Phone Input component.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/phone-input
```
```
--------------------------------
### Examples
Source: https://reui.io/docs/components/base/sortable
Demonstrates different layout examples for the Sortable component.
```APIDOC
## Examples
### Grid
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
```typescript
"use client"
import { useState } from "react"
```
### Nested
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
```typescript
"use client"
import { useState } from "react"
```
### Colors
White
Black
Grey
Green
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
```typescript
"use client"
import { useState } from "react"
```
### Sizes
Small
Medium
Large
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
```typescript
"use client"
import { useState } from "react"
```
### Materials
Cotton
Polyester
Wool
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
```typescript
"use client"
import { useState } from "react"
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/base/sortable
Instructions for installing the ReUI Sortable component.
```APIDOC
## Installation
### CLI
```bash
pnpm dlx shadcn@latest add @reui/sortable
```
### Manual
```bash
pnpm install @reui/sortable
```
### pnpm
```bash
pnpm install @reui/sortable
```
### npm
```bash
npm install @reui/sortable
```
### yarn
```bash
yarn add @reui/sortable
```
### bun
```bash
bun add @reui/sortable
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/radix/sortable
Instructions on how to install the ReUI Sortable component using pnpm.
```APIDOC
## Installation
### pnpm
```bash
pnpm dlx shadcn@latest add @reui/r-sortable
```
```
--------------------------------
### Installation and Usage
Source: https://reui.io/docs/components/base/frame
Instructions on how to install and use the ReUI Frame component.
```APIDOC
## Installation
### CLI
```bash
pnpm dlx shadcn@latest add @reui/frame
```
## Usage
```jsx
import {
Frame,
FrameDescription,
FrameFooter,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/reui/frame"
Frame TitleFrame Description
Frame Content
Frame Footer
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/base/phone-input
Instructions for installing the Shadcn Phone Input component using pnpm.
```APIDOC
## Installation
### pnpm
```sh
pnpm dlx shadcn@latest add @reui/phone-input
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/radix/rating
Instructions for installing the ReUI Rating component.
```APIDOC
## Installation
Use the following command to add the Rating component to your project:
```bash
pnpm dlx shadcn@latest add @reui/rating
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/radix/frame
Instructions for installing the ReUI Frame component using pnpm.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/frame
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/radix/file-upload
Install the ReUI File Upload component using pnpm.
```APIDOC
## Installation
### pnpm
```
pnpm dlx shadcn@latest add @reui/use-file-upload
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/base/kanban
Install the ReUI Kanban component using npm, yarn, or pnpm.
```APIDOC
## Installation
CLIManual
```
pnpm
npm
yarn
bun
```
pnpm dlx shadcn@latest add @reui/kanban
Copy
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/radix/kanban
Instructions for installing the ReUI Kanban component using pnpm, npm, yarn, or bun.
```APIDOC
## Installation
CLIManual
```
pnpm
pnpm dlx shadcn@latest add @reui/kanban
```
```
npm
npx shadcn@latest add @reui/kanban
```
```
yarn
yarn dlx shadcn@latest add @reui/kanban
```
```
bun
bun dlx shadcn@latest add @reui/kanban
```
```
--------------------------------
### Customization Examples
Source: https://reui.io/docs/components/base/frame
Examples demonstrating how to customize the ReUI Frame component.
```APIDOC
### Customizing Radius
You can customize the border radius of the frame and its panels using the `--frame-radius` CSS variable.
```jsx
...
```
### With Separated Panels
```jsx
import {
Frame,
FrameDescription,
} from "@/components/reui/frame"
```
### With Stacked Panels
```jsx
import {
Frame,
FrameDescription,
} from "@/components/reui/frame"
```
### With Dense Panels
```jsx
import {
Frame,
FrameDescription,
} from "@/components/reui/frame"
```
### Without Outer Border
This frame uses variant="ghost" to remove the outer border.
```jsx
import {
Frame,
FrameDescription,
} from "@/components/reui/frame"
```
### Custom Spacing
```jsx
import {
Frame,
FrameDescription,
} from "@/components/reui/frame"
```
### Custom Radius
```jsx
import {
Frame,
FrameDescription,
} from "@/components/reui/frame"
```
```
--------------------------------
### Install Shadcn Frame
Source: https://reui.io/docs/components/base/frame
Install the Shadcn Frame component using pnpm. Ensure you have pnpm installed and configured.
```bash
pnpm dlx shadcn@latest add @reui/frame
```
--------------------------------
### Timeline Installation with pnpm
Source: https://reui.io/docs/components/radix/timeline
Instructions for installing the Shadcn Timeline component using pnpm.
```bash
pnpm dlx shadcn@latest add @reui/r-timeline
```
--------------------------------
### Sortable Installation (pnpm)
Source: https://reui.io/docs/components/base/sortable
Install the ReUI Sortable component using pnpm.
```bash
pnpm dlx shadcn@latest add @reui/sortable
```
--------------------------------
### Install ReUI Stepper
Source: https://reui.io/docs/components/base/stepper
Install the ReUI Stepper component using pnpm. Ensure you have pnpm installed globally.
```bash
pnpm dlx shadcn@latest add @reui/stepper
```
--------------------------------
### Examples
Source: https://reui.io/docs/components/radix/frame
Various examples demonstrating different configurations of the ReUI Frame component.
```APIDOC
## Examples
### With Separated Panels
## Separated panel
### With Stacked Panels
## Stacked panel
### With Dense Panels
## Stacked panel
### Without Outer Border
This frame uses variant="ghost" to remove the outer border. The outer container of this frame has no border, only the background and panels are visible.
### Custom Spacing
## Warehouse A
Dense mode removes outer padding for a more compact appearance.
### Custom Radius
## Auth Service
## Database
## Storage
```
--------------------------------
### Stepper Installation
Source: https://reui.io/docs/components/base/stepper
Install the ReUI Stepper component using pnpm.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/stepper
```
```
--------------------------------
### Example: Size
Source: https://reui.io/docs/components/radix/phone-input
Example demonstrating the different size variants of the PhoneInput component.
```APIDOC
## Examples
### Size
```jsx
import { PhoneInput } from "@/components/reui/phone-input"
export function Pattern() {
return (
)
}
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/base/file-upload
Install the ReUI File Upload component using pnpm, npm, or yarn.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/use-file-upload
```
```
--------------------------------
### Alert Installation
Source: https://reui.io/docs/alert
Instructions for installing the ReUI Alert component using pnpm.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/alert
```
```
--------------------------------
### Usage Example
Source: https://reui.io/docs/components/base/phone-input
A basic example demonstrating how to use the PhoneInput component in a React application.
```APIDOC
## Usage
```jsx
import { PhoneInput } from "@/components/reui/phone-input"
function MyComponent() {
const [value, setValue] = React.useState("");
return (
);
}
```
```
--------------------------------
### Timeline Installation with pnpm
Source: https://reui.io/docs/components/base/timeline
Instructions for installing the ReUI Timeline component using pnpm, a package manager.
```bash
pnpm dlx shadcn@latest add @reui/timeline
```
--------------------------------
### Timeline Component Usage Example
Source: https://reui.io/docs/components/base/timeline
Example of how to import and use the ReUI Timeline component.
```APIDOC
## Usage
### Installation
```typescript
import {
Timeline,
TimelineContent,
TimelineDate,
TimelineHeader,
TimelineIndicator,
TimelineItem,
TimelineSeparator,
TimelineTitle,
} from "@/components/reui/timeline"
```
### Basic Example
```jsx
March 2024Project Initialized
Successfully set up the project repository and initial architecture.
```
```
--------------------------------
### Progress Upload Example
Source: https://reui.io/docs/components/base/file-upload
Demonstrates file uploads with progress indication. Supports multiple file types up to 10MB each.
```javascript
"use client"
import { useEffect, useState } from "react"
```
--------------------------------
### Install Kanban Component
Source: https://reui.io/docs/components/base/kanban
Install the @reui/kanban package using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/kanban
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/radix/scrollspy
Instructions on how to install the ReUI Scrollspy component using pnpm, npm, or yarn.
```APIDOC
## Installation
### pnpm
```sh
pnpm dlx shadcn@latest add @reui/scrollspy
```
### npm
```sh
npm dlx shadcn@latest add @reui/scrollspy
```
### yarn
```sh
yarn dlx shadcn@latest add @reui/scrollspy
```
```
--------------------------------
### Badge Component Installation
Source: https://reui.io/docs/badge
Instructions on how to install the ReUI Badge component using pnpm, npm, or yarn.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/badge
```
Or using npm:
```bash
npx shadcn-ui@latest add @reui/badge
```
Or using yarn:
```bash
yarn dlx shadcn@latest add @reui/badge
```
```
--------------------------------
### Badge Component Installation
Source: https://reui.io/docs/components/base/badge
Instructions on how to install the ReUI Badge component using pnpm, npm, yarn, or bun.
```APIDOC
## Installation
### pnpm
```bash
pnpm dlx shadcn@latest add @reui/badge
```
### npm
```bash
npx shadcn@latest add @reui/badge
```
### yarn
```bash
yarn dlx shadcn@latest add @reui/badge
```
### bun
```bash
bun dlx shadcn@latest add @reui/badge
```
```
--------------------------------
### PhoneInput Component Example
Source: https://reui.io/docs/components/base/phone-input
An example demonstrating the PhoneInput component, likely for showcasing its functionality or a specific variant.
```javascript
import { PhoneInput } from "@/components/reui/phone-input"
export function Pattern() {
}
```
--------------------------------
### Install Shadcn Autocomplete
Source: https://reui.io/docs/components/base/autocomplete
Install the Shadcn Autocomplete component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/autocomplete
```
--------------------------------
### Alert with Icon Example
Source: https://reui.io/docs/alert
Example of an Alert component displaying an icon, title, and description.
```javascript
import {
Alert,
AlertDescription,
```
--------------------------------
### Badge Installation
Source: https://reui.io/docs/components/radix/badge
Install the ReUI Badge component using pnpm, yarn, or npm.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/r-badge
```
```
--------------------------------
### Install Shadcn Filters
Source: https://reui.io/docs/components/radix/filters
Install the Shadcn filters using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/filters
```
--------------------------------
### Install Shadcn Data Grid
Source: https://reui.io/docs/components/base/data-grid
Install the Shadcn Data Grid package using pnpm. This command adds the necessary components to your project.
```bash
pnpm dlx shadcn@latest add @reui/data-grid
```
--------------------------------
### Rating Component Installation
Source: https://reui.io/docs/components/base/rating
Instructions for installing the ReUI Rating component using pnpm.
```APIDOC
## Installation
```bash
pnpm dlx shadcn@latest add @reui/rating
```
```
--------------------------------
### Usage Example
Source: https://reui.io/docs/components/base/scrollspy
A basic example demonstrating how to use the Scrollspy component with navigation links and target sections.
```APIDOC
## Usage
```jsx
import { Scrollspy } from "@/components/reui/scrollspy"
import { useRef } from "react"
function MyComponent() {
const containerRef = useRef(null)
return (
)
}
```
```
--------------------------------
### Installation
Source: https://reui.io/docs/components/base/scrollspy
Instructions for installing the ReUI Scrollspy component using pnpm, npm, yarn, or bun.
```APIDOC
## Installation
### pnpm
```sh
pnpm dlx shadcn@latest add @reui/scrollspy
```
### npm
```sh
npx shadcn@latest add @reui/scrollspy
```
### yarn
```sh
yarn dlx shadcn@latest add @reui/scrollspy
```
### bun
```sh
bunx shadcn@latest add @reui/scrollspy
```
```
--------------------------------
### Basic Usage
Source: https://reui.io/docs/components/radix/frame
Example of how to use the ReUI Frame component with its sub-components.
```APIDOC
## Usage
```jsx
import {
Frame,
FrameDescription,
FrameFooter,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/reui/frame"
```
```jsx
Frame TitleFrame Description
Frame Content
Frame Footer
```
```
--------------------------------
### Basic Autocomplete Usage
Source: https://reui.io/docs/components/base/autocomplete
Demonstrates the basic setup for the Autocomplete component. Ensure all necessary components are imported from '@/components/reui/autocomplete'.
```jsx
import {
Autocomplete,
AutocompleteContent,
AutocompleteEmpty,
AutocompleteInput,
AutocompleteItem,
AutocompleteList,
} from "@/components/reui/autocomplete"
const items = [
{ value: "apple", label: "Apple" },
{ value: "banana", label: "Banana" },
{ value: "orange", label: "Orange" },
{ value: "grape", label: "Grape" },
]
No results found.
{(item) => {item.label}}
```
--------------------------------
### Install Shadcn Phone Input
Source: https://reui.io/docs/components/base/phone-input
Install the Shadcn Phone Input component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/phone-input
```
--------------------------------
### Show Value Example
Source: https://reui.io/docs/components/radix/rating
Example of the Rating component configured to display the numeric rating value next to the stars.
```javascript
import { Rating } from "@/components/reui/rating"
export function Pattern() {
}
```
```javascript
4.5
```
--------------------------------
### Badge Component Examples
Source: https://reui.io/docs/components/base/badge
Various examples demonstrating different variants, sizes, and features of the ReUI Badge component.
```APIDOC
## Examples
### Secondary
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Destructive
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Success
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Info
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Warning
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Outline
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Primary Outline
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Destructive Outline
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Info Outline
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Success Outline
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Warning Outline
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Primary Light
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Destructive Light
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Success Light
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Info Light
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Warning Light
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### Size
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return (
<>
xssmdefaultlgxl
>
)
}
```
### Full Radius
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Pill
}
```
### With Icon
```javascript
import { Badge } from "@/components/reui/badge"
import { CheckIcon } from 'lucide-react'
function Pattern() {
return Badge
}
```
### With Icon Button
```javascript
import { Badge } from "@/components/reui/badge"
import { Button } from "@/components/ui/button"
function Pattern() {
return (
)
}
```
### With Dot
```javascript
import { Badge } from "@/components/reui/badge"
function Pattern() {
return Badge
}
```
### With Link
```javascript
import Link from "next/link"
import { Badge } from "@/components/reui/badge"
function Pattern() {
return (
Link
)
}
```
```
--------------------------------
### Badge Component Usage Examples
Source: https://reui.io/docs/badge
Examples demonstrating various ways to use the ReUI Badge component with different variants, sizes, and features.
```APIDOC
## Usage
```jsx
import { Badge } from "@/components/reui/badge"
```
```jsx
Badge
```
## Examples
### Secondary
```jsx
Badge
```
### Destructive
```jsx
Badge
```
### Success
```jsx
Badge
```
### Info
```jsx
Badge
```
### Warning
```jsx
Badge
```
### Outline
```jsx
Badge
```
### Primary Outline
```jsx
Badge
```
### Destructive Outline
```jsx
Badge
```
### Info Outline
```jsx
Badge
```
### Success Outline
```jsx
Badge
```
### Warning Outline
```jsx
Badge
```
### Primary Light
```jsx
Badge
```
### Destructive Light
```jsx
Badge
```
### Success Light
```jsx
Badge
```
### Info Light
```jsx
Badge
```
### Warning Light
```jsx
Badge
```
### Size
```jsx
SmallDefaultLarge
```
### Full Radius
```jsx
Pill
```
### With Icon
```jsx
import { Badge } from "@/components/reui/badge"
import { CheckIcon } from 'lucide-react'
Check
```
### With Icon Button
```jsx
import { Badge } from "@/components/reui/badge"
import { Button } from "@/components/ui/button"
```
### With Dot
```jsx
Dot
```
### With Link
```jsx
import Link from "next/link"
import { Badge } from "@/components/reui/badge"
Link
```
```
--------------------------------
### Image Upload Example
Source: https://reui.io/docs/components/radix/file-upload
Example for uploading a single image file with specific format and size restrictions. Includes a browse button for file selection.
```javascript
"use client"
import { useCallback, useState } from "react"
```
--------------------------------
### Usage
Source: https://reui.io/docs/components/radix/phone-input
Basic usage example for the PhoneInput component.
```APIDOC
## Usage
```jsx
import { PhoneInput } from "@/components/reui/phone-input"
```
```
--------------------------------
### Install Shadcn File Upload
Source: https://reui.io/docs/components/base/file-upload
Install the Shadcn File Upload component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/use-file-upload
```
--------------------------------
### Usage
Source: https://reui.io/docs/components/radix/kanban
Example of how to import and use the ReUI Kanban component in your React application.
```APIDOC
## Usage
```jsx
import {
Kanban,
KanbanBoard,
KanbanColumn,
KanbanColumnContent,
KanbanColumnHandle,
KanbanItem,
KanbanItemHandle,
KanbanOverlay,
} from "@/components/reui/kanban"
```
```jsx
item.id}
>
{Object.entries(columns).map(([id, items]) => (
{id}
{items.map((item) => (
{item.content}
))}
))}
```
```
--------------------------------
### Install ReUI Accordion Component
Source: https://reui.io/docs/registry
Install the accordion component from the ReUI registry using the shadcn CLI with the `@reui/c-accordion-1` syntax. This command requires pnpm.
```bash
pnpm dlx dlx shadcn@latest add @reui/c-accordion-1
```
--------------------------------
### Install Shadcn Alert
Source: https://reui.io/docs/components/base/alert
Install the Shadcn Alert component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/alert
```
--------------------------------
### Alert with Action Buttons Example
Source: https://reui.io/docs/alert
Example of an Alert component featuring action buttons for user interaction.
```javascript
import {
Alert,
AlertAction,
```
--------------------------------
### Date Selector Configuration Example
Source: https://reui.io/docs/components/base/date-selector
Example of a JSON configuration object for the Date Selector, specifying the period and operator.
```json
{
"period": "day",
"operator": "is"
}
```
--------------------------------
### Install Shadcn Badge
Source: https://reui.io/docs/components/radix/badge
Install the ReUI badge component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/r-badge
```
--------------------------------
### Avatar Upload Example
Source: https://reui.io/docs/components/base/file-upload
Example of an avatar upload component. It specifies accepted image types and size limits.
```javascript
"use client"
import {
```
--------------------------------
### Install ReUI Filters Component
Source: https://reui.io/docs/registry
Install the filters component from the ReUI registry using the shadcn CLI with the `@reui/filters` syntax. This command requires pnpm.
```bash
pnpm dlx dlx shadcn@latest add @reui/filters
```
--------------------------------
### Install Shadcn Tree with pnpm
Source: https://reui.io/docs/components/base/tree
Use this command to add the Shadcn Tree component to your project using pnpm.
```bash
pnpm dlx shadcn@latest add @reui/tree
```
--------------------------------
### Install Shadcn Rating
Source: https://reui.io/docs/components/base/rating
Install the Shadcn Rating component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/rating
```
--------------------------------
### Frame with Separated Panels Example
Source: https://reui.io/docs/components/base/frame
Illustrates the usage of the Frame component with separated panels. This setup is suitable for distinct content sections within a frame.
```jsx
import {
Frame,
FrameDescription,
}
```
--------------------------------
### API Usage Example: Success Light Badge
Source: https://reui.io/docs/components/base/badge
Illustrates using the 'success-light' variant and 'sm' size for a badge. This example highlights the extended color tokens used by ReUI.
```javascript
Success
```
--------------------------------
### Usage
Source: https://reui.io/docs/components/base/sortable
Basic usage example for the ReUI Sortable component.
```APIDOC
## Usage
```typescript
import {
Sortable,
SortableItem,
SortableItemHandle,
} from "@/components/reui/sortable"
```
```jsx
item.id}
>
{items.map((item) => (
{item.content}
))}
```
```
--------------------------------
### Configure MCP Server
Source: https://reui.io/docs/mcp
Run this command to initialize the MCP server. Select your MCP client and enable the server to complete the setup.
```bash
pnpm dlx shadcn@latest mcp init
```
--------------------------------
### Install Date Selector with pnpm
Source: https://reui.io/docs/components/base/date-selector
Install the ReUI Date Selector component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/date-selector
```
--------------------------------
### Badge API Usage Examples
Source: https://reui.io/docs/components/radix/badge
Illustrates how to use the Badge component with specific variants and sizes, and how to achieve a pill shape.
```javascript
Success
```
```javascript
Pill
```
--------------------------------
### Alert Usage Example
Source: https://reui.io/docs/alert
Demonstrates how to import and use the ReUI Alert component in a React application.
```APIDOC
## Usage
```javascript
import {
Alert,
AlertAction,
AlertDescription,
AlertTitle,
} from "@/components/reui/alert"
```
```javascript
Security UpdateUpdate your password and enable 2FA.
```
```
--------------------------------
### Shadcn Number Field Size Example
Source: https://reui.io/docs/components/base/number-field
Example demonstrating how to configure the size of the Shadcn Number Field. This snippet focuses on the import statements.
```jsx
import {
NumberField,
NumberFieldDecrement,
}
```
--------------------------------
### Rating Component Examples
Source: https://reui.io/docs/components/radix/rating
Demonstrates various configurations of the ReUI Rating component.
```APIDOC
## Examples
### Decimal Rating
```javascript
import { Rating } from "@/components/reui/rating"
export function Pattern() {
return ;
}
```
### Show Value
```javascript
import { Rating } from "@/components/reui/rating"
export function Pattern() {
return ;
}
```
### Editable Rating
```javascript
import { Rating } from "@/components/reui/rating"
import { useState } from "react"
export function Pattern() {
const [rating, setRating] = useState(0.0)
return ;
}
```
### Size Variants
```javascript
import { Rating } from "@/components/reui/rating"
export function Pattern() {
return (
<>
>
);
}
```
```
--------------------------------
### Sortable Upload Example
Source: https://reui.io/docs/components/radix/file-upload
Example of a sortable file upload component for images. It allows users to reorder uploaded files via drag and drop and specifies file type and size limits.
```javascript
"use client"
import { useCallback, useEffect, useState } from "react"
```
--------------------------------
### Timeline Component Usage
Source: https://reui.io/docs/components/radix/timeline
Example of how to import and use the Timeline component with its various sub-components.
```jsx
import {
Timeline,
TimelineContent,
TimelineDate,
TimelineHeader,
TimelineIndicator,
TimelineItem,
TimelineSeparator,
TimelineTitle,
} from "@/components/reui/r-timeline"
March 2024Project Initialized
Successfully set up the project repository and initial architecture.
```
--------------------------------
### Secondary Badge Example
Source: https://reui.io/docs/badge
Renders a badge with the 'secondary' variant. Ensure the Badge component is imported.
```javascript
import { Badge } from "@/components/reui/badge"
export function Pattern() {
```
View Code
```
--------------------------------
### Import Timeline Components
Source: https://reui.io/docs/components/base/timeline
Import all necessary components for the Timeline from the ReUI library. Ensure the path is correct for your project setup.
```javascript
import {
Timeline,
TimelineContent,
TimelineDate,
TimelineHeader,
TimelineIndicator,
TimelineItem,
TimelineSeparator,
TimelineTitle,
} from "@/components/reui/timeline"
```
--------------------------------
### Horizontal Example
Source: https://reui.io/docs/components/radix/scrollspy
An example demonstrating the horizontal layout of the Scrollspy component.
```APIDOC
## Examples
### Horizontal
```jsx
// Example JSX for horizontal layout would go here, similar to the basic usage but styled horizontally.
// The provided text only shows the visual output and a client-side hook, not the full JSX.
```
```jsx
"use client"
import { useRef } from "react"
```
```
--------------------------------
### Rating Component Usage Example
Source: https://reui.io/docs/components/base/rating
Basic usage example of the ReUI Rating component.
```APIDOC
## Usage Example
### Basic Usage
```jsx
import { Rating } from "@/components/reui/rating"
```
```
--------------------------------
### Sortable Upload Example
Source: https://reui.io/docs/components/base/file-upload
Allows uploading up to 5 images (JPG, PNG, GIF, WebP, max 10 MB each) with drag-and-drop reordering functionality. Includes accessibility features for managing draggable items.
```javascript
"use client"
import { useCallback, useEffect, useState } from "react"
```
--------------------------------
### Basic Kanban Board Usage
Source: https://reui.io/docs/components/base/kanban
Implement a functional Kanban board using the imported components. This example demonstrates how to manage column and item state with `useState` and pass it to the `Kanban` component.
```typescript
item.id}
>
{Object.entries(columns).map(([id, items]) => (
{id}
{items.map((item) => (
{item.content}
))}
))}
```
--------------------------------
### Basic Usage
Source: https://reui.io/docs/components/base/file-upload
Demonstrates how to use the `useFileUpload` hook to manage file uploads in a React component.
```APIDOC
## Usage
```javascript
import { useFileUpload } from "@/hooks/use-file-upload"
const [{ files }, { openFileDialog, getInputProps }] = useFileUpload({
accept: "image/*",
multiple: false,
})
return (
{files.map((file) => (
{file.file.name}
))}
)
```
```
--------------------------------
### Install Shadcn Number Field
Source: https://reui.io/docs/components/base/number-field
Install the Shadcn Number Field component using pnpm. This command adds the necessary package to your project.
```bash
pnpm dlx shadcn@latest add @reui/number-field
```
--------------------------------
### Basic File Upload Usage
Source: https://reui.io/docs/components/base/file-upload
Demonstrates the basic usage of the `useFileUpload` hook to handle file uploads. It includes opening the file dialog and displaying selected file names.
```javascript
import { useFileUpload } from "@/hooks/use-file-upload"
const [{ files }, { openFileDialog, getInputProps }] = useFileUpload({
accept: "image/*",
multiple: false,
})
return (
{files.map((file) => (
{file.file.name}
))}
)
```
--------------------------------
### Basic Tree Usage in React
Source: https://reui.io/docs/components/radix/tree
Demonstrates how to use the Tree, TreeItem, and TreeItemLabel components to render a tree structure. Ensure you have the tree instance from '@headless-tree/core'.
```jsx
import { Tree, TreeItem, TreeItemLabel } from "@/components/reui/r-tree"
```
```jsx
{tree.getItems().map((item) => (
))}
```
--------------------------------
### Editable Rating Example
Source: https://reui.io/docs/components/base/rating
Example demonstrating an editable rating component. This requires the `editable` prop to be set to `true` and typically involves managing the rating state with `useState`.
```javascript
"use client"
import { useState } from "react"
```
--------------------------------
### Number Field Imports (Example Base)
Source: https://reui.io/docs/components/radix/number-field
These import statements are common across various Shadcn Number Field examples. They provide the necessary components for building the number field interface.
```jsx
import {
NumberField,
NumberFieldDecrement,
```
--------------------------------
### Kanban Component Client Component Setup
Source: https://reui.io/docs/components/base/kanban
This import is typically used within a 'use client' directive to enable client-side interactivity for the Kanban component.
```typescript
"use client"
import { ComponentProps, useState } from "react"
```
--------------------------------
### Usage
Source: https://reui.io/docs/components/radix/scrollspy
Example of how to use the Scrollspy component in a React application.
```APIDOC
## Usage
```jsx
import { Scrollspy } from "@/components/reui/scrollspy"
import { useRef } from "react"
function MyComponent() {
const containerRef = useRef(null)
return (
)
}
```
```
--------------------------------
### Image Upload Example
Source: https://reui.io/docs/components/base/file-upload
A simple image upload component that accepts JPEG and PNG files up to 2MB. It includes a browse button.
```javascript
"use client"
import { useCallback, useState } from "react"
```
--------------------------------
### Badge with Secondary Variant
Source: https://reui.io/docs/components/radix/badge
Example of a Badge component with the 'secondary' variant.
```javascript
import { Badge } from "@/components/reui/badge"
export function Pattern() {
```
--------------------------------
### Basic Data Grid Usage with Footer
Source: https://reui.io/docs/components/base/data-grid
Implement a basic Data Grid with a custom footer. The footer displays the number of rows shown. This example assumes 'data' and 'columns' are defined elsewhere and 'useReactTable' is imported.
```javascript
const footer = (
Showing {data.length} rows
)
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
})
return (
)
```