grid/01-responsive-feature
A minimal feature section that uses auto-fit tracks to adapt cards to the available page width.
Loading interactive preview
"use client";
import type { CSSProperties } from 'react';
import { Grid } from 'ui-lab-components/grid';
import { Frame } from 'ui-lab-components/frame';
const BASE_CELL_STYLE = {
'--fill': 'var(--background-900)',
'--stroke-color': 'var(--background-600)',
} as CSSProperties;
function FrameCell({ label, style }: { label: number; style?: CSSProperties }) {
return (
<Frame className="p-2" pathStroke="dashed" style={{ ...BASE_CELL_STYLE, ...style }}>
<span className="w-6 h-6 font-medium underline text-foreground-400 flex rounded-sm items-center justify-center text-xs">
{label}
</span>
</Frame>
);
}
export default function Example() {
return (
<Grid columns="auto-fit" gap="md" className="w-full max-w-3xl">
{Array.from({ length: 3 }, (_, index) => (
<FrameCell key={index} label={index + 1} style={{ width: '100%', height: 180 }} />
))}
</Grid>
);
}