Skip to main content

Render controls

The controls are used to slide the slider left or right. In most cases, these controls are rendered left and right of the slider.

The renderLeftControl and renderRightControl methods are optional.

Example

renderLeftControl

import type { RenderControl } from '@videodock/tile-slider';

const renderLeftControl: RenderControl = ({ onClick, disabled }) => (
<button className="control" onClick={onClick} aria-label="Previous page" disabled={disabled}>{'<'}</button>
);

renderRightControl

import type { RenderControl } from '@videodock/tile-slider';

const renderRightControl: RenderControl = ({ onClick, disabled }) => (
<button className="control" onClick={onClick} aria-label="Next page" disabled={disabled}>{'>'}</button>
);

Props

The renderLeftControl and renderRightControl functions receives the following props:

NameTypeDescription
onClick() => voidCall this function to slide left or right
disabledbooleantrue when the control should be disabled