Cluster

Flex layout primitive that wraps children in a row with vertical centering and a numeric gap on the 4px scale. Great for tags, buttons and meta rows.

src/registry/ui/cluster.tsx/r/cluster.json

Installation#

bash
npx shadcn@latest add @minidev/cluster

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/cluster.json

Usage#

tsx
import { Cluster } from "@/components/ui/cluster"

export function Example() {
  return (
    <Cluster gap={2}>
      <span className="rounded-md border border-border px-2 py-1 text-xs">One</span>
      <span className="rounded-md border border-border px-2 py-1 text-xs">Two</span>
      <span className="rounded-md border border-border px-2 py-1 text-xs">Three</span>
    </Cluster>
  )
}

API reference#

Cluster props
PropTypeDefault
gapnumber2

Also accepts every prop of <div>, passed through to the root element.

Examples#

All layout components

Learn more