flex/02-page-header
A compact page header with a brand mark, contextual status, and primary actions.
Loading interactive preview
"use client";
import type { CSSProperties } from 'react';
import { Flex } from 'ui-lab-components/flex';
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, className }: { label: number; style?: CSSProperties; className?: string }) {
return (
<Frame className={`p-2 ${className ?? ''}`} 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 (
<div className="flex w-full max-w-3xl flex-col gap-2">
<Flex align-center justify-between gap="md" className="h-8">
<FrameCell label={1} className="shrink-0 rounded" style={{ width: 32, height: 32 }} />
<FrameCell label={2} className="min-w-0 flex-1" style={{ height: 32 }} />
<div className="flex shrink-0 gap-1">
<FrameCell label={3} className="rounded-sm" style={{ width: 56, height: 32 }} />
<FrameCell label={4} className="rounded-sm" style={{ width: 56, height: 32 }} />
</div>
</Flex>
<div className="flex w-full gap-2">
<FrameCell label={5} className="flex-1" style={{ height: 128 }} />
<FrameCell label={6} className="flex-1" style={{ height: 128 }} />
</div>
</div>
);
}