ui/Placeholder

import Placeholder from '@enact/ui/Placeholder';

Members

PlaceholderControllerDecoratorHigher-Order Component

A higher-order component (HOC) that render placeholder components.

Components are rendered based on their position relative to the 'scrollTop' from the 'onScroll''s parameter. They are not unmounted once rendered.

import {PlaceholderControllerDecorator} from '@enact/ui/Placeholder';
Configuration
bounds
Object

The bounds of the container represented by an object with height and width members.

If the container is a static size, this can be specified at design-time to avoid calculating the bounds at run-time (the default behavior).

Default: null
notify
String

Event callback which indicates that the viewport has scrolled and placeholders should be notified.

Default: onScroll
thresholdFactor
Number

Multiplier used with the wrapped component's height and width to determine the threshold for replacing the placeholder component with the true component.

Default: 1.5

PlaceholderDecoratorHigher-Order Component

A higher-order component that enables a container to notify the wrapped component when scrolling.

Containers must provide registerPlaceholder, unregisterPlaceholder, and invalidateBounds methods via React's context for PlaceholderDecorator instances.

No additional properties are passed to the wrapped component.

import {PlaceholderDecorator} from '@enact/ui/Placeholder';
Configuration
style
Object

Configures the style of the placeholder element

Default: {height: 0, width: 'auto'}
placeholderComponent
String

The component to use as a placeholder.

Default: 'div'
ArrayBooleanFunctionModuleNumberObjectString