@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/link.md
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Link
|
|
3
|
+
description: >-
|
|
4
|
+
Makes text interactive, allowing users to navigate to other pages or perform
|
|
5
|
+
specific actions. Supports standard URLs, custom protocols, and navigation
|
|
6
|
+
within Shopify or app pages.
|
|
7
|
+
api_name: app-home
|
|
8
|
+
source_url:
|
|
9
|
+
html: 'https://shopify.dev/docs/api/app-home/polaris-web-components/actions/link'
|
|
10
|
+
md: 'https://shopify.dev/docs/api/app-home/polaris-web-components/actions/link.md'
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Link
|
|
14
|
+
|
|
15
|
+
Makes text interactive, allowing users to navigate to other pages or perform specific actions. Supports standard URLs, custom protocols, and navigation within Shopify or app pages.
|
|
16
|
+
|
|
17
|
+
## Properties
|
|
18
|
+
|
|
19
|
+
* accessibilityLabel
|
|
20
|
+
|
|
21
|
+
string
|
|
22
|
+
|
|
23
|
+
A label that describes the purpose or contents of the Link. It will be read to users using assistive technologies such as screen readers.
|
|
24
|
+
|
|
25
|
+
Use this when using only an icon or the content of the link is not enough context for users using assistive technologies.
|
|
26
|
+
|
|
27
|
+
* command
|
|
28
|
+
|
|
29
|
+
'--auto' | '--show' | '--hide' | '--toggle'
|
|
30
|
+
|
|
31
|
+
Default: '--auto'
|
|
32
|
+
|
|
33
|
+
Sets the action the [command](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command) should take when this clickable is activated.
|
|
34
|
+
|
|
35
|
+
See the documentation of particular components for the actions they support.
|
|
36
|
+
|
|
37
|
+
* `--auto`: a default action for the target component.
|
|
38
|
+
* `--show`: shows the target component.
|
|
39
|
+
* `--hide`: hides the target component.
|
|
40
|
+
* `--toggle`: toggles the target component.
|
|
41
|
+
|
|
42
|
+
* commandFor
|
|
43
|
+
|
|
44
|
+
string
|
|
45
|
+
|
|
46
|
+
Sets the element the [commandFor](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor) should act on when this clickable is activated.
|
|
47
|
+
|
|
48
|
+
* download
|
|
49
|
+
|
|
50
|
+
string
|
|
51
|
+
|
|
52
|
+
Causes the browser to treat the linked URL as a download with the string being the file name. Download only works for same-origin URLs or the `blob:` and `data:` schemes.
|
|
53
|
+
|
|
54
|
+
* href
|
|
55
|
+
|
|
56
|
+
string
|
|
57
|
+
|
|
58
|
+
The URL to link to.
|
|
59
|
+
|
|
60
|
+
* If set, it will navigate to the location specified by `href` after executing the `click` event.
|
|
61
|
+
* If a `commandFor` is set, the `command` will be executed instead of the navigation.
|
|
62
|
+
|
|
63
|
+
* interestFor
|
|
64
|
+
|
|
65
|
+
string
|
|
66
|
+
|
|
67
|
+
Sets the element the [interestFor](https://open-ui.org/components/interest-invokers.explainer/#the-pitch-in-code) should act on when this clickable is activated.
|
|
68
|
+
|
|
69
|
+
* lang
|
|
70
|
+
|
|
71
|
+
string
|
|
72
|
+
|
|
73
|
+
Indicate the text language. Useful when the text is in a different language than the rest of the page. It will allow assistive technologies such as screen readers to invoke the correct pronunciation. [Reference of values](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) ("subtag" label)
|
|
74
|
+
|
|
75
|
+
* target
|
|
76
|
+
|
|
77
|
+
"auto" | AnyString | "\_blank" | "\_self" | "\_parent" | "\_top"
|
|
78
|
+
|
|
79
|
+
Default: 'auto'
|
|
80
|
+
|
|
81
|
+
Specifies where to display the linked URL.
|
|
82
|
+
|
|
83
|
+
* tone
|
|
84
|
+
|
|
85
|
+
"critical" | "auto" | "neutral"
|
|
86
|
+
|
|
87
|
+
Default: 'auto'
|
|
88
|
+
|
|
89
|
+
Sets the tone of the Link, based on the intention of the information being conveyed.
|
|
90
|
+
|
|
91
|
+
### AnyString
|
|
92
|
+
|
|
93
|
+
Prevents widening string literal types in a union to \`string\`.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
string & {}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Events
|
|
100
|
+
|
|
101
|
+
Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
|
|
102
|
+
|
|
103
|
+
* click
|
|
104
|
+
|
|
105
|
+
CallbackEventListener\<typeof tagName> | null
|
|
106
|
+
|
|
107
|
+
### CallbackEventListener
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
(EventListener & {
|
|
111
|
+
(event: CallbackEvent<T>): void;
|
|
112
|
+
}) | null
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### CallbackEvent
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
Event & {
|
|
119
|
+
currentTarget: HTMLElementTagNameMap[T];
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Slots
|
|
124
|
+
|
|
125
|
+
* children
|
|
126
|
+
|
|
127
|
+
HTMLElement
|
|
128
|
+
|
|
129
|
+
The content of the Link.
|
|
130
|
+
|
|
131
|
+
Examples
|
|
132
|
+
|
|
133
|
+
### Examples
|
|
134
|
+
|
|
135
|
+
* #### Code
|
|
136
|
+
|
|
137
|
+
##### jsx
|
|
138
|
+
|
|
139
|
+
```jsx
|
|
140
|
+
<s-link href="javascript:void(0)">fufilling orders</s-link>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
##### html
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<s-link href="#beep">fufilling orders</s-link>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
* #### Basic Links in Paragraph
|
|
150
|
+
|
|
151
|
+
##### Description
|
|
152
|
+
|
|
153
|
+
Links automatically inherit the tone from their surrounding paragraph context.
|
|
154
|
+
|
|
155
|
+
##### jsx
|
|
156
|
+
|
|
157
|
+
```jsx
|
|
158
|
+
<s-paragraph>
|
|
159
|
+
Your product catalog is empty. Start by <s-link href="javascript:void(0)">adding your first product</s-link> or <s-link href="javascript:void(0)">importing existing inventory</s-link>.
|
|
160
|
+
</s-paragraph>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
##### html
|
|
164
|
+
|
|
165
|
+
```html
|
|
166
|
+
<s-paragraph>
|
|
167
|
+
Your product catalog is empty. Start by <s-link href="javascript:void(0)">adding your first product</s-link> or <s-link href="javascript:void(0)">importing existing inventory</s-link>.
|
|
168
|
+
</s-paragraph>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
* #### Links in Subdued Paragraph
|
|
172
|
+
|
|
173
|
+
##### Description
|
|
174
|
+
|
|
175
|
+
Demonstrates links within subdued paragraph, showing how links can be used in less prominent paragraph contexts for additional guidance or support.
|
|
176
|
+
|
|
177
|
+
##### jsx
|
|
178
|
+
|
|
179
|
+
```jsx
|
|
180
|
+
<s-paragraph color="subdued">
|
|
181
|
+
Need help setting up shipping rates? <s-link>View shipping guide</s-link> or <s-link>contact merchant support</s-link>.
|
|
182
|
+
</s-paragraph>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
##### html
|
|
186
|
+
|
|
187
|
+
```html
|
|
188
|
+
<s-paragraph color="subdued">
|
|
189
|
+
Need help setting up shipping rates? <s-link href="javascript:void(0)" target="_blank">View shipping guide</s-link> or <s-link href="javascript:void(0)">contact merchant support</s-link>.
|
|
190
|
+
</s-paragraph>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
* #### Critical Context Links
|
|
194
|
+
|
|
195
|
+
##### Description
|
|
196
|
+
|
|
197
|
+
Illustrates how links can be used in critical or urgent text contexts, drawing attention to important actions that require immediate user intervention.
|
|
198
|
+
|
|
199
|
+
##### jsx
|
|
200
|
+
|
|
201
|
+
```jsx
|
|
202
|
+
<s-paragraph tone="critical">
|
|
203
|
+
Your store will be suspended in 24 hours due to unpaid balance. <s-link href="javascript:void(0)">Update payment method</s-link> to avoid service interruption.
|
|
204
|
+
</s-paragraph>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
##### html
|
|
208
|
+
|
|
209
|
+
```html
|
|
210
|
+
<s-paragraph tone="critical">
|
|
211
|
+
Your store will be suspended in 24 hours due to unpaid balance. <s-link href="javascript:void(0)">Update payment method</s-link> to avoid service interruption.
|
|
212
|
+
</s-paragraph>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
* #### Links with Auto Tone
|
|
216
|
+
|
|
217
|
+
##### Description
|
|
218
|
+
|
|
219
|
+
Shows how links automatically adapt their tone to the surrounding text context, maintaining visual consistency while providing navigation.
|
|
220
|
+
|
|
221
|
+
##### jsx
|
|
222
|
+
|
|
223
|
+
```jsx
|
|
224
|
+
<s-paragraph>
|
|
225
|
+
You have 15 pending orders to fulfill. <s-link href="javascript:void(0)">Review unfulfilled orders</s-link> to keep customers happy.
|
|
226
|
+
</s-paragraph>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
##### html
|
|
230
|
+
|
|
231
|
+
```html
|
|
232
|
+
<s-paragraph>
|
|
233
|
+
You have 15 pending orders to fulfill. <s-link href="javascript:void(0)">Review unfulfilled orders</s-link> to keep customers happy.
|
|
234
|
+
</s-paragraph>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
* #### Links in Banner
|
|
238
|
+
|
|
239
|
+
##### Description
|
|
240
|
+
|
|
241
|
+
Demonstrates how links can be integrated within banner components to highlight important information and provide direct action paths.
|
|
242
|
+
|
|
243
|
+
##### jsx
|
|
244
|
+
|
|
245
|
+
```jsx
|
|
246
|
+
<s-banner tone="info">
|
|
247
|
+
<s-paragraph>
|
|
248
|
+
Black Friday campaigns are now available! <s-link href="javascript:void(0)">Create your campaign</s-link>
|
|
249
|
+
</s-paragraph>
|
|
250
|
+
</s-banner>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
##### html
|
|
254
|
+
|
|
255
|
+
```html
|
|
256
|
+
<s-banner tone="info">
|
|
257
|
+
<s-paragraph>
|
|
258
|
+
Black Friday campaigns are now available!
|
|
259
|
+
<s-link href="javascript:void(0)">Create your campaign</s-link>
|
|
260
|
+
</s-paragraph>
|
|
261
|
+
</s-banner>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
* #### Links in Box Container
|
|
265
|
+
|
|
266
|
+
##### Description
|
|
267
|
+
|
|
268
|
+
Illustrates using links within a box container to provide contextual navigation and additional information in a visually contained area.
|
|
269
|
+
|
|
270
|
+
##### jsx
|
|
271
|
+
|
|
272
|
+
```jsx
|
|
273
|
+
<s-box padding="base" background="base" borderWidth="base" borderColor="base">
|
|
274
|
+
<s-paragraph>
|
|
275
|
+
Boost your store's conversion with professional themes. <s-link href="javascript:void(0)">Browse theme store</s-link> or <s-link href="javascript:void(0)">customize your current theme</s-link>.
|
|
276
|
+
</s-paragraph>
|
|
277
|
+
</s-box>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
##### html
|
|
281
|
+
|
|
282
|
+
```html
|
|
283
|
+
<s-box padding="base" background="base" borderWidth="base" borderColor="base">
|
|
284
|
+
<s-paragraph>
|
|
285
|
+
Boost your store's conversion with professional themes. <s-link href="javascript:void(0)">Browse theme store</s-link> or <s-link href="javascript:void(0)">customize your current theme</s-link>.
|
|
286
|
+
</s-paragraph>
|
|
287
|
+
</s-box>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
* #### Links in Banner Context
|
|
291
|
+
|
|
292
|
+
##### Description
|
|
293
|
+
|
|
294
|
+
Shows how links can be used within warning banners to provide immediate actions related to critical notifications.
|
|
295
|
+
|
|
296
|
+
##### jsx
|
|
297
|
+
|
|
298
|
+
```jsx
|
|
299
|
+
<s-banner tone="warning">
|
|
300
|
+
<s-paragraph>
|
|
301
|
+
Your inventory for "Vintage t-shirt" is running low (3 remaining). <s-link>Restock inventory</s-link>
|
|
302
|
+
</s-paragraph>
|
|
303
|
+
</s-banner>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
##### html
|
|
307
|
+
|
|
308
|
+
```html
|
|
309
|
+
<s-banner tone="warning">
|
|
310
|
+
<s-paragraph>
|
|
311
|
+
Your inventory for "Vintage t-shirt" is running low (3 remaining). <s-link>Restock inventory</s-link>
|
|
312
|
+
</s-paragraph>
|
|
313
|
+
</s-banner>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
* #### Download Links
|
|
317
|
+
|
|
318
|
+
##### Description
|
|
319
|
+
|
|
320
|
+
Demonstrates how to create links that trigger file downloads, useful for exporting data or providing downloadable resources.
|
|
321
|
+
|
|
322
|
+
##### jsx
|
|
323
|
+
|
|
324
|
+
```jsx
|
|
325
|
+
<s-paragraph>
|
|
326
|
+
Export your customer data for marketing analysis. <s-link href="javascript:void(0)" download="customer-export.csv">Download customer list</s-link>
|
|
327
|
+
</s-paragraph>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
##### html
|
|
331
|
+
|
|
332
|
+
```html
|
|
333
|
+
<s-paragraph>
|
|
334
|
+
Export your customer data for marketing analysis. <s-link href="javascript:void(0)" download="customer-export.csv">Download customer list</s-link>
|
|
335
|
+
</s-paragraph>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
* #### External Links
|
|
339
|
+
|
|
340
|
+
##### Description
|
|
341
|
+
|
|
342
|
+
Illustrates linking to external resources with different targets, showing how to open links in new tabs and provide navigation to external documentation.
|
|
343
|
+
|
|
344
|
+
##### jsx
|
|
345
|
+
|
|
346
|
+
```jsx
|
|
347
|
+
<s-box padding="base">
|
|
348
|
+
<s-paragraph>
|
|
349
|
+
Need help with policies? Read our <s-link href="javascript:void(0)" target="_blank">billing docs</s-link> or review the <s-link href="javascript:void(0)" target="_blank">terms of service</s-link>.
|
|
350
|
+
</s-paragraph>
|
|
351
|
+
</s-box>
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
##### html
|
|
355
|
+
|
|
356
|
+
```html
|
|
357
|
+
<s-box padding="base">
|
|
358
|
+
<s-paragraph>
|
|
359
|
+
Need help with policies? Read our <s-link href="javascript:void(0)" target="_blank">billing docs</s-link> or review the <s-link href="javascript:void(0)" target="_blank">terms of service</s-link>.
|
|
360
|
+
</s-paragraph>
|
|
361
|
+
</s-box>
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
* #### Links with Language Attribute
|
|
365
|
+
|
|
366
|
+
##### Description
|
|
367
|
+
|
|
368
|
+
Shows how to use the \`lang\` attribute to specify the language of a link, supporting internationalization and proper screen reader pronunciation.
|
|
369
|
+
|
|
370
|
+
##### jsx
|
|
371
|
+
|
|
372
|
+
```jsx
|
|
373
|
+
<s-paragraph>
|
|
374
|
+
Voir en français: <s-link lang="fr">Gérer les produits</s-link>
|
|
375
|
+
</s-paragraph>
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
##### html
|
|
379
|
+
|
|
380
|
+
```html
|
|
381
|
+
<s-paragraph>
|
|
382
|
+
Voir en français: <s-link lang="fr">Gérer les produits</s-link>
|
|
383
|
+
</s-paragraph>
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
* #### Links with Different Tones
|
|
387
|
+
|
|
388
|
+
##### Description
|
|
389
|
+
|
|
390
|
+
Demonstrates how links can have different visual tones, including default, neutral, and critical, allowing for varied contextual styling.
|
|
391
|
+
|
|
392
|
+
##### jsx
|
|
393
|
+
|
|
394
|
+
```jsx
|
|
395
|
+
<s-stack gap="base">
|
|
396
|
+
<s-paragraph>
|
|
397
|
+
Default tone: <s-link>View orders</s-link>
|
|
398
|
+
</s-paragraph>
|
|
399
|
+
|
|
400
|
+
<s-paragraph tone="success">
|
|
401
|
+
Success tone: <s-link>Inventory help</s-link>
|
|
402
|
+
</s-paragraph>
|
|
403
|
+
|
|
404
|
+
<s-paragraph tone="critical">
|
|
405
|
+
Critical tone: <s-link>Close store</s-link>
|
|
406
|
+
</s-paragraph>
|
|
407
|
+
|
|
408
|
+
<s-paragraph tone="warning">
|
|
409
|
+
Warning tone: <s-link>Update billing info</s-link>
|
|
410
|
+
</s-paragraph>
|
|
411
|
+
|
|
412
|
+
<s-paragraph tone="info">
|
|
413
|
+
Info tone: <s-link>Learn more about reports</s-link>
|
|
414
|
+
</s-paragraph>
|
|
415
|
+
|
|
416
|
+
<s-paragraph tone="caution">
|
|
417
|
+
Caution tone: <s-link>View archived products</s-link>
|
|
418
|
+
</s-paragraph>
|
|
419
|
+
</s-stack>
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
##### html
|
|
423
|
+
|
|
424
|
+
```html
|
|
425
|
+
<s-stack gap="base">
|
|
426
|
+
<s-paragraph>
|
|
427
|
+
Default tone: <s-link>View orders</s-link>
|
|
428
|
+
</s-paragraph>
|
|
429
|
+
|
|
430
|
+
<s-paragraph tone="success">
|
|
431
|
+
Neutral tone: <s-link>Inventory help</s-link>
|
|
432
|
+
</s-paragraph>
|
|
433
|
+
|
|
434
|
+
<s-paragraph tone="critical">
|
|
435
|
+
Critical tone: <s-link>Close store</s-link>
|
|
436
|
+
</s-paragraph>
|
|
437
|
+
|
|
438
|
+
<s-paragraph tone="warning">
|
|
439
|
+
Warning tone: <s-link>Update billing info</s-link>
|
|
440
|
+
</s-paragraph>
|
|
441
|
+
|
|
442
|
+
<s-paragraph tone="info">
|
|
443
|
+
Info tone: <s-link>Learn more about reports</s-link>
|
|
444
|
+
</s-paragraph>
|
|
445
|
+
|
|
446
|
+
<s-paragraph tone="caution">
|
|
447
|
+
Subdued tone: <s-link>View archived products</s-link>
|
|
448
|
+
</s-paragraph>
|
|
449
|
+
</s-stack>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
## Best practices
|
|
453
|
+
|
|
454
|
+
* Use links for navigation and buttons for actions
|
|
455
|
+
* Use default links whenever possible to avoid disorienting merchants
|
|
456
|
+
* Open external links in a new tab only when merchants are performing a task or navigating outside the Shopify admin
|