Media Grid
DisplayMITImage / media tile grid with hover details and aspect-ratio preserved.
bun add @otfdashkit/ui
Preview
Media GridDisplay
Loading Storybook preview…
Code
@otfdashkit/uiimport { Image, Folder } from 'lucide-react'
import { GridList, GridListItem } from '@otfdashkit/ui'
export function Example() {
return (
<div className="w-full max-w-2xl">
<GridList minItemWidth={120} gap={0.75}>
{Array.from({ length: 12 }).map((_, i) => (
<GridListItem key={i} interactive className="aspect-square flex items-center justify-center">
{i % 3 === 0 ? <Image className="h-6 w-6 text-muted-foreground" /> : <Folder className="h-6 w-6 text-muted-foreground" />}
</GridListItem>
))}
</GridList>
</div>
)
}
Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.
Props
Props declared in the GridList source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| gap | number | 1 | Gap between items in rem (default 1 = 16px) |
| minItemWidth | number | 240 | Minimum width per item (px). Columns fill to that, then reflow. |