### Install Badge Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/badge.mdx
Command to install the Badge component. This is the initial setup step.
```bash
npx shadcn-ui@latest add badge
```
--------------------------------
### Install Separator Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/separator.mdx
Install the Separator component using the provided command. This is the initial setup step before using the component in your project.
```bash
npm install @base-ui/react @base-ui/components
```
--------------------------------
### Install Sonner Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/sonner.mdx
Install the Sonner component using the provided command. This is the initial setup step for using the component.
```bash
npm install sonner
# or
yarn add sonner
# or
pnpm add sonner
```
--------------------------------
### Install Pagination Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/pagination.mdx
Use this command to install the pagination component. Ensure you have the base components installed.
```bash
npx shadcn-ui@latest add pagination
```
--------------------------------
### Install Alert Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/alert.mdx
Use this command to install the Alert component. Ensure you have the basecn CLI installed.
```bash
npx shadcn-ui@latest add alert
```
--------------------------------
### Install Drawer Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/drawer.mdx
Use this command to install the Drawer component. Ensure you have the basecn CLI installed.
```bash
npx shadcn-ui@latest add drawer
```
--------------------------------
### Install Calendar Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/calendar.mdx
Use this command to install the Calendar component. Ensure you have the basecn CLI installed.
```bash
npx shadcn-ui@latest add calendar
```
--------------------------------
### Install Menubar Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/menubar.mdx
Use this command to install the Menubar component.
```bash
npm install @base-ui/react@latest
npm install @base-ui/react-icons@latest
```
--------------------------------
### Install Context Menu Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/context-menu.mdx
Use this command to install the context-menu component.
```bash
npm install @base-ui/react
# or
yarn add @base-ui/react
```
--------------------------------
### Install Drawer Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/drawer-base.mdx
Use this command to install the Drawer component. Ensure you have the Base UI CLI installed.
```bash
npx @base-ui/cli component add drawer-base
```
--------------------------------
### Install Dropdown Menu Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/dropdown-menu.mdx
Command to install the dropdown-menu component.
```bash
npm install @base-ui/dropdown-menu
```
--------------------------------
### Install Table Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/table.mdx
Use this command to install the table component into your project. Ensure you have the basecn CLI installed.
```bash
npx shadcn-ui@latest add table
```
--------------------------------
### Install Input Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/input.mdx
Use this command to install the Input component. Ensure you have the necessary package manager configured.
```bash
npm install @base-ui/input
```
--------------------------------
### Install Button Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Install the Button component using the provided command.
```bash
npm install button
# or
yarn add button
```
--------------------------------
### Install Kbd Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/kbd.mdx
Command to install the Kbd component into your project.
```bash
npx shadcn-ui@latest add kbd
```
--------------------------------
### Install Resizable Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/resizable.mdx
Use this command to install the Resizable component into your project.
```bash
npx shadcn-ui@latest add resizable
```
--------------------------------
### Install Sidebar Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/sidebar.mdx
Command to install the sidebar component into your project. Ensure you have the necessary dependencies and project setup.
```bash
npm install sidebar
```
--------------------------------
### Install Textarea Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/textarea.mdx
Command to install the Textarea component into your project.
```bash
npx shadcn-ui@latest add textarea
```
--------------------------------
### Install Combobox Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/combobox-baseui.mdx
Use this command to install the Combobox component for your project.
```bash
npm install @base-ui/react --save
npm install @base-ui/react-combobox --save
```
--------------------------------
### Install Navigation Menu Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/navigation-menu.mdx
Command to install the Navigation Menu component.
```bash
npm install @base-ui/navigation-menu
```
--------------------------------
### Start Development Server
Source: https://github.com/akash3444/basecn/blob/main/CONTRIBUTING.md
Run the development server to test your changes locally. Access the application via http://localhost:3000.
```bash
pnpm dev
```
--------------------------------
### Default Textarea Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/textarea.mdx
A basic example of the Textarea component.
```jsx
import { Textarea } from "@/components/ui/textarea";
export function TextareaDemo() {
return (
);
}
```
--------------------------------
### Install Base UI Package
Source: https://github.com/akash3444/basecn/blob/main/content/docs/get-started/migrating-from-radix-ui.mdx
Install the Base UI React package using pnpm.
```bash
pnpm add @base-ui/react
```
--------------------------------
### Install Tooltip Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/tooltip.mdx
Command to install the Tooltip component. This is typically the first step before using the component in your project.
```bash
npm install @base-ui/tooltip
```
--------------------------------
### Install Checkbox Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/checkbox.mdx
Command to install the checkbox component.
```bash
npm install @baseui/checkbox
# or
yarn add @baseui/checkbox
```
--------------------------------
### Install Empty Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/empty.mdx
Command to install the Empty component. Ensure you have the necessary dependencies.
```bash
npm install empty
```
--------------------------------
### Install Avatar Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/avatar.mdx
Command to install the avatar component.
```bash
npm install @base-ui/react
```
--------------------------------
### Base Button Component Examples
Source: https://context7.com/akash3444/basecn/llms.txt
Demonstrates various variants and sizes of the Button component, including a loading state and rendering as an anchor tag. Ensure lucide-react is installed for icons.
```tsx
import { Button } from "@/components/ui/button";
import { Loader2Icon, TrashIcon } from "lucide-react";
// All variants
export function ButtonExamples() {
return (
{/* Sizes */}
{/* Loading state */}
{/* Render as anchor using Base UI render prop */}
}>Go to Dashboard
);
}
```
--------------------------------
### Install basecn Components using shadcn CLI
Source: https://context7.com/akash3444/basecn/llms.txt
Use the shadcn CLI with the @basecn namespace to add components directly into your project. Components are installed into src/components/ui/.
```bash
# Install any component using the namespaced shorthand
npx shadcn@latest add @basecn/button
npx shadcn@latest add @basecn/dialog
npx shadcn@latest add @basecn/select
npx shadcn@latest add @basecn/accordion
# Or via the full URL (legacy)
npx shadcn@latest add https://basecn.dev/r/button.json
```
--------------------------------
### Install Input Group Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/input-group.mdx
Use this command to install the Input Group component.
```bash
npx shadcn-ui@latest add input-group
```
--------------------------------
### Install Radio Group Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/radio-group.mdx
Command to install the radio-group component. Ensure you have the base-ui package installed.
```bash
npm install @base-ui/radio-group
```
--------------------------------
### Install Aspect Ratio Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/aspect-ratio.mdx
Install the Aspect Ratio component using the provided command. This is a prerequisite for using the component in your project.
```bash
npx basecn add aspect-ratio
```
--------------------------------
### Install Label Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/label.mdx
Command to install the Label component. Run this in your project's terminal.
```bash
npm install @basecn/label
```
--------------------------------
### Install Slider Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/slider.mdx
Install the slider component using the base UI CLI.
```bash
npx baseui component slider
```
--------------------------------
### Install Hover Card Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/hover-card.mdx
Use this command to install the Hover Card component.
```bash
npm install @base-ui/react --save
# or
yarn add @base-ui/react
```
--------------------------------
### Install Alert Dialog
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/alert-dialog.mdx
Command to install the Alert Dialog component.
```bash
npm install @base-ui/react@latest @base-ui/alert-dialog@latest
```
--------------------------------
### Install Spinner Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/spinner.mdx
Command to install the spinner component. Ensure you have the necessary dependencies.
```bash
npx shadcn-ui@latest add spinner
```
--------------------------------
### Install Autocomplete Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/autocomplete.mdx
Command to install the Autocomplete component. Ensure you have the necessary package manager configured.
```bash
npm install @base-ui/autocomplete
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/akash3444/basecn/blob/main/CONTRIBUTING.md
Install all necessary project dependencies using pnpm. This is a required step before running the development server or building the project.
```bash
pnpm install
```
--------------------------------
### Install Accordion Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/accordion.mdx
Use this command to install the Accordion component into your project.
```bash
npx shadcn-ui@latest add accordion
```
--------------------------------
### Basic Switch Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/switch.mdx
A simple demonstration of the Switch component.
```jsx
import { Switch } from "@base-ui/react";
function App() {
return ;
}
```
--------------------------------
### Install Field Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Use this command to install the Field component into your project.
```bash
npx shadcn-ui@latest add field
```
--------------------------------
### Install Separator Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/separator-extended.mdx
Command to install the separator component. Ensure you are in the project root.
```bash
npm install @basecn/separator-extended
```
--------------------------------
### Install Dialog Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/dialog.mdx
Use this command to install the Dialog component. Ensure you have the necessary package manager configured.
```bash
npm install @base-ui/react dialog
```
--------------------------------
### Install Button Group
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button-group.mdx
Install the Button Group component using the basecn CLI.
```bash
npx basecn add button-group
```
--------------------------------
### Install Item Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/item.mdx
Use this command to install the Item component into your project. Ensure you have the necessary package manager configured.
```bash
npx shadcn-ui@latest add item
```
--------------------------------
### Install Sheet Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/sheet.mdx
Use this command to install the Sheet component. Ensure you have the necessary package manager configured.
```bash
npm install @base-ui/react@latest @base-ui/tailwind@latest
```
--------------------------------
### Install Toggle Group Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/toggle-group.mdx
Use this command to install the Toggle Group component into your project.
```bash
npm install @base-ui/react @base-ui/toggle-group
```
--------------------------------
### Install Skeleton Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/skeleton.mdx
Install the Skeleton component using the basecn CLI. This command adds the necessary dependencies and files for the component.
```bash
npx basecn add skeleton
```
--------------------------------
### Install Command Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/command.mdx
Use this command to install the Command component into your project. Ensure you have the necessary package manager configured.
```bash
npx shadcn-ui@latest add command
```
--------------------------------
### Install Card Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/card.mdx
Use this command to install the Card component into your project. Ensure you have the necessary package manager configured.
```bash
npx shadcn-ui@latest add card
```
--------------------------------
### Install Collapsible Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/collapsible.mdx
Use this command to install the collapsible component. Ensure you have the base-ui package manager configured.
```bash
npx baseui install collapsible
```
--------------------------------
### Install Component using Namespaced Registry
Source: https://github.com/akash3444/basecn/blob/main/content/docs/get-started/namespaced-registry.mdx
Use this command to install a component, such as `button`, from the configured Basecn namespaced registry. Ensure the registry is set up in your `components.json`.
```bash
npx shadcn@latest add @basecn/button
```
--------------------------------
### Button Loading State Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Demonstrates how to display a loading state for the Button component.
```tsx
import {
Button,
buttonVariants,
} from "@/components/ui/button";
import {
IconArrowRight,
IconPlus,
} from "@radix-ui/react-icons";
export function ButtonLoading() {
return (
);
}
```
--------------------------------
### Install Carousel Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/carousel.mdx
Use this command to install the Carousel component. Ensure you have the necessary package manager configured.
```bash
npx shadcn-ui@latest add carousel
```
--------------------------------
### Nested Drawer Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/drawer-base.mdx
Demonstrates how to implement nested drawers. This pattern is useful for multi-step processes or complex navigation.
```jsx
```
--------------------------------
### Install Form Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/form-with-react-hook-form.mdx
Use this command to install the form component. Ensure you have the necessary dependencies for React Hook Form.
```bash
npx shadcn-ui@latest add form
```
--------------------------------
### Split Button Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Shows an example of a split button, typically used for primary and secondary actions.
```tsx
import {
Button,
buttonVariants,
} from "@/components/ui/button";
import {
IconArrowRight,
IconPlus,
} from "@radix-ui/react-icons";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
export function ButtonSplit() {
return (
Make a Copy
RenameDelete
);
}
```
--------------------------------
### Install Tabs Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/tabs.mdx
Install the Tabs component using the base UI CLI. This command adds the necessary package to your project.
```bash
npx @base-ui/cli component tabs install
```
--------------------------------
### Install Breadcrumb Component
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/breadcrumb.mdx
Install the Breadcrumb component using the shadcn-ui CLI. This command adds the necessary files to your project.
```bash
npx shadcn-ui@latest add breadcrumb
```
--------------------------------
### Button With Icon Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Shows how to integrate icons within the Button component.
```tsx
import {
Button,
buttonVariants,
} from "@/components/ui/button";
import {
IconArrowRight,
IconPlus,
} from "@radix-ui/react-icons";
export function ButtonWithIcon() {
return (
);
}
```
--------------------------------
### Button Group Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Illustrates how to group multiple Button components together.
```tsx
import {
Button,
buttonVariants,
} from "@/components/ui/button";
import {
IconArrowRight,
IconPlus,
} from "@radix-ui/react-icons";
export function ButtonGroup() {
return (
);
}
```
--------------------------------
### Disabled Textarea Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/textarea.mdx
Demonstrates how to render a Textarea in a disabled state.
```jsx
import { Textarea } from "@/components/ui/textarea";
export function TextareaDisabled() {
return (
);
}
```
--------------------------------
### Skeleton Card Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/skeleton.mdx
A basic example of the Skeleton component used to create a card-like placeholder. This is useful for displaying the structure of a card before its content is loaded.
```jsx
import { Skeleton } from "@/components/ui/skeleton";
export function SkeletonCard() {
return (
);
}
```
--------------------------------
### Field Input Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Demonstrates a basic text input field with a label and help text.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
} from "@/registry/new-york/ui/field";
export default function FieldInput() {
return (
NamePlease enter your full name.
);
}
```
--------------------------------
### Empty Component Outline Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/empty.mdx
Demonstrates how to create an outlined empty state using the `border` utility class.
```jsx
import { Empty } from "@/components/ui/empty";
export default function EmptyOutline() {
return (
No items foundTry creating a new item.
);
}
```
--------------------------------
### Range Calendar Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/calendar.mdx
Demonstrates how to use the Calendar component for selecting a date range.
```tsx
import {
Calendar,
} from "@/components/ui/calendar";
export default function RangeCalendar() {
return ;
}
```
--------------------------------
### Button Shape Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Illustrates how to apply different shapes to the Button component.
```tsx
import {
Button,
buttonVariants,
} from "@/components/ui/button";
import {
IconArrowRight,
IconPlus,
} from "@radix-ui/react-icons";
export function ButtonShape() {
return (
);
}
```
--------------------------------
### Textarea with Helper Text
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/textarea.mdx
Illustrates how to provide helper text below the Textarea to guide the user.
```jsx
import { Textarea } from "@/components/ui/textarea";
import { Label } from "@/components/ui/label";
export function TextareaWithHelperText() {
return (
Your message will be super.
);
}
```
--------------------------------
### Empty Component with Avatar Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/empty.mdx
Illustrates using the `EmptyMedia` component to display an avatar within the empty state.
```jsx
import { Empty } from "@/components/ui/empty";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
export default function EmptyAvatar() {
return (
CNNo items foundTry creating a new item.
);
}
```
--------------------------------
### Clone the basecn Repository
Source: https://github.com/akash3444/basecn/blob/main/CONTRIBUTING.md
Clone your forked repository locally to start making changes. Ensure you navigate into the cloned directory.
```bash
git clone https://github.com/your-username/basecn.git
cd basecn
```
--------------------------------
### Empty Component with Input Group Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/empty.mdx
Shows how to integrate an `InputGroup` component within the `EmptyContent` component for an interactive empty state.
```jsx
import { Empty } from "@/components/ui/empty";
import { InputGroup, Input, Button } from "@/components/ui";
export default function EmptyInputGroup() {
return (
No items foundTry creating a new item.
);
}
```
--------------------------------
### Empty Component with Avatar Group Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/empty.mdx
Demonstrates how to display an avatar group in the empty state using the `EmptyMedia` component.
```jsx
import { Empty } from "@/components/ui/empty";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
export default function EmptyAvatarGroup() {
return (
CNCNCN+3No items foundTry creating a new item.
);
}
```
--------------------------------
### Select Component Example
Source: https://context7.com/akash3444/basecn/llms.txt
Shows how to implement a dropdown select component using Base UI's Select and SelectPositioner for placement control. Includes grouping and labels for options.
```tsx
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectPositioner,
SelectSeparator,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
export function SelectDemo() {
return (
);
}
```
--------------------------------
### Empty Component Background Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/empty.mdx
Shows how to add a background, including gradients, to the empty state using `bg-*` and `bg-gradient-*` utilities.
```jsx
import { Empty } from "@/components/ui/empty";
export default function EmptyBackground() {
return (
No items foundTry creating a new item.
);
}
```
--------------------------------
### Resizable Demo
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/resizable.mdx
A basic demonstration of the Resizable component.
```tsx
import {
ResizablePanelGroup,
ResizablePanel,
ResizableHandle,
} from "@/components/ui/resizable";
export function ResizableDemo() {
return (
Panel 1
Panel 2
);
}
```
--------------------------------
### Drawer Snap Points Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/drawer-base.mdx
Illustrates the use of snap points to control the drawer's position. Snap points allow the drawer to rest at predefined heights.
```jsx
```
--------------------------------
### Aspect Ratio - Video Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/aspect-ratio.mdx
Shows how to use the Aspect Ratio component to display video content with a standard 16:9 ratio. This ensures that videos maintain their intended cinematic or widescreen appearance.
```jsx
```
--------------------------------
### TanStack Form Example Usage
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/form-with-tanstack-form.mdx
A practical example of a TanStack Form field for username input, demonstrating how to integrate `field.Label`, `field.Control`, `field.Description`, and `field.Message` within a form item.
```tsx
const form = useAppForm({...})
{(field) => (
Username
field.handleChange(e.target.value)}
/>
This is your public display name.
)}
```
--------------------------------
### Combobox Demo
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/combobox.mdx
A basic demonstration of the Combobox component.
```jsx
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxPopover,
ComboboxOption,
} from "@reach/combobox";
function Example() {
const [value, setValue] = React.useState("");
const [pets, setPets] = React.useState([
"Dog",
"Cat",
"Hamster",
"Goldfish",
"Rabbit",
"Parrot",
]);
const handleSelect = (pet) => {
setValue(pet);
};
return (
setValue(e.target.value)}
/>
item.toLowerCase().startsWith(value.toLowerCase())
}
>
{pets.map((pet, index) => (
))}
);
}
```
--------------------------------
### Field Switch Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Shows a switch control within the Field component.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
} from "@/registry/new-york/ui/field";
export default function FieldSwitch() {
return (
Enable notificationsTurn on to receive updates.
);
}
```
--------------------------------
### Alert Dialog Demo
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/alert-dialog.mdx
A basic demonstration of the Alert Dialog component.
```jsx
import { AlertDialog } from "@base-ui/alert-dialog";
function AlertDialogDemo() {
return (
OpenAre you sure absolutely sure?
This action cannot be undone. This will permanently delete your account and remove your data from our servers.
CancelContinue
);
}
```
--------------------------------
### Field Checkbox Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Illustrates a checkbox input within the Field component.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
} from "@/registry/new-york/ui/field";
export default function FieldCheckbox() {
return (
Agree to terms and conditionsYou must agree to proceed.
);
}
```
--------------------------------
### Field Slider Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Demonstrates a slider input integrated with the Field component.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
} from "@/registry/new-york/ui/field";
export default function FieldSlider() {
return (
VolumeAdjust the volume level.
);
}
```
--------------------------------
### Aspect Ratio - Square Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/aspect-ratio.mdx
Demonstrates how to use the Aspect Ratio component to display content with a 1:1 (square) ratio. This is useful for profile pictures or UI elements that require a square shape.
```jsx
```
--------------------------------
### Field Select Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Illustrates a select dropdown within the Field component.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
} from "@/registry/new-york/ui/field";
export default function FieldSelect() {
return (
CountrySelect your country of residence.
);
}
```
--------------------------------
### Badge Status Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/badge.mdx
Shows how to use the Badge component to indicate status. Useful for highlighting states like 'new' or 'pending'.
```jsx
import { Badge } from "@/components/ui/badge";
function BadgeStatus() {
return (
NewPendingCompleted
);
}
export default BadgeStatus;
```
--------------------------------
### Migrate Popup Positioning with `Positioner`
Source: https://github.com/akash3444/basecn/blob/main/content/docs/get-started/migrating-from-radix-ui.mdx
Demonstrates how to position popups in Base UI using `DropdownMenuPositioner` instead of passing `side` and `align` directly to `DropdownMenuContent` as in Radix UI.
```tsx
import { DropdownMenu } from 'radix-ui';
// [!code highlight]
ProfileBilling
```
```tsx
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuPositioner, DropdownMenuContent, DropdownMenuItem } from '@base-ui/react';
}>
Open
// [!code highlight]
ProfileBilling
// [!code highlight]
```
--------------------------------
### Button Variants Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/button.mdx
Demonstrates different visual variants of the Button component.
```tsx
import {
Button,
buttonVariants,
} from "@/components/ui/button";
import {
IconArrowRight,
IconPlus,
} from "@radix-ui/react-icons";
export function ButtonVariants() {
return (
);
}
```
--------------------------------
### Field Radio Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Demonstrates a radio button input integrated with the Field component.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
} from "@/registry/new-york/ui/field";
export default function FieldRadio() {
return (
Option 1Option 2Choose one option.
);
}
```
--------------------------------
### Fieldset Example
Source: https://github.com/akash3444/basecn/blob/main/content/docs/components/field.mdx
Shows how to group related form fields using the Fieldset component.
```typescript
import {
Field, FieldControl,
FieldLabel, FieldMessage,
Fieldset,
} from "@/registry/new-york/ui/field";
export default function FieldsetExample() {
return (
);
}
```