@abraracs/better-shopify-wc-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +325 -0
- package/docs/avatar.md +481 -0
- package/docs/badge.md +266 -0
- package/docs/banner.md +350 -0
- package/docs/box.md +618 -0
- package/docs/button.md +604 -0
- package/docs/buttongroup.md +251 -0
- package/docs/checkbox.md +346 -0
- package/docs/chip.md +261 -0
- package/docs/choicelist.md +416 -0
- package/docs/clickable.md +703 -0
- package/docs/clickablechip.md +377 -0
- package/docs/colorfield.md +416 -0
- package/docs/colorpicker.md +152 -0
- package/docs/datefield.md +706 -0
- package/docs/datepicker.md +443 -0
- package/docs/divider.md +263 -0
- package/docs/dropzone.md +331 -0
- package/docs/emailfield.md +377 -0
- package/docs/grid.md +1246 -0
- package/docs/heading.md +201 -0
- package/docs/icon.md +295 -0
- package/docs/image.md +517 -0
- package/docs/link.md +456 -0
- package/docs/menu.md +331 -0
- package/docs/modal.md +640 -0
- package/docs/moneyfield.md +385 -0
- package/docs/numberfield.md +393 -0
- package/docs/orderedlist.md +224 -0
- package/docs/page.md +319 -0
- package/docs/paragraph.md +333 -0
- package/docs/passwordfield.md +381 -0
- package/docs/popover.md +419 -0
- package/docs/querycontainer.md +121 -0
- package/docs/searchfield.md +319 -0
- package/docs/section.md +267 -0
- package/docs/select.md +449 -0
- package/docs/spinner.md +121 -0
- package/docs/stack.md +748 -0
- package/docs/switch.md +365 -0
- package/docs/table.md +805 -0
- package/docs/text.md +339 -0
- package/docs/textarea.md +328 -0
- package/docs/textfield.md +425 -0
- package/docs/thumbnail.md +245 -0
- package/docs/tooltip.md +130 -0
- package/docs/unorderedlist.md +135 -0
- package/docs/urlfield.md +314 -0
- package/package.json +43 -0
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ChoiceList
|
|
3
|
+
description: >-
|
|
4
|
+
Present multiple options to users, allowing either single selections with
|
|
5
|
+
radio buttons or multiple selections with checkboxes.
|
|
6
|
+
api_name: app-home
|
|
7
|
+
source_url:
|
|
8
|
+
html: >-
|
|
9
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/forms/choicelist
|
|
10
|
+
md: >-
|
|
11
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/forms/choicelist.md
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# ChoiceList
|
|
15
|
+
|
|
16
|
+
Present multiple options to users, allowing either single selections with radio buttons or multiple selections with checkboxes.
|
|
17
|
+
|
|
18
|
+
## Properties
|
|
19
|
+
|
|
20
|
+
* details
|
|
21
|
+
|
|
22
|
+
string
|
|
23
|
+
|
|
24
|
+
Additional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user.
|
|
25
|
+
|
|
26
|
+
This will also be exposed to screen reader users.
|
|
27
|
+
|
|
28
|
+
* disabled
|
|
29
|
+
|
|
30
|
+
boolean
|
|
31
|
+
|
|
32
|
+
Default: false
|
|
33
|
+
|
|
34
|
+
Disables the field, disallowing any interaction.
|
|
35
|
+
|
|
36
|
+
`disabled` on any child choices is ignored when this is true.
|
|
37
|
+
|
|
38
|
+
* error
|
|
39
|
+
|
|
40
|
+
string
|
|
41
|
+
|
|
42
|
+
Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately.
|
|
43
|
+
|
|
44
|
+
* label
|
|
45
|
+
|
|
46
|
+
string
|
|
47
|
+
|
|
48
|
+
Content to use as the field label.
|
|
49
|
+
|
|
50
|
+
* labelAccessibilityVisibility
|
|
51
|
+
|
|
52
|
+
"visible" | "exclusive"
|
|
53
|
+
|
|
54
|
+
Default: 'visible'
|
|
55
|
+
|
|
56
|
+
Changes the visibility of the component's label.
|
|
57
|
+
|
|
58
|
+
* `visible`: the label is visible to all users.
|
|
59
|
+
* `exclusive`: the label is visually hidden but remains in the accessibility tree.
|
|
60
|
+
|
|
61
|
+
* multiple
|
|
62
|
+
|
|
63
|
+
boolean
|
|
64
|
+
|
|
65
|
+
Default: false
|
|
66
|
+
|
|
67
|
+
Whether multiple choices can be selected.
|
|
68
|
+
|
|
69
|
+
* name
|
|
70
|
+
|
|
71
|
+
string
|
|
72
|
+
|
|
73
|
+
An identifier for the field that is unique within the nearest containing form.
|
|
74
|
+
|
|
75
|
+
* values
|
|
76
|
+
|
|
77
|
+
string\[]
|
|
78
|
+
|
|
79
|
+
An array of the `value`s of the selected options.
|
|
80
|
+
|
|
81
|
+
This is a convenience prop for setting the `selected` prop on child options.
|
|
82
|
+
|
|
83
|
+
## Events
|
|
84
|
+
|
|
85
|
+
Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
|
|
86
|
+
|
|
87
|
+
* change
|
|
88
|
+
|
|
89
|
+
CallbackEventListener\<typeof tagName> | null
|
|
90
|
+
|
|
91
|
+
* input
|
|
92
|
+
|
|
93
|
+
CallbackEventListener\<typeof tagName> | null
|
|
94
|
+
|
|
95
|
+
### CallbackEventListener
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
(EventListener & {
|
|
99
|
+
(event: CallbackEvent<T>): void;
|
|
100
|
+
}) | null
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### CallbackEvent
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
Event & {
|
|
107
|
+
currentTarget: HTMLElementTagNameMap[T];
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Choice
|
|
112
|
+
|
|
113
|
+
Create options that let users select one or multiple items from a list of choices.
|
|
114
|
+
|
|
115
|
+
* accessibilityLabel
|
|
116
|
+
|
|
117
|
+
string
|
|
118
|
+
|
|
119
|
+
A label used for users using assistive technologies like screen readers. When set, any children or `label` supplied will not be announced. This can also be used to display a control without a visual label, while still providing context to users using screen readers.
|
|
120
|
+
|
|
121
|
+
* defaultSelected
|
|
122
|
+
|
|
123
|
+
boolean
|
|
124
|
+
|
|
125
|
+
Default: false
|
|
126
|
+
|
|
127
|
+
Whether the control is active by default.
|
|
128
|
+
|
|
129
|
+
* disabled
|
|
130
|
+
|
|
131
|
+
boolean
|
|
132
|
+
|
|
133
|
+
Default: false
|
|
134
|
+
|
|
135
|
+
Disables the control, disallowing any interaction.
|
|
136
|
+
|
|
137
|
+
* selected
|
|
138
|
+
|
|
139
|
+
boolean
|
|
140
|
+
|
|
141
|
+
Default: false
|
|
142
|
+
|
|
143
|
+
Whether the control is active.
|
|
144
|
+
|
|
145
|
+
* value
|
|
146
|
+
|
|
147
|
+
string
|
|
148
|
+
|
|
149
|
+
The value used in form data when the control is checked.
|
|
150
|
+
|
|
151
|
+
## Slots
|
|
152
|
+
|
|
153
|
+
* children
|
|
154
|
+
|
|
155
|
+
HTMLElement
|
|
156
|
+
|
|
157
|
+
Content to use as the choice label.
|
|
158
|
+
|
|
159
|
+
The label is produced by extracting and concatenating the text nodes from the provided content; any markup or element structure is ignored.
|
|
160
|
+
|
|
161
|
+
* details
|
|
162
|
+
|
|
163
|
+
HTMLElement
|
|
164
|
+
|
|
165
|
+
Additional text to provide context or guidance for the input.
|
|
166
|
+
|
|
167
|
+
This text is displayed along with the input and its label to offer more information or instructions to the user.
|
|
168
|
+
|
|
169
|
+
Examples
|
|
170
|
+
|
|
171
|
+
### Examples
|
|
172
|
+
|
|
173
|
+
* #### Code
|
|
174
|
+
|
|
175
|
+
##### jsx
|
|
176
|
+
|
|
177
|
+
```jsx
|
|
178
|
+
const handleChange = (event) => {
|
|
179
|
+
console.log('Values: ', event.currentTarget.values)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<s-choice-list
|
|
184
|
+
label="Company name"
|
|
185
|
+
name="Company name"
|
|
186
|
+
details="The company name will be displayed on the checkout page."
|
|
187
|
+
onChange={handleChange}
|
|
188
|
+
>
|
|
189
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
190
|
+
<s-choice value="optional">Optional</s-choice>
|
|
191
|
+
<s-choice value="required">Required</s-choice>
|
|
192
|
+
</s-choice-list>
|
|
193
|
+
)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
##### html
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<script>
|
|
200
|
+
const handleChange = (event) =>
|
|
201
|
+
console.log('Values: ', event.currentTarget.values);
|
|
202
|
+
</script>
|
|
203
|
+
<s-choice-list
|
|
204
|
+
label="Company name"
|
|
205
|
+
name="Company name"
|
|
206
|
+
details="The company name will be displayed on the checkout page."
|
|
207
|
+
onChange="handleChange(event)"
|
|
208
|
+
>
|
|
209
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
210
|
+
<s-choice value="optional">Optional</s-choice>
|
|
211
|
+
<s-choice value="required">Required</s-choice>
|
|
212
|
+
</s-choice-list>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
* #### Basic usage
|
|
216
|
+
|
|
217
|
+
##### Description
|
|
218
|
+
|
|
219
|
+
Demonstrates a basic ChoiceList with single selection, showing how to create a group of radio button choices.
|
|
220
|
+
|
|
221
|
+
##### jsx
|
|
222
|
+
|
|
223
|
+
```jsx
|
|
224
|
+
<s-choice-list label="Product visibility" name="visibility">
|
|
225
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
226
|
+
<s-choice value="optional">Optional</s-choice>
|
|
227
|
+
<s-choice value="required" selected>
|
|
228
|
+
Required
|
|
229
|
+
</s-choice>
|
|
230
|
+
</s-choice-list>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
##### html
|
|
234
|
+
|
|
235
|
+
```html
|
|
236
|
+
<s-choice-list label="Product visibility" name="visibility">
|
|
237
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
238
|
+
<s-choice value="optional">Optional</s-choice>
|
|
239
|
+
<s-choice value="required" selected>Required</s-choice>
|
|
240
|
+
</s-choice-list>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
* #### Multiple selections
|
|
244
|
+
|
|
245
|
+
##### Description
|
|
246
|
+
|
|
247
|
+
Illustrates a ChoiceList with multiple selection enabled, allowing users to choose multiple options with additional descriptive details for each choice.
|
|
248
|
+
|
|
249
|
+
##### jsx
|
|
250
|
+
|
|
251
|
+
```jsx
|
|
252
|
+
<s-choice-list label="Checkout options" name="checkout" multiple>
|
|
253
|
+
<s-choice value="shipping" selected>
|
|
254
|
+
Use the shipping address as the billing address by default
|
|
255
|
+
<s-text slot="details">
|
|
256
|
+
Reduces the number of fields required to check out. The billing address
|
|
257
|
+
can still be edited.
|
|
258
|
+
</s-text>
|
|
259
|
+
</s-choice>
|
|
260
|
+
<s-choice value="confirmation">
|
|
261
|
+
Require a confirmation step
|
|
262
|
+
<s-text slot="details">
|
|
263
|
+
Customers must review their order details before purchasing.
|
|
264
|
+
</s-text>
|
|
265
|
+
</s-choice>
|
|
266
|
+
</s-choice-list>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
##### html
|
|
270
|
+
|
|
271
|
+
```html
|
|
272
|
+
<s-choice-list label="Checkout options" name="checkout" multiple>
|
|
273
|
+
<s-choice value="shipping" selected>
|
|
274
|
+
Use the shipping address as the billing address by default
|
|
275
|
+
<s-text slot="details">
|
|
276
|
+
Reduces the number of fields required to check out. The billing address
|
|
277
|
+
can still be edited.
|
|
278
|
+
</s-text>
|
|
279
|
+
</s-choice>
|
|
280
|
+
<s-choice value="confirmation">
|
|
281
|
+
Require a confirmation step
|
|
282
|
+
<s-text slot="details">
|
|
283
|
+
Customers must review their order details before purchasing.
|
|
284
|
+
</s-text>
|
|
285
|
+
</s-choice>
|
|
286
|
+
</s-choice-list>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
* #### With error state
|
|
290
|
+
|
|
291
|
+
##### Description
|
|
292
|
+
|
|
293
|
+
Shows how to display an error message in a ChoiceList when an invalid selection is made or a validation constraint is not met.
|
|
294
|
+
|
|
295
|
+
##### jsx
|
|
296
|
+
|
|
297
|
+
```jsx
|
|
298
|
+
<s-choice-list
|
|
299
|
+
label="Product visibility"
|
|
300
|
+
error="Please select an option"
|
|
301
|
+
>
|
|
302
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
303
|
+
<s-choice value="optional">Optional</s-choice>
|
|
304
|
+
<s-choice value="required">Required</s-choice>
|
|
305
|
+
</s-choice-list>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
##### html
|
|
309
|
+
|
|
310
|
+
```html
|
|
311
|
+
<s-choice-list
|
|
312
|
+
label="Product visibility"
|
|
313
|
+
name="visibility"
|
|
314
|
+
error="Product visibility cannot be hidden at this time"
|
|
315
|
+
>
|
|
316
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
317
|
+
<s-choice value="optional">Optional</s-choice>
|
|
318
|
+
<s-choice value="required" selected>Required</s-choice>
|
|
319
|
+
</s-choice-list>
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
* #### Multiple choices with details
|
|
323
|
+
|
|
324
|
+
##### Description
|
|
325
|
+
|
|
326
|
+
Showcases a multiple-selection ChoiceList with each option including detailed information.
|
|
327
|
+
|
|
328
|
+
##### jsx
|
|
329
|
+
|
|
330
|
+
```jsx
|
|
331
|
+
<s-choice-list
|
|
332
|
+
label="Available shipping methods"
|
|
333
|
+
name="shipping-methods"
|
|
334
|
+
multiple
|
|
335
|
+
>
|
|
336
|
+
<s-choice value="standard" selected>
|
|
337
|
+
Standard shipping
|
|
338
|
+
<s-text slot="details">5-7 business days delivery</s-text>
|
|
339
|
+
</s-choice>
|
|
340
|
+
<s-choice value="express" selected>
|
|
341
|
+
Express shipping
|
|
342
|
+
<s-text slot="details">2-3 business days delivery</s-text>
|
|
343
|
+
</s-choice>
|
|
344
|
+
<s-choice value="overnight">
|
|
345
|
+
Overnight shipping
|
|
346
|
+
<s-text slot="details">Next business day delivery</s-text>
|
|
347
|
+
</s-choice>
|
|
348
|
+
</s-choice-list>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
##### html
|
|
352
|
+
|
|
353
|
+
```html
|
|
354
|
+
<s-choice-list
|
|
355
|
+
label="Available shipping methods"
|
|
356
|
+
name="shipping-methods"
|
|
357
|
+
multiple
|
|
358
|
+
>
|
|
359
|
+
<s-choice value="standard" selected>
|
|
360
|
+
Standard shipping
|
|
361
|
+
<s-text slot="details">5-7 business days delivery</s-text>
|
|
362
|
+
</s-choice>
|
|
363
|
+
<s-choice value="express" selected>
|
|
364
|
+
Express shipping
|
|
365
|
+
<s-text slot="details">2-3 business days delivery</s-text>
|
|
366
|
+
</s-choice>
|
|
367
|
+
<s-choice value="overnight">
|
|
368
|
+
Overnight shipping
|
|
369
|
+
<s-text slot="details">Next business day delivery</s-text>
|
|
370
|
+
</s-choice>
|
|
371
|
+
</s-choice-list>
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
* #### Choice list validation
|
|
375
|
+
|
|
376
|
+
##### Description
|
|
377
|
+
|
|
378
|
+
Interactive example showing required choice validation with dynamic error messages.
|
|
379
|
+
|
|
380
|
+
##### jsx
|
|
381
|
+
|
|
382
|
+
```jsx
|
|
383
|
+
const [error, setError] = useState('Please select at least one option');
|
|
384
|
+
|
|
385
|
+
return (
|
|
386
|
+
<s-section>
|
|
387
|
+
<s-stack gap="base" justifyContent="start">
|
|
388
|
+
<s-choice-list
|
|
389
|
+
label="Product visibility"
|
|
390
|
+
name="visibility"
|
|
391
|
+
error={error}
|
|
392
|
+
onChange={(e) => {
|
|
393
|
+
setError(e.currentTarget.values.length > 0 ? '' : 'Please select at least one option');
|
|
394
|
+
}}
|
|
395
|
+
>
|
|
396
|
+
<s-choice value="hidden">Hidden</s-choice>
|
|
397
|
+
<s-choice value="optional">Optional</s-choice>
|
|
398
|
+
<s-choice value="required">Required</s-choice>
|
|
399
|
+
</s-choice-list>
|
|
400
|
+
</s-stack>
|
|
401
|
+
</s-section>
|
|
402
|
+
)
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## Best practices
|
|
406
|
+
|
|
407
|
+
* Include a title that tells merchants what to do or explains the available options
|
|
408
|
+
* Label options clearly based on what the option will do
|
|
409
|
+
* Avoid mutually exclusive options when allowing multiple selection
|
|
410
|
+
|
|
411
|
+
## Content guidelines
|
|
412
|
+
|
|
413
|
+
* Write titles and choices in sentence case
|
|
414
|
+
* End titles with a colon if they introduce the list
|
|
415
|
+
* Start each choice with a capital letter
|
|
416
|
+
* Don't use commas or semicolons at the end of lines
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ColorPicker
|
|
3
|
+
description: Allow users to select a color from a color palette.
|
|
4
|
+
api_name: app-home
|
|
5
|
+
source_url:
|
|
6
|
+
html: >-
|
|
7
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/forms/colorpicker
|
|
8
|
+
md: >-
|
|
9
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/forms/colorpicker.md
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# ColorPicker
|
|
13
|
+
|
|
14
|
+
Allow users to select a color from a color palette.
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
* alpha
|
|
19
|
+
|
|
20
|
+
boolean
|
|
21
|
+
|
|
22
|
+
Default: false
|
|
23
|
+
|
|
24
|
+
Allow user to select an alpha value.
|
|
25
|
+
|
|
26
|
+
* defaultValue
|
|
27
|
+
|
|
28
|
+
string
|
|
29
|
+
|
|
30
|
+
The default value for the field.
|
|
31
|
+
|
|
32
|
+
* formResetCallback
|
|
33
|
+
|
|
34
|
+
() => void
|
|
35
|
+
|
|
36
|
+
* name
|
|
37
|
+
|
|
38
|
+
string
|
|
39
|
+
|
|
40
|
+
An identifier for the field that is unique within the nearest containing form.
|
|
41
|
+
|
|
42
|
+
* value
|
|
43
|
+
|
|
44
|
+
string
|
|
45
|
+
|
|
46
|
+
The currently selected color.
|
|
47
|
+
|
|
48
|
+
Supported formats include:
|
|
49
|
+
|
|
50
|
+
* HSL
|
|
51
|
+
|
|
52
|
+
## Events
|
|
53
|
+
|
|
54
|
+
Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
|
|
55
|
+
|
|
56
|
+
* change
|
|
57
|
+
|
|
58
|
+
CallbackEventListener\<typeof tagName> | null
|
|
59
|
+
|
|
60
|
+
* input
|
|
61
|
+
|
|
62
|
+
CallbackEventListener\<typeof tagName> | null
|
|
63
|
+
|
|
64
|
+
### CallbackEventListener
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
(EventListener & {
|
|
68
|
+
(event: CallbackEvent<T>): void;
|
|
69
|
+
}) | null
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### CallbackEvent
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
Event & {
|
|
76
|
+
currentTarget: HTMLElementTagNameMap[T];
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Examples
|
|
81
|
+
|
|
82
|
+
### Examples
|
|
83
|
+
|
|
84
|
+
* #### Code
|
|
85
|
+
|
|
86
|
+
##### jsx
|
|
87
|
+
|
|
88
|
+
```jsx
|
|
89
|
+
<s-color-picker value="#FF0000" alpha />
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
##### html
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<s-color-picker value="#FF0000" alpha></s-color-picker>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
* #### Basic usage
|
|
99
|
+
|
|
100
|
+
##### Description
|
|
101
|
+
|
|
102
|
+
Demonstrates a simple color picker with a pre-selected red color, showing the basic implementation without alpha transparency.
|
|
103
|
+
|
|
104
|
+
##### jsx
|
|
105
|
+
|
|
106
|
+
```jsx
|
|
107
|
+
<s-box padding="large" border="base" borderRadius="base">
|
|
108
|
+
<s-color-picker value="#FF0000" name="primary-color" />
|
|
109
|
+
</s-box>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
##### html
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<s-box padding="large" border="base" borderRadius="base">
|
|
116
|
+
<s-color-picker value="#FF0000" name="primary-color"></s-color-picker>
|
|
117
|
+
</s-box>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
* #### With alpha transparency
|
|
121
|
+
|
|
122
|
+
##### Description
|
|
123
|
+
|
|
124
|
+
Illustrates a color picker with alpha transparency enabled, allowing selection of colors with varying opacity levels.
|
|
125
|
+
|
|
126
|
+
##### jsx
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
129
|
+
<s-box padding="large" border="base" borderRadius="base">
|
|
130
|
+
<s-color-picker
|
|
131
|
+
value="#FF0000FF"
|
|
132
|
+
alpha
|
|
133
|
+
name="color-with-alpha"
|
|
134
|
+
/>
|
|
135
|
+
</s-box>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
##### html
|
|
139
|
+
|
|
140
|
+
```html
|
|
141
|
+
<s-box padding="large" border="base" borderRadius="base">
|
|
142
|
+
<s-color-picker
|
|
143
|
+
value="#FF0000FF"
|
|
144
|
+
alpha
|
|
145
|
+
name="color-with-alpha"
|
|
146
|
+
></s-color-picker>
|
|
147
|
+
</s-box>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Best practices
|
|
151
|
+
|
|
152
|
+
* Use the alpha slider if you want to allow merchants to select a transparent color
|