defineFlexGrid

Returns a Solid component that renders a grid configured through FlexGridRuntimeProps

import { defineFlexGrid } from "@roku-sdk/flex-grid";
defineFlexGrid<T>(defaults?: Partial<FlexGridConfig<T>>): Component<FlexGridRuntimeProps<T>>

Description

Returns a Solid component that renders a grid configured through FlexGridRuntimeProps.

Pass defaults for props shared by every instance; runtime JSX props override via mergeProps.

Parameters

NameTypeDescription
defaults?Partial<FlexGridConfig<T>>

Return values

Returns Component<FlexGridRuntimeProps<T>>.

Types

FlexGridRuntimeProps

Everything createFlexGrid accepts, plus row data and an optional handle callback.

  • Structural props (layout, strategies, plugins, callbacks, …) are read into a remount
    dependency list; when that list changes, the grid is recreated (same contract as calling
    createFlexGrid again).
  • rows is excluded from remount deps: when only rows changes, the existing handle
    receives FlexGridHandle.updateRows.
  • jumpTo is also excluded from remount deps: when only jumpTo changes (plain tuple
    or Accessor), the existing grid animates/snaps via the internal jump effect.
  • allowJumpOnEmpty is reactive like jumpTo — toggling it does not remount the grid.
type FlexGridRuntimeProps<T> = FlexGridConfig<T> & { gridHandleRef: (handle: FlexGridHandle<T> | null) => void; rows: Accessor<T[] | undefined[]> | T[] | undefined[]; rowsStartIndex: number };

Did this page help you?