createPinnedFocusXExtension

Pin the focused item's left edge to a fixed screen X (hero banner carousel)

import {
    createPinnedFocusXExtension,
} from "@roku-sdk/flex-grid/compose-h-strategy";
createPinnedFocusXExtension<TConfig extends FocusStrategyBase>(matches: HStrategyMatcher, focusX: number): HStrategyExtension<TConfig>

Description

Pin the focused item's left edge to a fixed screen X (hero banner carousel). Ignores base scroll/focus values when matched.

Parameters

NameTypeDescription
matchesHStrategyMatcherSelects focus states where this extension applies.
focusXnumberFixed focus position in pixels.

Return values

An extension replacing the horizontal focus and scroll positions.

Example

import { createPinnedFocusXExtension, matchRow } from "@roku-sdk/flex-grid/compose-h-strategy";
createPinnedFocusXExtension(matchRow(0), 100);

What’s Next

Did this page help you?