Constructor
# new Slides(props) → {React.ReactElement}
Overview
A component that takes an array of containers and enables user to move between them. The component provides a slide animation when a change of view is requested.Usage
A programmer should provide the direction of a slide as well as an orientation. It is possible to have different orientations between two distinct slots.Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
props |
Object | |||
children |
React.ReactNode |
<optional> |
The content of the component. |
|
direction |
"backward" | "forward" | The direction of current slide. |
||
duration |
number |
<optional> |
1000 | The duration of a slide in milliseconds. |
getSlotStyle |
function |
<optional> |
Callback fired when component requests style for current slot. |
|
mountNeighboursOnly |
boolean |
<optional> |
true | If |
orientation |
"horizontal" | "vertical" |
<optional> |
'horizontal' | The orientation of current slide. |
sliding |
boolean | If |
||
value |
number |
<optional> |
The id of current slot. |
React.ReactElement
Methods
# static getHorizontalTransition(sliding, direction, duration) → {Object}
Overview
Creates a horizontal sliding animation.Parameters:
Name | Type | Description |
---|---|---|
sliding |
boolean | If |
direction |
"backward" | "forward" | The direction of current slide. |
duration |
number | The duration of a slide in milliseconds. |
- The style object with horizontal transformation.
Object
# static getOrder(index, value, count, reverse) → {number}
Overview
Counts the flex order of currently processed slot.Parameters:
Name | Type | Description |
---|---|---|
index |
number | The id of currently processed slot. |
value |
number | The id of currently selected slot. |
count |
number | Number of slots. |
reverse |
boolean | If |
- The flex order of currently processed slot.
number
# static getVerticalTransition(sliding, direction, duration) → {Object}
Overview
Creates a vertical sliding animation.Parameters:
Name | Type | Description |
---|---|---|
sliding |
boolean | If |
direction |
"backward" | "forward" | The direction of current slide. |
duration |
number | The duration of a slide in milliseconds. |
- The style object with vertical transformation.
Object