-
Notifications
You must be signed in to change notification settings - Fork 751
Expand file tree
/
Copy pathslider.api.json
More file actions
246 lines (246 loc) · 8.14 KB
/
slider.api.json
File metadata and controls
246 lines (246 loc) · 8.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
{
"name": "Slider",
"category": "controls",
"description": "A Slider component",
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/SliderScreen.tsx",
"images": [
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Slider/Slider.gif?raw=true"
],
"props": [
{
"name": "value",
"type": "number",
"description": "Initial value"
},
{
"name": "minimumValue",
"type": "number",
"description": "Track minimum value"
},
{
"name": "maximumValue",
"type": "number",
"description": "Track maximum value"
},
{
"name": "initialMinimumValue",
"type": "number",
"description": "Initial minimum value",
"note": "Only when `useRange` is true"
},
{
"name": "initialMaximumValue",
"type": "number",
"description": "Initial maximum value",
"note": "Only when `useRange` is true"
},
{
"name": "step",
"type": "number",
"description": "Step value of the slider. The value should be between 0 and (maximumValue - minimumValue)"
},
{
"name": "useRange",
"type": "boolean",
"description": "If true the Slider will display a second thumb for the min value"
},
{
"name": "useGap",
"type": "boolean",
"description": "If true the min and max thumbs will not overlap",
"default": "true"
},
{
"name": "minimumTrackTintColor",
"type": "string",
"description": "The color used for the track from minimum value to current value"
},
{
"name": "maximumTrackTintColor",
"type": "string",
"description": "The track color"
},
{
"name": "renderTrack",
"type": "() => ReactElement | ReactElement[]",
"description": "Custom render instead of rendering the track"
},
{
"name": "thumbTintColor",
"type": "string",
"description": "Thumb color"
},
{
"name": "onValueChange",
"type": "SliderOnValueChange",
"description": "Callback for onValueChange"
},
{
"name": "onRangeChange",
"type": "SliderOnRangeChange",
"description": "Callback for onRangeChange. Returns values object with the min and max values"
},
{
"name": "onSeekStart",
"type": "() => void",
"description": "Callback that notifies about slider seeking is started"
},
{
"name": "onSeekEnd",
"type": "() => void",
"description": "Callback that notifies about slider seeking is finished"
},
{
"name": "onReset",
"type": "() => void",
"description": "Callback that notifies when the reset function was invoked"
},
{
"name": "containerStyle",
"type": "ViewStyle",
"description": "The container style"
},
{
"name": "trackStyle",
"type": "ViewStyle",
"description": "The track style"
},
{
"name": "thumbStyle",
"type": "ViewStyle",
"description": "The thumb style"
},
{
"name": "activeThumbStyle",
"type": "ViewStyle",
"description": "The active (during press) thumb style"
},
{
"name": "disableActiveStyling",
"type": "boolean",
"description": "If true the Slider will not change it's style on press"
},
{
"name": "disabled",
"type": "boolean",
"description": "If true the Slider will be disabled and will appear in disabled color"
},
{
"name": "disableRTL",
"type": "boolean",
"description": "If true the Slider will stay in LTR mode even if the app is on RTL mode"
},
{
"name": "accessible",
"type": "boolean",
"description": "If true the component will have accessibility features enabled"
},
{
"name": "testID",
"type": "string",
"description": "The component test id"
},
{
"name": "migrate",
"type": "boolean",
"description": "Temporary prop required for migration to the Slider's new implementation"
}
],
"docs": {
"hero": {
"title": "Slider",
"description": "Sliders allow users to make selections from a range of values in a quick and interactive way.\nSliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness, or applying image filters.",
"type": "hero",
"layout": "horizontal",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_hero.png"
}
]
},
"tabs": [
{
"title": "Overview",
"sections": [
{
"type": "section",
"title": "Usage examples",
"description": "Sliders can be used for various types of user input and controls, for example an amount, or a specific setting.",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_section_examples.png"
}
]
},
{
"type": "table",
"columns": [
"Slider type",
"Preview"
],
"items": [
{
"title": "Linear slider",
"description": "Use this slider to allow the user to select a numeric value from a range of numbers.",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_table_linear.png"
}
]
},
{
"title": "Centered slider",
"description": "This type allows the user to select negative values.",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_table_centered.png"
}
]
},
{
"title": "Range slider",
"description": "Use this slider to allow the user to select a range of values.",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_table_range.png"
}
]
},
{
"title": "Color slider",
"description": "Use this slider to allow the user to select a color from a gradient range of colors.",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_table_color.png"
}
]
}
],
"title": "Slider types"
},
{
"type": "section",
"layout": "horizontal",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_spec_linear.png"
}
],
"title": "Spec",
"description": "markdown:\n\n**Linear slider**\n\n**Default**\nThumb: 24px \nOutline: 1.5px\n\n**On tap**\nThumb: 40px\nOutline: 1.5px\n\n**Disabled**"
},
{
"type": "section",
"layout": "horizontal",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Slider/slider_spec_range.png"
}
],
"description": "markdown:\n\n**Range slider**\n\n**Initial state**\nWidest range is displayed by default.\n\n**Thumbs**\nThumbs should not cross each other and keep minimum distance between them of S2 (8px). Thumbs shouldn’t overlap each other when idle.\n\n**Spacing**\nMinimum spacing between idle Thumbs - S2"
}
]
}
]
}
}