You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/blocks/SliderNew/__stories__/Slider.mdx
+18-5Lines changed: 18 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,29 @@ import * as SliderStories from './Slider.stories.tsx';
5
5
6
6
<Metaof={SliderStories} />
7
7
<StoryTemplate>
8
+
9
+
##### Slider new block. based on [swiper](https://v6.swiperjs.com/react) library.
10
+
<br/><br/>
11
+
8
12
## Parameters
9
13
10
14
The slider supports two types of content: loadable and from a config. Loadable content is loaded via the `loadable` property and content from a config via the `children` property.
11
15
12
-
`type: "slider-block"`
16
+
`type: "slider-new-block"`
13
17
14
18
`animated?: bool` — Enables/disables animation for the block (enabled by default).
15
19
16
20
`dots?: bool` — A flag that indicates whether to show navigation dots.
17
21
18
22
`arrows? bool` — A flag that indicates whether to show navigation arrows.
19
23
20
-
`title: Title`: Title.
24
+
`title: Title` — Title.
21
25
22
-
`description?: string`: Description.
26
+
`description?: string` — Description.
23
27
24
-
`randomOrder?: bool`: Enables a random slide order.
28
+
`randomOrder?: bool` — Enables a random slide order.
25
29
26
-
`slidesToShow?: Record<'all' | 'sm' | 'md' | 'lg' | 'xl', number> | number`: How many slides to show on screens of different width. Overrides the default values. They can be overridden for each screen width. You can also set a single numeric value so that the number of slides is always the same (except for mobiles, where the value is always 1).
30
+
`slidesToShow?: Record<'all' | 'sm' | 'md' | 'lg' | 'xl', number> | number` — How many slides to show on screens of different width. Overrides the default values. They can be overridden for each screen width. You can also set a single numeric value so that the number of slides is always the same (except for mobiles, where the value is always 1).
27
31
28
32
Default values:
29
33
@@ -32,6 +36,14 @@ Default values:
32
36
-`md`: 2
33
37
-`sm`: 1
34
38
39
+
`type?: string` — Currently supported: `"media-card" | "header-card"`.
40
+
41
+
`autoplay?: number` — Autoplay delay between transitions in ms.
42
+
43
+
`arrowSize?: number` - Size of arrow icons. Default: `16`.
44
+
45
+
`adaptive?: boolean` - Adapt slider height to the height of the active slide. Default: `false`.
46
+
35
47
`loadable: Loadable` — Loadable content, the following data sources are currently supported:
36
48
37
49
-`events` — Events.
@@ -50,4 +62,5 @@ The following blocks are currently supported:
50
62
-[`MediaCard` — Card with an image](?path=/story/блоки-media--default&viewMode=docs)
`onSlideChange | onSlideChangeTransitionStart | onSlideChangeTransitionEnd | onActiveIndexChange | onBreakpoint`[events](https://v6.swiperjs.com/swiper-api#events) supported. If you need more please open an [issue](https://github.com/gravity-ui/page-constructor/issues) or make PR.
0 commit comments