@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
package/docs/select.md
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Select
|
|
3
|
+
description: >-
|
|
4
|
+
Allow users to pick one option from a menu. Ideal when presenting four or more
|
|
5
|
+
choices to keep interfaces uncluttered.
|
|
6
|
+
api_name: app-home
|
|
7
|
+
source_url:
|
|
8
|
+
html: 'https://shopify.dev/docs/api/app-home/polaris-web-components/forms/select'
|
|
9
|
+
md: 'https://shopify.dev/docs/api/app-home/polaris-web-components/forms/select.md'
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Select
|
|
13
|
+
|
|
14
|
+
Allow users to pick one option from a menu. Ideal when presenting four or more choices to keep interfaces uncluttered.
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
* details
|
|
19
|
+
|
|
20
|
+
string
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
This will also be exposed to screen reader users.
|
|
25
|
+
|
|
26
|
+
* disabled
|
|
27
|
+
|
|
28
|
+
boolean
|
|
29
|
+
|
|
30
|
+
Default: false
|
|
31
|
+
|
|
32
|
+
Disables the field, disallowing any interaction.
|
|
33
|
+
|
|
34
|
+
* disconnectedCallback
|
|
35
|
+
|
|
36
|
+
() => void
|
|
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
|
+
* icon
|
|
45
|
+
|
|
46
|
+
"" | "replace" | "search" | "split" | "link" | "edit" | "product" | "variant" | "collection" | "select" | "info" | "incomplete" | "complete" | "color" | "money" | "adjust" | "affiliate" | "airplane" | "alert-bubble" | "alert-circle" | "alert-diamond" | "alert-location" | "alert-octagon" | "alert-octagon-filled" | "alert-triangle" | "alert-triangle-filled" | "app-extension" | "apps" | "archive" | "arrow-down" | "arrow-down-circle" | "arrow-down-right" | "arrow-left" | "arrow-left-circle" | "arrow-right" | "arrow-right-circle" | "arrow-up" | "arrow-up-circle" | "arrow-up-right" | "arrows-in-horizontal" | "arrows-out-horizontal" | "asterisk" | "attachment" | "automation" | "backspace" | "bag" | "bank" | "barcode" | "battery-low" | "bill" | "blank" | "blog" | "bolt" | "bolt-filled" | "book" | "book-open" | "bug" | "bullet" | "business-entity" | "button" | "button-press" | "calculator" | "calendar" | "calendar-check" | "calendar-compare" | "calendar-list" | "calendar-time" | "camera" | "camera-flip" | "caret-down" | "caret-left" | "caret-right" | "caret-up" | "cart" | "cart-abandoned" | "cart-discount" | "cart-down" | "cart-filled" | "cart-sale" | "cart-send" | "cart-up" | "cash-dollar" | "cash-euro" | "cash-pound" | "cash-rupee" | "cash-yen" | "catalog-product" | "categories" | "channels" | "chart-cohort" | "chart-donut" | "chart-funnel" | "chart-histogram-first" | "chart-histogram-first-last" | "chart-histogram-flat" | "chart-histogram-full" | "chart-histogram-growth" | "chart-histogram-last" | "chart-histogram-second-last" | "chart-horizontal" | "chart-line" | "chart-popular" | "chart-stacked" | "chart-vertical" | "chat" | "chat-new" | "chat-referral" | "check" | "check-circle" | "check-circle-filled" | "checkbox" | "chevron-down" | "chevron-down-circle" | "chevron-left" | "chevron-left-circle" | "chevron-right" | "chevron-right-circle" | "chevron-up" | "chevron-up-circle" | "circle" | "circle-dashed" | "clipboard" | "clipboard-check" | "clipboard-checklist" | "clock" | "clock-list" | "clock-revert" | "code" | "code-add" | "collection-featured" | "collection-list" | "collection-reference" | "color-none" | "compass" | "compose" | "confetti" | "connect" | "content" | "contract" | "corner-pill" | "corner-round" | "corner-square" | "credit-card" | "credit-card-cancel" | "credit-card-percent" | "credit-card-reader" | "credit-card-reader-chip" | "credit-card-reader-tap" | "credit-card-secure" | "credit-card-tap-chip" | "crop" | "currency-convert" | "cursor" | "cursor-banner" | "cursor-option" | "data-presentation" | "data-table" | "database" | "database-add" | "database-connect" | "delete" | "delivered" | "delivery" | "desktop" | "disabled" | "disabled-filled" | "discount" | "discount-add" | "discount-automatic" | "discount-code" | "discount-remove" | "dns-settings" | "dock-floating" | "dock-side" | "domain" | "domain-landing-page" | "domain-new" | "domain-redirect" | "download" | "drag-drop" | "drag-handle" | "drawer" | "duplicate" | "email" | "email-follow-up" | "email-newsletter" | "empty" | "enabled" | "enter" | "envelope" | "envelope-soft-pack" | "eraser" | "exchange" | "exit" | "export" | "external" | "eye-check-mark" | "eye-dropper" | "eye-dropper-list" | "eye-first" | "eyeglasses" | "fav" | "favicon" | "file" | "file-list" | "filter" | "filter-active" | "flag" | "flip-horizontal" | "flip-vertical" | "flower" | "folder" | "folder-add" | "folder-down" | "folder-remove" | "folder-up" | "food" | "foreground" | "forklift" | "forms" | "games" | "gauge" | "geolocation" | "gift" | "gift-card" | "git-branch" | "git-commit" | "git-repository" | "globe" | "globe-asia" | "globe-europe" | "globe-lines" | "globe-list" | "graduation-hat" | "grid" | "hashtag" | "hashtag-decimal" | "hashtag-list" | "heart" | "hide" | "hide-filled" | "home" | "home-filled" | "icons" | "identity-card" | "image" | "image-add" | "image-alt" | "image-explore" | "image-magic" | "image-none" | "image-with-text-overlay" | "images" | "import" | "in-progress" | "incentive" | "incoming" | "info-filled" | "inheritance" | "inventory" | "inventory-edit" | "inventory-list" | "inventory-transfer" | "inventory-updated" | "iq" | "key" | "keyboard" | "keyboard-filled" | "keyboard-hide" | "keypad" | "label-printer" | "language" | "language-translate" | "layout-block" | "layout-buy-button" | "layout-buy-button-horizontal" | "layout-buy-button-vertical" | "layout-column-1" | "layout-columns-2" | "layout-columns-3" | "layout-footer" | "layout-header" | "layout-logo-block" | "layout-popup" | "layout-rows-2" | "layout-section" | "layout-sidebar-left" | "layout-sidebar-right" | "lightbulb" | "link-list" | "list-bulleted" | "list-bulleted-filled" | "list-numbered" | "live" | "live-critical" | "live-none" | "location" | "location-none" | "lock" | "map" | "markets" | "markets-euro" | "markets-rupee" | "markets-yen" | "maximize" | "measurement-size" | "measurement-size-list" | "measurement-volume" | "measurement-volume-list" | "measurement-weight" | "measurement-weight-list" | "media-receiver" | "megaphone" | "mention" | "menu" | "menu-filled" | "menu-horizontal" | "menu-vertical" | "merge" | "metafields" | "metaobject" | "metaobject-list" | "metaobject-reference" | "microphone" | "microphone-muted" | "minimize" | "minus" | "minus-circle" | "mobile" | "money-none" | "money-split" | "moon" | "nature" | "note" | "note-add" | "notification" | "number-one" | "order" | "order-batches" | "order-draft" | "order-filled" | "order-first" | "order-fulfilled" | "order-repeat" | "order-unfulfilled" | "orders-status" | "organization" | "outdent" | "outgoing" | "package" | "package-cancel" | "package-fulfilled" | "package-on-hold" | "package-reassign" | "package-returned" | "page" | "page-add" | "page-attachment" | "page-clock" | "page-down" | "page-heart" | "page-list" | "page-reference" | "page-remove" | "page-report" | "page-up" | "pagination-end" | "pagination-start" | "paint-brush-flat" | "paint-brush-round" | "paper-check" | "partially-complete" | "passkey" | "paste" | "pause-circle" | "payment" | "payment-capture" | "payout" | "payout-dollar" | "payout-euro" | "payout-pound" | "payout-rupee" | "payout-yen" | "person" | "person-add" | "person-exit" | "person-filled" | "person-list" | "person-lock" | "person-remove" | "person-segment" | "personalized-text" | "phablet" | "phone" | "phone-down" | "phone-down-filled" | "phone-in" | "phone-out" | "pin" | "pin-remove" | "plan" | "play" | "play-circle" | "plus" | "plus-circle" | "plus-circle-down" | "plus-circle-filled" | "plus-circle-up" | "point-of-sale" | "point-of-sale-register" | "price-list" | "print" | "product-add" | "product-cost" | "product-filled" | "product-list" | "product-reference" | "product-remove" | "product-return" | "product-unavailable" | "profile" | "profile-filled" | "question-circle" | "question-circle-filled" | "radio-control" | "receipt" | "receipt-dollar" | "receipt-euro" | "receipt-folded" | "receipt-paid" | "receipt-pound" | "receipt-refund" | "receipt-rupee" | "receipt-yen" | "receivables" | "redo" | "referral-code" | "refresh" | "remove-background" | "reorder" | "replay" | "reset" | "return" | "reward" | "rocket" | "rotate-left" | "rotate-right" | "sandbox" | "save" | "savings" | "scan-qr-code" | "search-add" | "search-list" | "search-recent" | "search-resource" | "send" | "settings" | "share" | "shield-check-mark" | "shield-none" | "shield-pending" | "shield-person" | "shipping-label" | "shipping-label-cancel" | "shopcodes" | "slideshow" | "smiley-happy" | "smiley-joy" | "smiley-neutral" | "smiley-sad" | "social-ad" | "social-post" | "sort" | "sort-ascending" | "sort-descending" | "sound" | "sports" | "star" | "star-circle" | "star-filled" | "star-half" | "star-list" | "status" | "status-active" | "stop-circle" | "store" | "store-import" | "store-managed" | "store-online" | "sun" | "table" | "table-masonry" | "tablet" | "target" | "tax" | "team" | "text" | "text-align-center" | "text-align-left" | "text-align-right" | "text-block" | "text-bold" | "text-color" | "text-font" | "text-font-list" | "text-grammar" | "text-in-columns" | "text-in-rows" | "text-indent" | "text-indent-remove" | "text-italic" | "text-quote" | "text-title" | "text-underline" | "text-with-image" | "theme" | "theme-edit" | "theme-store" | "theme-template" | "three-d-environment" | "thumbs-down" | "thumbs-up" | "tip-jar" | "toggle-off" | "toggle-on" | "transaction" | "transaction-fee-add" | "transaction-fee-dollar" | "transaction-fee-euro" | "transaction-fee-pound" | "transaction-fee-rupee" | "transaction-fee-yen" | "transfer" | "transfer-in" | "transfer-internal" | "transfer-out" | "truck" | "undo" | "unknown-device" | "unlock" | "upload" | "variant-list" | "video" | "video-list" | "view" | "viewport-narrow" | "viewport-short" | "viewport-tall" | "viewport-wide" | "wallet" | "wand" | "watch" | "wifi" | "work" | "work-list" | "wrench" | "x" | "x-circle" | "x-circle-filled"
|
|
47
|
+
|
|
48
|
+
The type of icon to be displayed in the field.
|
|
49
|
+
|
|
50
|
+
* id
|
|
51
|
+
|
|
52
|
+
string
|
|
53
|
+
|
|
54
|
+
A unique identifier for the element.
|
|
55
|
+
|
|
56
|
+
* label
|
|
57
|
+
|
|
58
|
+
string
|
|
59
|
+
|
|
60
|
+
Content to use as the field label.
|
|
61
|
+
|
|
62
|
+
* labelAccessibilityVisibility
|
|
63
|
+
|
|
64
|
+
"visible" | "exclusive"
|
|
65
|
+
|
|
66
|
+
Default: 'visible'
|
|
67
|
+
|
|
68
|
+
Changes the visibility of the component's label.
|
|
69
|
+
|
|
70
|
+
* `visible`: the label is visible to all users.
|
|
71
|
+
* `exclusive`: the label is visually hidden but remains in the accessibility tree.
|
|
72
|
+
|
|
73
|
+
* name
|
|
74
|
+
|
|
75
|
+
string
|
|
76
|
+
|
|
77
|
+
An identifier for the field that is unique within the nearest containing form.
|
|
78
|
+
|
|
79
|
+
* placeholder
|
|
80
|
+
|
|
81
|
+
string
|
|
82
|
+
|
|
83
|
+
A short hint that describes the expected value of the field.
|
|
84
|
+
|
|
85
|
+
* required
|
|
86
|
+
|
|
87
|
+
boolean
|
|
88
|
+
|
|
89
|
+
Default: false
|
|
90
|
+
|
|
91
|
+
Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the `error` property.
|
|
92
|
+
|
|
93
|
+
* value
|
|
94
|
+
|
|
95
|
+
string
|
|
96
|
+
|
|
97
|
+
The current value for the field. If omitted, the field will be empty.
|
|
98
|
+
|
|
99
|
+
## Events
|
|
100
|
+
|
|
101
|
+
Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
|
|
102
|
+
|
|
103
|
+
* change
|
|
104
|
+
|
|
105
|
+
CallbackEventListener<'input'>
|
|
106
|
+
|
|
107
|
+
* input
|
|
108
|
+
|
|
109
|
+
CallbackEventListener<'input'>
|
|
110
|
+
|
|
111
|
+
### CallbackEventListener
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
(EventListener & {
|
|
115
|
+
(event: CallbackEvent<T>): void;
|
|
116
|
+
}) | null
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### CallbackEvent
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
Event & {
|
|
123
|
+
currentTarget: HTMLElementTagNameMap[T];
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Slots
|
|
128
|
+
|
|
129
|
+
* children
|
|
130
|
+
|
|
131
|
+
HTMLElement
|
|
132
|
+
|
|
133
|
+
The options a user can select from.
|
|
134
|
+
|
|
135
|
+
Accepts `Option` and `OptionGroup` components.
|
|
136
|
+
|
|
137
|
+
## Option
|
|
138
|
+
|
|
139
|
+
Represents a single option within a select component. Use only as a child of `s-select` components.
|
|
140
|
+
|
|
141
|
+
* defaultSelected
|
|
142
|
+
|
|
143
|
+
boolean
|
|
144
|
+
|
|
145
|
+
Default: false
|
|
146
|
+
|
|
147
|
+
Whether the control is active by default.
|
|
148
|
+
|
|
149
|
+
* disabled
|
|
150
|
+
|
|
151
|
+
boolean
|
|
152
|
+
|
|
153
|
+
Default: false
|
|
154
|
+
|
|
155
|
+
Disables the control, disallowing any interaction.
|
|
156
|
+
|
|
157
|
+
* selected
|
|
158
|
+
|
|
159
|
+
boolean
|
|
160
|
+
|
|
161
|
+
Default: false
|
|
162
|
+
|
|
163
|
+
Whether the control is active.
|
|
164
|
+
|
|
165
|
+
* value
|
|
166
|
+
|
|
167
|
+
string
|
|
168
|
+
|
|
169
|
+
The value used in form data when the control is checked.
|
|
170
|
+
|
|
171
|
+
## Slots
|
|
172
|
+
|
|
173
|
+
* children
|
|
174
|
+
|
|
175
|
+
HTMLElement
|
|
176
|
+
|
|
177
|
+
The content to use as the label.
|
|
178
|
+
|
|
179
|
+
## OptionGroup
|
|
180
|
+
|
|
181
|
+
Represents a group of options within a select component. Use only as a child of `s-select` components.
|
|
182
|
+
|
|
183
|
+
* disabled
|
|
184
|
+
|
|
185
|
+
boolean
|
|
186
|
+
|
|
187
|
+
Default: false
|
|
188
|
+
|
|
189
|
+
Whether the options within this group can be selected or not.
|
|
190
|
+
|
|
191
|
+
* label
|
|
192
|
+
|
|
193
|
+
string
|
|
194
|
+
|
|
195
|
+
The user-facing label for this group of options.
|
|
196
|
+
|
|
197
|
+
## Slots
|
|
198
|
+
|
|
199
|
+
* children
|
|
200
|
+
|
|
201
|
+
HTMLElement
|
|
202
|
+
|
|
203
|
+
The options a user can select from.
|
|
204
|
+
|
|
205
|
+
Accepts `Option` components.
|
|
206
|
+
|
|
207
|
+
Examples
|
|
208
|
+
|
|
209
|
+
### Examples
|
|
210
|
+
|
|
211
|
+
* #### Code
|
|
212
|
+
|
|
213
|
+
##### jsx
|
|
214
|
+
|
|
215
|
+
```jsx
|
|
216
|
+
<s-select label="Date range">
|
|
217
|
+
<s-option value="1">Today</s-option>
|
|
218
|
+
<s-option value="2">Yesterday</s-option>
|
|
219
|
+
<s-option value="3">Last 7 days</s-option>
|
|
220
|
+
<s-option-group label="Custom ranges">
|
|
221
|
+
<s-option value="4">Last 30 days</s-option>
|
|
222
|
+
<s-option value="5">Last 90 days</s-option>
|
|
223
|
+
</s-option-group>
|
|
224
|
+
</s-select>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
##### html
|
|
228
|
+
|
|
229
|
+
```html
|
|
230
|
+
<s-select label="Date range">
|
|
231
|
+
<s-option value="1">Today</s-option>
|
|
232
|
+
<s-option value="2">Yesterday</s-option>
|
|
233
|
+
<s-option value="3">Last 7 days</s-option>
|
|
234
|
+
<s-option-group label="Custom ranges">
|
|
235
|
+
<s-option value="4">Last 30 days</s-option>
|
|
236
|
+
<s-option value="5">Last 90 days</s-option>
|
|
237
|
+
</s-option-group>
|
|
238
|
+
</s-select>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
* #### Basic usage
|
|
242
|
+
|
|
243
|
+
##### Description
|
|
244
|
+
|
|
245
|
+
A simple select dropdown with pre-selected value for product sorting options.
|
|
246
|
+
|
|
247
|
+
##### jsx
|
|
248
|
+
|
|
249
|
+
```jsx
|
|
250
|
+
<s-select label="Sort products by" value="newest">
|
|
251
|
+
<s-option value="newest">Newest first</s-option>
|
|
252
|
+
<s-option value="oldest">Oldest first</s-option>
|
|
253
|
+
<s-option value="title">Title A–Z</s-option>
|
|
254
|
+
<s-option value="price-low">Price: low to high</s-option>
|
|
255
|
+
<s-option value="price-high">Price: high to low</s-option>
|
|
256
|
+
</s-select>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
##### html
|
|
260
|
+
|
|
261
|
+
```html
|
|
262
|
+
<s-select label="Sort products by" value="newest">
|
|
263
|
+
<s-option value="newest">Newest first</s-option>
|
|
264
|
+
<s-option value="oldest">Oldest first</s-option>
|
|
265
|
+
<s-option value="title">Title A–Z</s-option>
|
|
266
|
+
<s-option value="price-low">Price: low to high</s-option>
|
|
267
|
+
<s-option value="price-high">Price: high to low</s-option>
|
|
268
|
+
</s-select>
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
* #### With placeholder
|
|
272
|
+
|
|
273
|
+
##### Description
|
|
274
|
+
|
|
275
|
+
Select dropdown with helpful placeholder text guiding category selection.
|
|
276
|
+
|
|
277
|
+
##### jsx
|
|
278
|
+
|
|
279
|
+
```jsx
|
|
280
|
+
<s-select
|
|
281
|
+
label="Product category"
|
|
282
|
+
placeholder="Choose category for better organization"
|
|
283
|
+
>
|
|
284
|
+
<s-option value="clothing">Clothing & apparel</s-option>
|
|
285
|
+
<s-option value="accessories">Accessories & jewelry</s-option>
|
|
286
|
+
<s-option value="home-garden">Home & garden</s-option>
|
|
287
|
+
<s-option value="electronics">Electronics & tech</s-option>
|
|
288
|
+
<s-option value="books">Books & media</s-option>
|
|
289
|
+
</s-select>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
##### html
|
|
293
|
+
|
|
294
|
+
```html
|
|
295
|
+
<s-select
|
|
296
|
+
label="Product category"
|
|
297
|
+
placeholder="Choose category for better organization"
|
|
298
|
+
>
|
|
299
|
+
<s-option value="clothing">Clothing & apparel</s-option>
|
|
300
|
+
<s-option value="accessories">Accessories & jewelry</s-option>
|
|
301
|
+
<s-option value="home-garden">Home & garden</s-option>
|
|
302
|
+
<s-option value="electronics">Electronics & tech</s-option>
|
|
303
|
+
<s-option value="books">Books & media</s-option>
|
|
304
|
+
</s-select>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
* #### With error state
|
|
308
|
+
|
|
309
|
+
##### Description
|
|
310
|
+
|
|
311
|
+
Select in error state showing specific business context and actionable error message.
|
|
312
|
+
|
|
313
|
+
##### jsx
|
|
314
|
+
|
|
315
|
+
```jsx
|
|
316
|
+
<s-select
|
|
317
|
+
label="Shipping origin"
|
|
318
|
+
error="Select your primary shipping location to calculate accurate rates for customers"
|
|
319
|
+
required
|
|
320
|
+
>
|
|
321
|
+
<s-option value="ca">Canada</s-option>
|
|
322
|
+
<s-option value="us">United states</s-option>
|
|
323
|
+
<s-option value="mx">Mexico</s-option>
|
|
324
|
+
<s-option value="uk">United kingdom</s-option>
|
|
325
|
+
</s-select>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
##### html
|
|
329
|
+
|
|
330
|
+
```html
|
|
331
|
+
<s-select
|
|
332
|
+
label="Shipping origin"
|
|
333
|
+
error="Select your primary shipping location to calculate accurate rates for customers"
|
|
334
|
+
required
|
|
335
|
+
>
|
|
336
|
+
<s-option value="ca">Canada</s-option>
|
|
337
|
+
<s-option value="us">United states</s-option>
|
|
338
|
+
<s-option value="mx">Mexico</s-option>
|
|
339
|
+
<s-option value="uk">United kingdom</s-option>
|
|
340
|
+
</s-select>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
* #### With option groups
|
|
344
|
+
|
|
345
|
+
##### Description
|
|
346
|
+
|
|
347
|
+
Grouped select options organized by geographical regions for international shipping.
|
|
348
|
+
|
|
349
|
+
##### jsx
|
|
350
|
+
|
|
351
|
+
```jsx
|
|
352
|
+
<s-select label="Shipping destination">
|
|
353
|
+
<s-option-group label="North america">
|
|
354
|
+
<s-option value="ca">Canada</s-option>
|
|
355
|
+
<s-option value="us">United states</s-option>
|
|
356
|
+
<s-option value="mx">Mexico</s-option>
|
|
357
|
+
</s-option-group>
|
|
358
|
+
<s-option-group label="Europe">
|
|
359
|
+
<s-option value="uk">United kingdom</s-option>
|
|
360
|
+
<s-option value="fr">France</s-option>
|
|
361
|
+
<s-option value="de">Germany</s-option>
|
|
362
|
+
<s-option value="it">Italy</s-option>
|
|
363
|
+
</s-option-group>
|
|
364
|
+
<s-option-group label="Asia pacific">
|
|
365
|
+
<s-option value="au">Australia</s-option>
|
|
366
|
+
<s-option value="jp">Japan</s-option>
|
|
367
|
+
<s-option value="sg">Singapore</s-option>
|
|
368
|
+
</s-option-group>
|
|
369
|
+
</s-select>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
##### html
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<s-select label="Shipping destination">
|
|
376
|
+
<s-option-group label="North america">
|
|
377
|
+
<s-option value="ca">Canada</s-option>
|
|
378
|
+
<s-option value="us">United states</s-option>
|
|
379
|
+
<s-option value="mx">Mexico</s-option>
|
|
380
|
+
</s-option-group>
|
|
381
|
+
<s-option-group label="Europe">
|
|
382
|
+
<s-option value="uk">United kingdom</s-option>
|
|
383
|
+
<s-option value="fr">France</s-option>
|
|
384
|
+
<s-option value="de">Germany</s-option>
|
|
385
|
+
<s-option value="it">Italy</s-option>
|
|
386
|
+
</s-option-group>
|
|
387
|
+
<s-option-group label="Asia pacific">
|
|
388
|
+
<s-option value="au">Australia</s-option>
|
|
389
|
+
<s-option value="jp">Japan</s-option>
|
|
390
|
+
<s-option value="sg">Singapore</s-option>
|
|
391
|
+
</s-option-group>
|
|
392
|
+
</s-select>
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
* #### With icon
|
|
396
|
+
|
|
397
|
+
##### Description
|
|
398
|
+
|
|
399
|
+
Select dropdown with sort icon for filtering order management views.
|
|
400
|
+
|
|
401
|
+
##### jsx
|
|
402
|
+
|
|
403
|
+
```jsx
|
|
404
|
+
<s-select label="Filter orders by" icon="sort">
|
|
405
|
+
<s-option value="date">Order date</s-option>
|
|
406
|
+
<s-option value="status">Fulfillment status</s-option>
|
|
407
|
+
<s-option value="total">Order total</s-option>
|
|
408
|
+
<s-option value="customer">Customer name</s-option>
|
|
409
|
+
</s-select>
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
##### html
|
|
413
|
+
|
|
414
|
+
```html
|
|
415
|
+
<s-select label="Filter orders by" icon="sort">
|
|
416
|
+
<s-option value="date">Order date</s-option>
|
|
417
|
+
<s-option value="status">Fulfillment status</s-option>
|
|
418
|
+
<s-option value="total">Order total</s-option>
|
|
419
|
+
<s-option value="customer">Customer name</s-option>
|
|
420
|
+
</s-select>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
* #### Disabled state
|
|
424
|
+
|
|
425
|
+
##### Description
|
|
426
|
+
|
|
427
|
+
Select in disabled state preventing user interaction with pre-selected value.
|
|
428
|
+
|
|
429
|
+
##### jsx
|
|
430
|
+
|
|
431
|
+
```jsx
|
|
432
|
+
<s-select label="Product type" disabled value="physical">
|
|
433
|
+
<s-option value="physical">Physical product</s-option>
|
|
434
|
+
<s-option value="digital">Digital product</s-option>
|
|
435
|
+
<s-option value="service">Service</s-option>
|
|
436
|
+
<s-option value="gift-card">Gift card</s-option>
|
|
437
|
+
</s-select>
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
##### html
|
|
441
|
+
|
|
442
|
+
```html
|
|
443
|
+
<s-select label="Product type" disabled value="physical">
|
|
444
|
+
<s-option value="physical">Physical product</s-option>
|
|
445
|
+
<s-option value="digital">Digital product</s-option>
|
|
446
|
+
<s-option value="service">Service</s-option>
|
|
447
|
+
<s-option value="gift-card">Gift card</s-option>
|
|
448
|
+
</s-select>
|
|
449
|
+
```
|
package/docs/spinner.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Spinner
|
|
3
|
+
description: >-
|
|
4
|
+
Displays an animated indicator showing users that content or actions are
|
|
5
|
+
loading. Use to communicate ongoing processes, such as fetching data from a
|
|
6
|
+
server. For loading states on buttons, use the “loading” property on the
|
|
7
|
+
Button component instead.
|
|
8
|
+
api_name: app-home
|
|
9
|
+
source_url:
|
|
10
|
+
html: >-
|
|
11
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/feedback/spinner
|
|
12
|
+
md: >-
|
|
13
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/feedback/spinner.md
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Spinner
|
|
17
|
+
|
|
18
|
+
Displays an animated indicator showing users that content or actions are loading. Use to communicate ongoing processes, such as fetching data from a server. For loading states on buttons, use the “loading” property on the Button component instead.
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
* accessibilityLabel
|
|
23
|
+
|
|
24
|
+
string
|
|
25
|
+
|
|
26
|
+
A label that describes the purpose of the progress. When set, it will be announced to users using assistive technologies and will provide them with more context. Providing an `accessibilityLabel` is recommended if there is no accompanying text describing that something is loading.
|
|
27
|
+
|
|
28
|
+
* size
|
|
29
|
+
|
|
30
|
+
"base" | "large" | "large-100"
|
|
31
|
+
|
|
32
|
+
Default: 'base'
|
|
33
|
+
|
|
34
|
+
Examples
|
|
35
|
+
|
|
36
|
+
### Examples
|
|
37
|
+
|
|
38
|
+
* #### Code
|
|
39
|
+
|
|
40
|
+
##### jsx
|
|
41
|
+
|
|
42
|
+
```jsx
|
|
43
|
+
<s-spinner accessibilityLabel="Loading" size="large-100" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
##### html
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<s-spinner accessibilityLabel="Loading" size="large-100"></s-spinner>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
* #### Basic usage
|
|
53
|
+
|
|
54
|
+
##### Description
|
|
55
|
+
|
|
56
|
+
Standard loading spinner with accessibility label for screen readers.
|
|
57
|
+
|
|
58
|
+
##### jsx
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
<s-spinner accessibilityLabel="Loading content" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
##### html
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<s-spinner accessibilityLabel="Loading content"></s-spinner>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
* #### Loading state in section
|
|
71
|
+
|
|
72
|
+
##### Description
|
|
73
|
+
|
|
74
|
+
Centered loading indicator with text in a section layout for content loading states.
|
|
75
|
+
|
|
76
|
+
##### jsx
|
|
77
|
+
|
|
78
|
+
```jsx
|
|
79
|
+
<s-stack alignItems="center" gap="base" padding="large">
|
|
80
|
+
<s-spinner accessibilityLabel="Loading products" size="large" />
|
|
81
|
+
<s-text>Loading products...</s-text>
|
|
82
|
+
</s-stack>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
##### html
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<s-stack alignItems="center" gap="base" padding="large">
|
|
89
|
+
<s-spinner accessibilityLabel="Loading products" size="large"></s-spinner>
|
|
90
|
+
<s-text>Loading products...</s-text>
|
|
91
|
+
</s-stack>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
* #### Inline loading with text
|
|
95
|
+
|
|
96
|
+
##### Description
|
|
97
|
+
|
|
98
|
+
Compact inline loading indicator for form submissions and quick actions.
|
|
99
|
+
|
|
100
|
+
##### jsx
|
|
101
|
+
|
|
102
|
+
```jsx
|
|
103
|
+
<s-stack direction="inline" alignItems="center" gap="small">
|
|
104
|
+
<s-spinner accessibilityLabel="Saving" />
|
|
105
|
+
<s-text>Saving...</s-text>
|
|
106
|
+
</s-stack>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
##### html
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<s-stack direction="inline" alignItems="center" gap="small">
|
|
113
|
+
<s-spinner accessibilityLabel="Saving"></s-spinner>
|
|
114
|
+
<s-text>Saving...</s-text>
|
|
115
|
+
</s-stack>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Best practices
|
|
119
|
+
|
|
120
|
+
* Use to notify merchants that their action is being processed
|
|
121
|
+
* Don't use for entire page loads
|