Componentdata0.23 KB gzipZero dependencies
Feed Masonry
Masonry feed of mixed-height content cards.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add feed-masonryOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { FeedMasonry } from "@/components/ui/feed-masonry"; <FeedMasonry />Source code
feed-masonry.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxfeed-masonry.tsx20 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils";import { MasonryColumns } from "./masonry-columns"; export interface FeedMasonryProps extends React.HTMLAttributes<HTMLDivElement> { items: { id: string; content: React.ReactNode }[]; columns?: 2 | 3;} /** Masonry feed layout for dynamic height cards. */export function FeedMasonry({ items = [], columns = 2, className, ...props }: FeedMasonryProps) { return ( <div className={cn("w-full", className)} {...props}> <MasonryColumns items={items.map((i) => ({ id: i.id, content: i.content }))} columns={columns} /> </div> );} Props
| Prop | Type | Description |
|---|---|---|
| items | { id: string; content: React.ReactNode }[] | Structured list of items rendered by the component. (Default: []) |
| columns | 2 | 3 | Column definitions describing headers, cell keys, and sorting. (Default: 2) |