@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,703 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Clickable
|
|
3
|
+
description: >-
|
|
4
|
+
A generic interactive container component that provides a flexible alternative
|
|
5
|
+
for custom interactive elements not achievable with existing components like
|
|
6
|
+
Button or Link. Use it to apply specific styling such as backgrounds, padding,
|
|
7
|
+
or borders.
|
|
8
|
+
api_name: app-home
|
|
9
|
+
source_url:
|
|
10
|
+
html: >-
|
|
11
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/actions/clickable
|
|
12
|
+
md: >-
|
|
13
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/actions/clickable.md
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Clickable
|
|
17
|
+
|
|
18
|
+
A generic interactive container component that provides a flexible alternative for custom interactive elements not achievable with existing components like Button or Link. Use it to apply specific styling such as backgrounds, padding, or borders.
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
* accessibilityLabel
|
|
23
|
+
|
|
24
|
+
string
|
|
25
|
+
|
|
26
|
+
A label that describes the purpose or contents of the element. When set, it will be announced to users using assistive technologies and will provide them with more context.
|
|
27
|
+
|
|
28
|
+
Only use this when the element's content is not enough context for users using assistive technologies.
|
|
29
|
+
|
|
30
|
+
* accessibilityRole
|
|
31
|
+
|
|
32
|
+
AccessibilityRole
|
|
33
|
+
|
|
34
|
+
Default: 'generic'
|
|
35
|
+
|
|
36
|
+
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help users navigate the page.
|
|
37
|
+
|
|
38
|
+
* accessibilityVisibility
|
|
39
|
+
|
|
40
|
+
"visible" | "hidden" | "exclusive"
|
|
41
|
+
|
|
42
|
+
Default: 'visible'
|
|
43
|
+
|
|
44
|
+
Changes the visibility of the element.
|
|
45
|
+
|
|
46
|
+
* `visible`: the element is visible to all users.
|
|
47
|
+
* `hidden`: the element is removed from the accessibility tree but remains visible.
|
|
48
|
+
* `exclusive`: the element is visually hidden but remains in the accessibility tree.
|
|
49
|
+
|
|
50
|
+
* background
|
|
51
|
+
|
|
52
|
+
BackgroundColorKeyword
|
|
53
|
+
|
|
54
|
+
Default: 'transparent'
|
|
55
|
+
|
|
56
|
+
Adjust the background of the component.
|
|
57
|
+
|
|
58
|
+
* blockSize
|
|
59
|
+
|
|
60
|
+
SizeUnitsOrAuto
|
|
61
|
+
|
|
62
|
+
Default: 'auto'
|
|
63
|
+
|
|
64
|
+
Adjust the [block size](https://developer.mozilla.org/en-US/docs/Web/CSS/block-size).
|
|
65
|
+
|
|
66
|
+
* border
|
|
67
|
+
|
|
68
|
+
BorderShorthand
|
|
69
|
+
|
|
70
|
+
Default: 'none' - equivalent to \`none base auto\`.
|
|
71
|
+
|
|
72
|
+
Set the border via the shorthand property.
|
|
73
|
+
|
|
74
|
+
This can be a size, optionally followed by a color, optionally followed by a style.
|
|
75
|
+
|
|
76
|
+
If the color is not specified, it will be `base`.
|
|
77
|
+
|
|
78
|
+
If the style is not specified, it will be `auto`.
|
|
79
|
+
|
|
80
|
+
Values can be overridden by `borderWidth`, `borderStyle`, and `borderColor`.
|
|
81
|
+
|
|
82
|
+
* borderColor
|
|
83
|
+
|
|
84
|
+
"" | ColorKeyword
|
|
85
|
+
|
|
86
|
+
Default: '' - meaning no override
|
|
87
|
+
|
|
88
|
+
Adjust the color of the border.
|
|
89
|
+
|
|
90
|
+
* borderRadius
|
|
91
|
+
|
|
92
|
+
MaybeAllValuesShorthandProperty\<BoxBorderRadii>
|
|
93
|
+
|
|
94
|
+
Default: 'none'
|
|
95
|
+
|
|
96
|
+
Adjust the radius of the border.
|
|
97
|
+
|
|
98
|
+
* borderStyle
|
|
99
|
+
|
|
100
|
+
"" | MaybeAllValuesShorthandProperty\<BoxBorderStyles>
|
|
101
|
+
|
|
102
|
+
Default: '' - meaning no override
|
|
103
|
+
|
|
104
|
+
Adjust the style of the border.
|
|
105
|
+
|
|
106
|
+
* borderWidth
|
|
107
|
+
|
|
108
|
+
"" | MaybeAllValuesShorthandProperty<"small" | "small-100" | "base" | "large" | "large-100" | "none">
|
|
109
|
+
|
|
110
|
+
Default: '' - meaning no override
|
|
111
|
+
|
|
112
|
+
Adjust the width of the border.
|
|
113
|
+
|
|
114
|
+
* command
|
|
115
|
+
|
|
116
|
+
'--auto' | '--show' | '--hide' | '--toggle'
|
|
117
|
+
|
|
118
|
+
Default: '--auto'
|
|
119
|
+
|
|
120
|
+
Sets the action the [command](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command) should take when this clickable is activated.
|
|
121
|
+
|
|
122
|
+
See the documentation of particular components for the actions they support.
|
|
123
|
+
|
|
124
|
+
* `--auto`: a default action for the target component.
|
|
125
|
+
* `--show`: shows the target component.
|
|
126
|
+
* `--hide`: hides the target component.
|
|
127
|
+
* `--toggle`: toggles the target component.
|
|
128
|
+
|
|
129
|
+
* commandFor
|
|
130
|
+
|
|
131
|
+
string
|
|
132
|
+
|
|
133
|
+
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.
|
|
134
|
+
|
|
135
|
+
* disabled
|
|
136
|
+
|
|
137
|
+
boolean
|
|
138
|
+
|
|
139
|
+
Disables the clickable, meaning it cannot be clicked or receive focus.
|
|
140
|
+
|
|
141
|
+
In this state, onClick will not fire. If the click event originates from a child element, the event will immediately stop propagating from this element.
|
|
142
|
+
|
|
143
|
+
However, items within the clickable can still receive focus and be interacted with.
|
|
144
|
+
|
|
145
|
+
This has no impact on the visual state by default, but developers are encouraged to style the clickable accordingly.
|
|
146
|
+
|
|
147
|
+
* display
|
|
148
|
+
|
|
149
|
+
MaybeResponsive<"auto" | "none">
|
|
150
|
+
|
|
151
|
+
Default: 'auto'
|
|
152
|
+
|
|
153
|
+
Sets the outer [display](https://developer.mozilla.org/en-US/docs/Web/CSS/display) type of the component. The outer type sets a component's participation in [flow layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flow_layout).
|
|
154
|
+
|
|
155
|
+
* `auto` the component's initial value. The actual value depends on the component and context.
|
|
156
|
+
* `none` hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
|
|
157
|
+
|
|
158
|
+
* download
|
|
159
|
+
|
|
160
|
+
string
|
|
161
|
+
|
|
162
|
+
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.
|
|
163
|
+
|
|
164
|
+
* href
|
|
165
|
+
|
|
166
|
+
string
|
|
167
|
+
|
|
168
|
+
The URL to link to.
|
|
169
|
+
|
|
170
|
+
* If set, it will navigate to the location specified by `href` after executing the `click` event.
|
|
171
|
+
* If a `commandFor` is set, the `command` will be executed instead of the navigation.
|
|
172
|
+
|
|
173
|
+
* inlineSize
|
|
174
|
+
|
|
175
|
+
SizeUnitsOrAuto
|
|
176
|
+
|
|
177
|
+
Default: 'auto'
|
|
178
|
+
|
|
179
|
+
Adjust the [inline size](https://developer.mozilla.org/en-US/docs/Web/CSS/inline-size).
|
|
180
|
+
|
|
181
|
+
* interestFor
|
|
182
|
+
|
|
183
|
+
string
|
|
184
|
+
|
|
185
|
+
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.
|
|
186
|
+
|
|
187
|
+
* loading
|
|
188
|
+
|
|
189
|
+
boolean
|
|
190
|
+
|
|
191
|
+
Disables the clickable, and indicates to assistive technology that the loading is in progress.
|
|
192
|
+
|
|
193
|
+
This also disables the clickable.
|
|
194
|
+
|
|
195
|
+
* maxBlockSize
|
|
196
|
+
|
|
197
|
+
SizeUnitsOrNone
|
|
198
|
+
|
|
199
|
+
Default: 'none'
|
|
200
|
+
|
|
201
|
+
Adjust the [maximum block size](https://developer.mozilla.org/en-US/docs/Web/CSS/max-block-size).
|
|
202
|
+
|
|
203
|
+
* maxInlineSize
|
|
204
|
+
|
|
205
|
+
SizeUnitsOrNone
|
|
206
|
+
|
|
207
|
+
Default: 'none'
|
|
208
|
+
|
|
209
|
+
Adjust the [maximum inline size](https://developer.mozilla.org/en-US/docs/Web/CSS/max-inline-size).
|
|
210
|
+
|
|
211
|
+
* minBlockSize
|
|
212
|
+
|
|
213
|
+
SizeUnits
|
|
214
|
+
|
|
215
|
+
Default: '0'
|
|
216
|
+
|
|
217
|
+
Adjust the [minimum block size](https://developer.mozilla.org/en-US/docs/Web/CSS/min-block-size).
|
|
218
|
+
|
|
219
|
+
* minInlineSize
|
|
220
|
+
|
|
221
|
+
SizeUnits
|
|
222
|
+
|
|
223
|
+
Default: '0'
|
|
224
|
+
|
|
225
|
+
Adjust the [minimum inline size](https://developer.mozilla.org/en-US/docs/Web/CSS/min-inline-size).
|
|
226
|
+
|
|
227
|
+
* overflow
|
|
228
|
+
|
|
229
|
+
"visible" | "hidden"
|
|
230
|
+
|
|
231
|
+
Default: 'visible'
|
|
232
|
+
|
|
233
|
+
Sets the overflow behavior of the element.
|
|
234
|
+
|
|
235
|
+
* `hidden`: clips the content when it is larger than the element’s container. The element will not be scrollable and the users will not be able to access the clipped content by dragging or using a scroll wheel on a mouse.
|
|
236
|
+
* `visible`: the content that extends beyond the element’s container is visible.
|
|
237
|
+
|
|
238
|
+
* padding
|
|
239
|
+
|
|
240
|
+
MaybeResponsive\<MaybeAllValuesShorthandProperty\<PaddingKeyword>>
|
|
241
|
+
|
|
242
|
+
Default: 'none'
|
|
243
|
+
|
|
244
|
+
Adjust the padding of all edges.
|
|
245
|
+
|
|
246
|
+
[1-to-4-value syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
|
|
247
|
+
|
|
248
|
+
* 4 values: `block-start inline-end block-end inline-start`
|
|
249
|
+
* 3 values: `block-start inline block-end`
|
|
250
|
+
* 2 values: `block inline`
|
|
251
|
+
|
|
252
|
+
For example:
|
|
253
|
+
|
|
254
|
+
* `large` means block-start, inline-end, block-end and inline-start paddings are `large`.
|
|
255
|
+
* `large none` means block-start and block-end paddings are `large`, inline-start and inline-end paddings are `none`.
|
|
256
|
+
* `large none large` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `none`.
|
|
257
|
+
* `large none large small` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `small`.
|
|
258
|
+
|
|
259
|
+
A padding value of `auto` will use the default padding for the closest container that has had its usual padding removed.
|
|
260
|
+
|
|
261
|
+
`padding` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
262
|
+
|
|
263
|
+
* paddingBlock
|
|
264
|
+
|
|
265
|
+
MaybeResponsive<"" | MaybeTwoValuesShorthandProperty\<PaddingKeyword>>
|
|
266
|
+
|
|
267
|
+
Default: '' - meaning no override
|
|
268
|
+
|
|
269
|
+
Adjust the block-padding.
|
|
270
|
+
|
|
271
|
+
* `large none` means block-start padding is `large`, block-end padding is `none`.
|
|
272
|
+
|
|
273
|
+
This overrides the block value of `padding`.
|
|
274
|
+
|
|
275
|
+
`paddingBlock` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
276
|
+
|
|
277
|
+
* paddingBlockEnd
|
|
278
|
+
|
|
279
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
280
|
+
|
|
281
|
+
Default: '' - meaning no override
|
|
282
|
+
|
|
283
|
+
Adjust the block-end padding.
|
|
284
|
+
|
|
285
|
+
This overrides the block-end value of `paddingBlock`.
|
|
286
|
+
|
|
287
|
+
`paddingBlockEnd` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
288
|
+
|
|
289
|
+
* paddingBlockStart
|
|
290
|
+
|
|
291
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
292
|
+
|
|
293
|
+
Default: '' - meaning no override
|
|
294
|
+
|
|
295
|
+
Adjust the block-start padding.
|
|
296
|
+
|
|
297
|
+
This overrides the block-start value of `paddingBlock`.
|
|
298
|
+
|
|
299
|
+
`paddingBlockStart` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
300
|
+
|
|
301
|
+
* paddingInline
|
|
302
|
+
|
|
303
|
+
MaybeResponsive<"" | MaybeTwoValuesShorthandProperty\<PaddingKeyword>>
|
|
304
|
+
|
|
305
|
+
Default: '' - meaning no override
|
|
306
|
+
|
|
307
|
+
Adjust the inline padding.
|
|
308
|
+
|
|
309
|
+
* `large none` means inline-start padding is `large`, inline-end padding is `none`.
|
|
310
|
+
|
|
311
|
+
This overrides the inline value of `padding`.
|
|
312
|
+
|
|
313
|
+
`paddingInline` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
314
|
+
|
|
315
|
+
* paddingInlineEnd
|
|
316
|
+
|
|
317
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
318
|
+
|
|
319
|
+
Default: '' - meaning no override
|
|
320
|
+
|
|
321
|
+
Adjust the inline-end padding.
|
|
322
|
+
|
|
323
|
+
This overrides the inline-end value of `paddingInline`.
|
|
324
|
+
|
|
325
|
+
`paddingInlineEnd` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
326
|
+
|
|
327
|
+
* paddingInlineStart
|
|
328
|
+
|
|
329
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
330
|
+
|
|
331
|
+
Default: '' - meaning no override
|
|
332
|
+
|
|
333
|
+
Adjust the inline-start padding.
|
|
334
|
+
|
|
335
|
+
This overrides the inline-start value of `paddingInline`.
|
|
336
|
+
|
|
337
|
+
`paddingInlineStart` also accepts a [responsive value](https://shopify.dev/docs/api/app-home/using-polaris-components#responsive-values) string with the supported PaddingKeyword as a query value.
|
|
338
|
+
|
|
339
|
+
* target
|
|
340
|
+
|
|
341
|
+
"auto" | AnyString | "\_blank" | "\_self" | "\_parent" | "\_top"
|
|
342
|
+
|
|
343
|
+
Default: 'auto'
|
|
344
|
+
|
|
345
|
+
Specifies where to display the linked URL.
|
|
346
|
+
|
|
347
|
+
* type
|
|
348
|
+
|
|
349
|
+
"button" | "reset" | "submit"
|
|
350
|
+
|
|
351
|
+
Default: 'button'
|
|
352
|
+
|
|
353
|
+
The behavior of the Button.
|
|
354
|
+
|
|
355
|
+
* `submit`: Used to indicate the component acts as a submit button, meaning it submits the closest form.
|
|
356
|
+
* `button`: Used to indicate the component acts as a button, meaning it has no default action.
|
|
357
|
+
* `reset`: Used to indicate the component acts as a reset button, meaning it resets the closest form (returning fields to their default values).
|
|
358
|
+
|
|
359
|
+
This property is ignored if the component supports `href` or `commandFor`/`command` and one of them is set.
|
|
360
|
+
|
|
361
|
+
### AccessibilityRole
|
|
362
|
+
|
|
363
|
+
```ts
|
|
364
|
+
'main' | 'header' | 'footer' | 'section' | 'aside' | 'navigation' | 'ordered-list' | 'list-item' | 'list-item-separator' | 'unordered-list' | 'separator' | 'status' | 'alert' | 'generic' | 'presentation' | 'none'
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### BackgroundColorKeyword
|
|
368
|
+
|
|
369
|
+
```ts
|
|
370
|
+
'transparent' | ColorKeyword
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### ColorKeyword
|
|
374
|
+
|
|
375
|
+
```ts
|
|
376
|
+
'subdued' | 'base' | 'strong'
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### SizeUnitsOrAuto
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
SizeUnits | 'auto'
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### SizeUnits
|
|
386
|
+
|
|
387
|
+
```ts
|
|
388
|
+
`${number}px` | `${number}%` | `0`
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### BorderShorthand
|
|
392
|
+
|
|
393
|
+
Represents a shorthand for defining a border. It can be a combination of size, optionally followed by color, optionally followed by style.
|
|
394
|
+
|
|
395
|
+
```ts
|
|
396
|
+
BorderSizeKeyword | `${BorderSizeKeyword} ${ColorKeyword}` | `${BorderSizeKeyword} ${ColorKeyword} ${BorderStyleKeyword}`
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### BorderSizeKeyword
|
|
400
|
+
|
|
401
|
+
```ts
|
|
402
|
+
SizeKeyword | 'none'
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### SizeKeyword
|
|
406
|
+
|
|
407
|
+
```ts
|
|
408
|
+
'small-500' | 'small-400' | 'small-300' | 'small-200' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'large-200' | 'large-300' | 'large-400' | 'large-500'
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### BorderStyleKeyword
|
|
412
|
+
|
|
413
|
+
```ts
|
|
414
|
+
'none' | 'solid' | 'dashed' | 'dotted' | 'auto'
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### MaybeAllValuesShorthandProperty
|
|
418
|
+
|
|
419
|
+
```ts
|
|
420
|
+
T | `${T} ${T}` | `${T} ${T} ${T}` | `${T} ${T} ${T} ${T}`
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### BoxBorderRadii
|
|
424
|
+
|
|
425
|
+
```ts
|
|
426
|
+
'small' | 'small-200' | 'small-100' | 'base' | 'large' | 'large-100' | 'large-200' | 'none'
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### BoxBorderStyles
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
'auto' | 'none' | 'solid' | 'dashed'
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### MaybeResponsive
|
|
436
|
+
|
|
437
|
+
```ts
|
|
438
|
+
T | `@container${string}`
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
### SizeUnitsOrNone
|
|
442
|
+
|
|
443
|
+
```ts
|
|
444
|
+
SizeUnits | 'none'
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### PaddingKeyword
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
SizeKeyword | 'none'
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### MaybeTwoValuesShorthandProperty
|
|
454
|
+
|
|
455
|
+
```ts
|
|
456
|
+
T | `${T} ${T}`
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### AnyString
|
|
460
|
+
|
|
461
|
+
Prevents widening string literal types in a union to \`string\`.
|
|
462
|
+
|
|
463
|
+
```ts
|
|
464
|
+
string & {}
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
## Events
|
|
468
|
+
|
|
469
|
+
Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
|
|
470
|
+
|
|
471
|
+
* blur
|
|
472
|
+
|
|
473
|
+
CallbackEventListener\<typeof tagName> | null
|
|
474
|
+
|
|
475
|
+
* click
|
|
476
|
+
|
|
477
|
+
CallbackEventListener\<typeof tagName> | null
|
|
478
|
+
|
|
479
|
+
* focus
|
|
480
|
+
|
|
481
|
+
CallbackEventListener\<typeof tagName> | null
|
|
482
|
+
|
|
483
|
+
### CallbackEventListener
|
|
484
|
+
|
|
485
|
+
```ts
|
|
486
|
+
(EventListener & {
|
|
487
|
+
(event: CallbackEvent<T>): void;
|
|
488
|
+
}) | null
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### CallbackEvent
|
|
492
|
+
|
|
493
|
+
```ts
|
|
494
|
+
Event & {
|
|
495
|
+
currentTarget: HTMLElementTagNameMap[T];
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
## Slots
|
|
500
|
+
|
|
501
|
+
* children
|
|
502
|
+
|
|
503
|
+
HTMLElement
|
|
504
|
+
|
|
505
|
+
The content of the Clickable.
|
|
506
|
+
|
|
507
|
+
Examples
|
|
508
|
+
|
|
509
|
+
### Examples
|
|
510
|
+
|
|
511
|
+
* #### Code
|
|
512
|
+
|
|
513
|
+
##### jsx
|
|
514
|
+
|
|
515
|
+
```jsx
|
|
516
|
+
<>
|
|
517
|
+
<s-clickable padding="base">Create Store</s-clickable>
|
|
518
|
+
|
|
519
|
+
<s-clickable
|
|
520
|
+
border="base"
|
|
521
|
+
padding="base"
|
|
522
|
+
background="subdued"
|
|
523
|
+
borderRadius="base"
|
|
524
|
+
>
|
|
525
|
+
View Shipping Settings
|
|
526
|
+
</s-clickable>
|
|
527
|
+
</>
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
##### html
|
|
531
|
+
|
|
532
|
+
```html
|
|
533
|
+
<s-clickable padding="base">Create Store</s-clickable>
|
|
534
|
+
|
|
535
|
+
<s-clickable
|
|
536
|
+
border="base"
|
|
537
|
+
padding="base"
|
|
538
|
+
background="subdued"
|
|
539
|
+
borderRadius="base"
|
|
540
|
+
>
|
|
541
|
+
View Shipping Settings
|
|
542
|
+
</s-clickable>
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
* #### Basic Button Usage
|
|
546
|
+
|
|
547
|
+
##### Description
|
|
548
|
+
|
|
549
|
+
A simple clickable button with a base border and padding, demonstrating the default button behavior of the Clickable component.
|
|
550
|
+
|
|
551
|
+
##### jsx
|
|
552
|
+
|
|
553
|
+
```jsx
|
|
554
|
+
<s-clickable border="base" padding="base">
|
|
555
|
+
Click me
|
|
556
|
+
</s-clickable>
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
##### html
|
|
560
|
+
|
|
561
|
+
```html
|
|
562
|
+
<s-clickable border="base" padding="base">Click me</s-clickable>
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
* #### Link Mode
|
|
566
|
+
|
|
567
|
+
##### Description
|
|
568
|
+
|
|
569
|
+
Demonstrates the Clickable component's ability to function as a link, opening the specified URL in a new browser tab when clicked.
|
|
570
|
+
|
|
571
|
+
##### jsx
|
|
572
|
+
|
|
573
|
+
```jsx
|
|
574
|
+
<s-clickable href="javascript:void(0)" target="_blank">
|
|
575
|
+
Visit Shopify
|
|
576
|
+
</s-clickable>
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
##### html
|
|
580
|
+
|
|
581
|
+
```html
|
|
582
|
+
<s-clickable href="javascript:void(0)" target="_blank">
|
|
583
|
+
Visit Shopify
|
|
584
|
+
</s-clickable>
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
* #### Form Submit Button
|
|
588
|
+
|
|
589
|
+
##### Description
|
|
590
|
+
|
|
591
|
+
A disabled submit button that can be used within a form, showing the component's form integration capabilities and disabled state.
|
|
592
|
+
|
|
593
|
+
##### jsx
|
|
594
|
+
|
|
595
|
+
```jsx
|
|
596
|
+
<s-clickable type="submit" disabled border="base" padding="base">
|
|
597
|
+
Save changes
|
|
598
|
+
</s-clickable>
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
##### html
|
|
602
|
+
|
|
603
|
+
```html
|
|
604
|
+
<s-clickable type="submit" disabled border="base" padding="base">
|
|
605
|
+
Save changes
|
|
606
|
+
</s-clickable>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
* #### Section with Clickable Action
|
|
610
|
+
|
|
611
|
+
##### Description
|
|
612
|
+
|
|
613
|
+
Illustrates how the Clickable component can be integrated into a section layout to provide an interactive action button.
|
|
614
|
+
|
|
615
|
+
##### jsx
|
|
616
|
+
|
|
617
|
+
```jsx
|
|
618
|
+
<s-box padding="large-400" background="base" borderRadius="small-200">
|
|
619
|
+
<s-stack gap="large-300">
|
|
620
|
+
<s-heading>Product settings</s-heading>
|
|
621
|
+
<s-text>Configure your product inventory and pricing settings.</s-text>
|
|
622
|
+
<s-clickable background="base" padding="base" borderRadius="small">
|
|
623
|
+
<s-text type="strong">Configure settings</s-text>
|
|
624
|
+
</s-clickable>
|
|
625
|
+
</s-stack>
|
|
626
|
+
</s-box>
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
##### html
|
|
630
|
+
|
|
631
|
+
```html
|
|
632
|
+
<s-box padding="large-400" background="base" borderRadius="small-200">
|
|
633
|
+
<s-stack gap="large-300">
|
|
634
|
+
<s-heading>Product settings</s-heading>
|
|
635
|
+
<s-text>Configure your product inventory and pricing settings.</s-text>
|
|
636
|
+
<s-clickable background="base" padding="base" borderRadius="small">
|
|
637
|
+
<s-text type="strong">Configure settings</s-text>
|
|
638
|
+
</s-clickable>
|
|
639
|
+
</s-stack>
|
|
640
|
+
</s-box>
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
* #### Accessibility with ARIA Attributes
|
|
644
|
+
|
|
645
|
+
##### Description
|
|
646
|
+
|
|
647
|
+
Demonstrates the use of an accessibility label to provide context for screen readers, enhancing the component's usability for users with assistive technologies.
|
|
648
|
+
|
|
649
|
+
##### jsx
|
|
650
|
+
|
|
651
|
+
```jsx
|
|
652
|
+
<s-clickable
|
|
653
|
+
accessibilityLabel="Delete product winter collection jacket"
|
|
654
|
+
background="base"
|
|
655
|
+
padding="base"
|
|
656
|
+
borderRadius="small"
|
|
657
|
+
>
|
|
658
|
+
<s-text>Delete</s-text>
|
|
659
|
+
</s-clickable>
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
##### html
|
|
663
|
+
|
|
664
|
+
```html
|
|
665
|
+
<s-clickable
|
|
666
|
+
accessibilityLabel="Delete product winter collection jacket"
|
|
667
|
+
background="base"
|
|
668
|
+
padding="base"
|
|
669
|
+
borderRadius="small"
|
|
670
|
+
>
|
|
671
|
+
<s-text>Delete</s-text>
|
|
672
|
+
</s-clickable>
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
* #### Disabled Link with ARIA
|
|
676
|
+
|
|
677
|
+
##### Description
|
|
678
|
+
|
|
679
|
+
Shows a disabled link with an accessibility label, explaining the unavailability of a feature to users of assistive technologies.
|
|
680
|
+
|
|
681
|
+
##### jsx
|
|
682
|
+
|
|
683
|
+
```jsx
|
|
684
|
+
<s-clickable
|
|
685
|
+
href="javascript:void(0)"
|
|
686
|
+
disabled
|
|
687
|
+
accessibilityLabel="This link is currently unavailable"
|
|
688
|
+
>
|
|
689
|
+
<s-text>Unavailable feature</s-text>
|
|
690
|
+
</s-clickable>
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
##### html
|
|
694
|
+
|
|
695
|
+
```html
|
|
696
|
+
<s-clickable
|
|
697
|
+
href="javascript:void(0)"
|
|
698
|
+
disabled
|
|
699
|
+
accessibilityLabel="This link is currently unavailable"
|
|
700
|
+
>
|
|
701
|
+
<s-text>Unavailable feature</s-text>
|
|
702
|
+
</s-clickable>
|
|
703
|
+
```
|