logic2b ui
Copy-paste components, AI-assisted.
Docs
Components
Registry
import { Separator } from "@/components/ui/separator"
export default function SeparatorDemo() {
return (
<div>
<div className="space-y-1">
<h4 className="text-sm font-medium leading-none">logic2b ui</h4>
<p className="text-sm text-muted-foreground">
Copy-paste components, AI-assisted.
</p>
</div>
<Separator className="my-4" />
<div className="flex h-5 items-center space-x-4 text-sm">
<div>Docs</div>
<Separator orientation="vertical" />
<div>Components</div>
<Separator orientation="vertical" />
<div>Registry</div>
</div>
</div>
)
}Installation
npx logic2b@latest add separatorWorking with an AI assistant? Copy this prompt into Claude Code, Cursor or Copilot — it carries the install steps, a no-CLI fallback and a verification checklist.
Add the "separator" item from the logic2b ui registry (https://ui.logic2b.com) to this project. Follow every step and verify at the end. ## Steps 1. If the project has no `components.json` yet, set up logic2b ui first: ```bash npx logic2b@latest init ``` 2. Install the item (the CLI resolves registry dependencies automatically): ```bash npx logic2b@latest add separator ``` 3. Install any npm dependencies the command prints. ## If the CLI is not available Do it manually from the registry payload: 1. Fetch https://ui.logic2b.com/r/separator.json. 2. Write every entry in `files[]` to its mapped project path (see below). 3. Repeat (recursively) for each name in `registryDependencies`. 4. Install every package listed in `dependencies` across those payloads. ## Registry reference - Index of every item: https://ui.logic2b.com/r/index.json - Item payload (full source): https://ui.logic2b.com/r/<name>.json - Usage examples per item: https://ui.logic2b.com/r/demos/index.json → https://ui.logic2b.com/r/demos/<demo>.json - Docs index for agents: https://ui.logic2b.com/llms.txt (full docs: https://ui.logic2b.com/llms-full.txt) - Every docs page is Markdown when you append `.md` to its URL. Registry file paths map to project paths like this: - `ui/*` → `@/components/ui/*` - `blocks/<name>/*` → `@/components/*` - `charts/*` → `@/components/charts/*` - `hooks/*` → `@/hooks/*` - `lib/utils.ts` → `@/lib/utils.ts` - `theme.css` → next to the project's Tailwind entry stylesheet ## Conventions (do not break these) - Tailwind CSS v4 (CSS-first config; no tailwind.config.js needed) and React 19. - All colors go through semantic tokens (`bg-primary`, `text-muted-foreground`, `border-border`, …). Never hardcode hex/oklch values in components. - Dark mode is class-based: toggle `.dark` on `<html>`. - Icons come from lucide-react. ## Verify before finishing 1. The dev server starts and the app renders without console errors. 2. TypeScript compiles (`tsc --noEmit` or the framework's check). 3. Components use the theme: a `<Button>` shows the primary token color, and toggling `.dark` on `<html>` switches the palette.
Install the dependencies:
npm install radix-uiCopy into ui/separator.tsx:
import * as React from "react"
import { Separator as SeparatorPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
function Separator({
className,
orientation = "horizontal",
decorative = true,
...props
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
return (
<SeparatorPrimitive.Root
data-slot="separator"
decorative={decorative}
orientation={orientation}
className={cn(
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
className
)}
{...props}
/>
)
}
export { Separator }Usage
import { Separator } from "@/components/ui/separator"
<Separator />
<Separator orientation="vertical" />
API
| Prop | Type | Default |
|---|---|---|
orientation |
horizontal | vertical |
horizontal |
decorative |
boolean — when true, hidden from the accessibility tree |
true |
Vertical separators need a parent with a defined height (e.g. a flex row with
h-5) to be visible.
Examples
Vertical
ProfileBillingSettings
import { Separator } from "@/components/ui/separator"
export default function SeparatorVerticalDemo() {
return (
<div className="flex h-5 items-center gap-4 text-sm">
<span>Profile</span>
<Separator orientation="vertical" />
<span>Billing</span>
<Separator orientation="vertical" />
<span>Settings</span>
</div>
)
}As a labeled divider
or continue with
import { Separator } from "@/components/ui/separator"
export default function SeparatorLabeledDemo() {
return (
<div className="flex w-72 items-center gap-3 text-sm">
<Separator className="flex-1" />
<span className="text-muted-foreground">or continue with</span>
<Separator className="flex-1" />
</div>
)
}