Componentdata0.52 KB gzipZero dependencies
Two Column List
Two-column notebook-style list with dashed separators.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add two-column-listOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { TwoColumnList } from "@/components/ui/two-column-list"; <TwoColumnList />Source code
two-column-list.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxtwo-column-list.tsx33 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface TwoColumnListProps extends React.HTMLAttributes<HTMLDivElement> { items: { id: string; label: string; value?: string }[];} /** Two-column ledger list view with center divider rule. */export function TwoColumnList({ items = [], className, ...props }: TwoColumnListProps) { const half = Math.ceil(items.length / 2); const left = items.slice(0, half); const right = items.slice(half); const Row = ({ item, idx = 0 }: { item: (typeof items)[number]; idx: number }) => ( <li className="flex items-center justify-between gap-3 border-b border-dashed border-border/50 py-2 animate-[creditCardIn_0.3s_ease-out_both] motion-reduce:animate-none transition-colors hover:text-accent motion-reduce:transition-none"Props
| Prop | Type | Description |
|---|---|---|
| items | { id: string; label: string; value?: string }[] | Structured list of items rendered by the component. (Default: []) |