View as Markdown

API reference: @salmonui/data-grid

DataGridAdaptiveinterface

import type { DataGridAdaptive } from '@salmonui/data-grid';
interface DataGridAdaptive {
    readonly target?: DataGridAdaptiveTarget;
    readonly rowLayout?: DataGridAdaptiveRowLayout;
    readonly breakpoint?: number;
    readonly defaultActive?: boolean;
}

adaptive prop object form.

DataGridAdaptive members (4)
NameSignatureDescription
targetoptionalreadonly target?: DataGridAdaptiveTarget;

both (default): adaptive at every width. mobile: only while the grid is narrower than breakpoint. desktop: only while it is at least breakpoint wide. Width is the grid's own container width (a container query), not the device or the window.

rowLayoutoptionalreadonly rowLayout?: DataGridAdaptiveRowLayout;

vertical renders each record as a stacked card of label/value fields. Default horizontal.

breakpointoptionalreadonly breakpoint?: number;

Container width in CSS px that separates mobile from desktop. Default 640. Salmon

defaultActiveoptionalreadonly defaultActive?: boolean;

Mode used for server rendering and hydration, before the container is measured (mobile / desktop targets). Default: false. Set it from a user-agent hint to avoid a desktop-to-adaptive switch after mount. Salmon