@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/box.md
ADDED
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Box
|
|
3
|
+
description: >-
|
|
4
|
+
A generic container that provides a flexible alternative for custom designs
|
|
5
|
+
not achievable with existing components. Use it to apply styling such as
|
|
6
|
+
backgrounds, padding, or borders, or to nest and group other components. The
|
|
7
|
+
contents of Box always maintain their natural size, making it especially
|
|
8
|
+
useful within layout components that would otherwise stretch their children.
|
|
9
|
+
api_name: app-home
|
|
10
|
+
source_url:
|
|
11
|
+
html: 'https://shopify.dev/docs/api/app-home/polaris-web-components/structure/box'
|
|
12
|
+
md: >-
|
|
13
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/structure/box.md
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Box
|
|
17
|
+
|
|
18
|
+
A generic container that provides a flexible alternative for custom designs not achievable with existing components. Use it to apply styling such as backgrounds, padding, or borders, or to nest and group other components. The contents of Box always maintain their natural size, making it especially useful within layout components that would otherwise stretch their children.
|
|
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
|
+
* display
|
|
115
|
+
|
|
116
|
+
MaybeResponsive<"auto" | "none">
|
|
117
|
+
|
|
118
|
+
Default: 'auto'
|
|
119
|
+
|
|
120
|
+
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).
|
|
121
|
+
|
|
122
|
+
* `auto` the component's initial value. The actual value depends on the component and context.
|
|
123
|
+
* `none` hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
|
|
124
|
+
|
|
125
|
+
* inlineSize
|
|
126
|
+
|
|
127
|
+
SizeUnitsOrAuto
|
|
128
|
+
|
|
129
|
+
Default: 'auto'
|
|
130
|
+
|
|
131
|
+
Adjust the [inline size](https://developer.mozilla.org/en-US/docs/Web/CSS/inline-size).
|
|
132
|
+
|
|
133
|
+
* maxBlockSize
|
|
134
|
+
|
|
135
|
+
SizeUnitsOrNone
|
|
136
|
+
|
|
137
|
+
Default: 'none'
|
|
138
|
+
|
|
139
|
+
Adjust the [maximum block size](https://developer.mozilla.org/en-US/docs/Web/CSS/max-block-size).
|
|
140
|
+
|
|
141
|
+
* maxInlineSize
|
|
142
|
+
|
|
143
|
+
SizeUnitsOrNone
|
|
144
|
+
|
|
145
|
+
Default: 'none'
|
|
146
|
+
|
|
147
|
+
Adjust the [maximum inline size](https://developer.mozilla.org/en-US/docs/Web/CSS/max-inline-size).
|
|
148
|
+
|
|
149
|
+
* minBlockSize
|
|
150
|
+
|
|
151
|
+
SizeUnits
|
|
152
|
+
|
|
153
|
+
Default: '0'
|
|
154
|
+
|
|
155
|
+
Adjust the [minimum block size](https://developer.mozilla.org/en-US/docs/Web/CSS/min-block-size).
|
|
156
|
+
|
|
157
|
+
* minInlineSize
|
|
158
|
+
|
|
159
|
+
SizeUnits
|
|
160
|
+
|
|
161
|
+
Default: '0'
|
|
162
|
+
|
|
163
|
+
Adjust the [minimum inline size](https://developer.mozilla.org/en-US/docs/Web/CSS/min-inline-size).
|
|
164
|
+
|
|
165
|
+
* overflow
|
|
166
|
+
|
|
167
|
+
"visible" | "hidden"
|
|
168
|
+
|
|
169
|
+
Default: 'visible'
|
|
170
|
+
|
|
171
|
+
Sets the overflow behavior of the element.
|
|
172
|
+
|
|
173
|
+
* `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.
|
|
174
|
+
* `visible`: the content that extends beyond the element’s container is visible.
|
|
175
|
+
|
|
176
|
+
* padding
|
|
177
|
+
|
|
178
|
+
MaybeResponsive\<MaybeAllValuesShorthandProperty\<PaddingKeyword>>
|
|
179
|
+
|
|
180
|
+
Default: 'none'
|
|
181
|
+
|
|
182
|
+
Adjust the padding of all edges.
|
|
183
|
+
|
|
184
|
+
[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:
|
|
185
|
+
|
|
186
|
+
* 4 values: `block-start inline-end block-end inline-start`
|
|
187
|
+
* 3 values: `block-start inline block-end`
|
|
188
|
+
* 2 values: `block inline`
|
|
189
|
+
|
|
190
|
+
For example:
|
|
191
|
+
|
|
192
|
+
* `large` means block-start, inline-end, block-end and inline-start paddings are `large`.
|
|
193
|
+
* `large none` means block-start and block-end paddings are `large`, inline-start and inline-end paddings are `none`.
|
|
194
|
+
* `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`.
|
|
195
|
+
* `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`.
|
|
196
|
+
|
|
197
|
+
A padding value of `auto` will use the default padding for the closest container that has had its usual padding removed.
|
|
198
|
+
|
|
199
|
+
`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.
|
|
200
|
+
|
|
201
|
+
* paddingBlock
|
|
202
|
+
|
|
203
|
+
MaybeResponsive<"" | MaybeTwoValuesShorthandProperty\<PaddingKeyword>>
|
|
204
|
+
|
|
205
|
+
Default: '' - meaning no override
|
|
206
|
+
|
|
207
|
+
Adjust the block-padding.
|
|
208
|
+
|
|
209
|
+
* `large none` means block-start padding is `large`, block-end padding is `none`.
|
|
210
|
+
|
|
211
|
+
This overrides the block value of `padding`.
|
|
212
|
+
|
|
213
|
+
`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.
|
|
214
|
+
|
|
215
|
+
* paddingBlockEnd
|
|
216
|
+
|
|
217
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
218
|
+
|
|
219
|
+
Default: '' - meaning no override
|
|
220
|
+
|
|
221
|
+
Adjust the block-end padding.
|
|
222
|
+
|
|
223
|
+
This overrides the block-end value of `paddingBlock`.
|
|
224
|
+
|
|
225
|
+
`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.
|
|
226
|
+
|
|
227
|
+
* paddingBlockStart
|
|
228
|
+
|
|
229
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
230
|
+
|
|
231
|
+
Default: '' - meaning no override
|
|
232
|
+
|
|
233
|
+
Adjust the block-start padding.
|
|
234
|
+
|
|
235
|
+
This overrides the block-start value of `paddingBlock`.
|
|
236
|
+
|
|
237
|
+
`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.
|
|
238
|
+
|
|
239
|
+
* paddingInline
|
|
240
|
+
|
|
241
|
+
MaybeResponsive<"" | MaybeTwoValuesShorthandProperty\<PaddingKeyword>>
|
|
242
|
+
|
|
243
|
+
Default: '' - meaning no override
|
|
244
|
+
|
|
245
|
+
Adjust the inline padding.
|
|
246
|
+
|
|
247
|
+
* `large none` means inline-start padding is `large`, inline-end padding is `none`.
|
|
248
|
+
|
|
249
|
+
This overrides the inline value of `padding`.
|
|
250
|
+
|
|
251
|
+
`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.
|
|
252
|
+
|
|
253
|
+
* paddingInlineEnd
|
|
254
|
+
|
|
255
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
256
|
+
|
|
257
|
+
Default: '' - meaning no override
|
|
258
|
+
|
|
259
|
+
Adjust the inline-end padding.
|
|
260
|
+
|
|
261
|
+
This overrides the inline-end value of `paddingInline`.
|
|
262
|
+
|
|
263
|
+
`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.
|
|
264
|
+
|
|
265
|
+
* paddingInlineStart
|
|
266
|
+
|
|
267
|
+
MaybeResponsive<"" | PaddingKeyword>
|
|
268
|
+
|
|
269
|
+
Default: '' - meaning no override
|
|
270
|
+
|
|
271
|
+
Adjust the inline-start padding.
|
|
272
|
+
|
|
273
|
+
This overrides the inline-start value of `paddingInline`.
|
|
274
|
+
|
|
275
|
+
`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.
|
|
276
|
+
|
|
277
|
+
### AccessibilityRole
|
|
278
|
+
|
|
279
|
+
```ts
|
|
280
|
+
'main' | 'header' | 'footer' | 'section' | 'aside' | 'navigation' | 'ordered-list' | 'list-item' | 'list-item-separator' | 'unordered-list' | 'separator' | 'status' | 'alert' | 'generic' | 'presentation' | 'none'
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### BackgroundColorKeyword
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
'transparent' | ColorKeyword
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### ColorKeyword
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
'subdued' | 'base' | 'strong'
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### SizeUnitsOrAuto
|
|
296
|
+
|
|
297
|
+
```ts
|
|
298
|
+
SizeUnits | 'auto'
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### SizeUnits
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
`${number}px` | `${number}%` | `0`
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### BorderShorthand
|
|
308
|
+
|
|
309
|
+
Represents a shorthand for defining a border. It can be a combination of size, optionally followed by color, optionally followed by style.
|
|
310
|
+
|
|
311
|
+
```ts
|
|
312
|
+
BorderSizeKeyword | `${BorderSizeKeyword} ${ColorKeyword}` | `${BorderSizeKeyword} ${ColorKeyword} ${BorderStyleKeyword}`
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### BorderSizeKeyword
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
SizeKeyword | 'none'
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### SizeKeyword
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
'small-500' | 'small-400' | 'small-300' | 'small-200' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'large-200' | 'large-300' | 'large-400' | 'large-500'
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### BorderStyleKeyword
|
|
328
|
+
|
|
329
|
+
```ts
|
|
330
|
+
'none' | 'solid' | 'dashed' | 'dotted' | 'auto'
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### MaybeAllValuesShorthandProperty
|
|
334
|
+
|
|
335
|
+
```ts
|
|
336
|
+
T | `${T} ${T}` | `${T} ${T} ${T}` | `${T} ${T} ${T} ${T}`
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### BoxBorderRadii
|
|
340
|
+
|
|
341
|
+
```ts
|
|
342
|
+
'small' | 'small-200' | 'small-100' | 'base' | 'large' | 'large-100' | 'large-200' | 'none'
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### BoxBorderStyles
|
|
346
|
+
|
|
347
|
+
```ts
|
|
348
|
+
'auto' | 'none' | 'solid' | 'dashed'
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### MaybeResponsive
|
|
352
|
+
|
|
353
|
+
```ts
|
|
354
|
+
T | `@container${string}`
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### SizeUnitsOrNone
|
|
358
|
+
|
|
359
|
+
```ts
|
|
360
|
+
SizeUnits | 'none'
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### PaddingKeyword
|
|
364
|
+
|
|
365
|
+
```ts
|
|
366
|
+
SizeKeyword | 'none'
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### MaybeTwoValuesShorthandProperty
|
|
370
|
+
|
|
371
|
+
```ts
|
|
372
|
+
T | `${T} ${T}`
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## Slots
|
|
376
|
+
|
|
377
|
+
* children
|
|
378
|
+
|
|
379
|
+
HTMLElement
|
|
380
|
+
|
|
381
|
+
The content of the Box.
|
|
382
|
+
|
|
383
|
+
Examples
|
|
384
|
+
|
|
385
|
+
### Examples
|
|
386
|
+
|
|
387
|
+
* #### Code
|
|
388
|
+
|
|
389
|
+
##### jsx
|
|
390
|
+
|
|
391
|
+
```jsx
|
|
392
|
+
<>
|
|
393
|
+
<s-box padding="base">Available for iPad, iPhone, and Android.</s-box>
|
|
394
|
+
|
|
395
|
+
<s-box padding="base" background="subdued" border="base" borderRadius="base">
|
|
396
|
+
Available for iPad, iPhone, and Android.
|
|
397
|
+
</s-box>
|
|
398
|
+
</>
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
##### html
|
|
402
|
+
|
|
403
|
+
```html
|
|
404
|
+
<s-box padding="base">Available for iPad, iPhone, and Android.</s-box>
|
|
405
|
+
|
|
406
|
+
<s-box padding="base" background="subdued" border="base" borderRadius="base">
|
|
407
|
+
Available for iPad, iPhone, and Android.
|
|
408
|
+
</s-box>
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
* #### Basic container
|
|
412
|
+
|
|
413
|
+
##### Description
|
|
414
|
+
|
|
415
|
+
Demonstrates creating a simple container with padding, base background, border, and rounded corners to group and highlight product information.
|
|
416
|
+
|
|
417
|
+
##### jsx
|
|
418
|
+
|
|
419
|
+
```jsx
|
|
420
|
+
<s-box
|
|
421
|
+
padding="base"
|
|
422
|
+
background="base"
|
|
423
|
+
borderWidth="base"
|
|
424
|
+
borderColor="base"
|
|
425
|
+
borderRadius="base"
|
|
426
|
+
>
|
|
427
|
+
<s-paragraph>Product information</s-paragraph>
|
|
428
|
+
</s-box>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
##### html
|
|
432
|
+
|
|
433
|
+
```html
|
|
434
|
+
<s-box
|
|
435
|
+
padding="base"
|
|
436
|
+
background="base"
|
|
437
|
+
borderWidth="base"
|
|
438
|
+
borderColor="base"
|
|
439
|
+
borderRadius="base"
|
|
440
|
+
>
|
|
441
|
+
<s-paragraph>Product information</s-paragraph>
|
|
442
|
+
</s-box>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
* #### Responsive shipping notice
|
|
446
|
+
|
|
447
|
+
##### Description
|
|
448
|
+
|
|
449
|
+
Illustrates using a box with responsive padding to create an adaptable container for shipping information that can adjust to different screen or container sizes.
|
|
450
|
+
|
|
451
|
+
##### jsx
|
|
452
|
+
|
|
453
|
+
```jsx
|
|
454
|
+
<s-query-container>
|
|
455
|
+
<s-box
|
|
456
|
+
padding="@container (inline-size > 400px) base, large-200"
|
|
457
|
+
background="base"
|
|
458
|
+
borderWidth="base"
|
|
459
|
+
borderColor="base"
|
|
460
|
+
>
|
|
461
|
+
<s-text>Your order will be processed within 2-3 business days</s-text>
|
|
462
|
+
</s-box>
|
|
463
|
+
</s-query-container>
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
##### html
|
|
467
|
+
|
|
468
|
+
```html
|
|
469
|
+
<s-query-container>
|
|
470
|
+
<s-box
|
|
471
|
+
padding="@container (inline-size > 400px) base, large-200"
|
|
472
|
+
background="base"
|
|
473
|
+
borderWidth="base"
|
|
474
|
+
borderColor="base"
|
|
475
|
+
>
|
|
476
|
+
<s-paragraph>Your order will be processed within 2-3 business days</s-paragraph>
|
|
477
|
+
</s-box>
|
|
478
|
+
</s-query-container>
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
* #### Accessible status messages
|
|
482
|
+
|
|
483
|
+
##### Description
|
|
484
|
+
|
|
485
|
+
Shows how to use boxes with ARIA roles and visibility controls to create semantic, screen-reader-friendly status and informational messages.
|
|
486
|
+
|
|
487
|
+
##### jsx
|
|
488
|
+
|
|
489
|
+
```jsx
|
|
490
|
+
<s-stack gap="base">
|
|
491
|
+
<s-box
|
|
492
|
+
accessibilityRole="status"
|
|
493
|
+
padding="base"
|
|
494
|
+
background="strong"
|
|
495
|
+
borderRadius="base"
|
|
496
|
+
>
|
|
497
|
+
<s-paragraph>Payment failed</s-paragraph>
|
|
498
|
+
</s-box>
|
|
499
|
+
|
|
500
|
+
<s-box accessibilityVisibility="exclusive">
|
|
501
|
+
<s-paragraph>Price includes tax and shipping</s-paragraph>
|
|
502
|
+
</s-box>
|
|
503
|
+
</s-stack>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
##### html
|
|
507
|
+
|
|
508
|
+
```html
|
|
509
|
+
<s-stack gap="base">
|
|
510
|
+
<s-box
|
|
511
|
+
accessibilityRole="status"
|
|
512
|
+
padding="base"
|
|
513
|
+
background="strong"
|
|
514
|
+
borderRadius="base"
|
|
515
|
+
>
|
|
516
|
+
<s-paragraph>Payment failed</s-paragraph>
|
|
517
|
+
</s-box>
|
|
518
|
+
|
|
519
|
+
<s-box accessibilityVisibility="exclusive">
|
|
520
|
+
<s-paragraph>Price includes tax and shipping</s-paragraph>
|
|
521
|
+
</s-box>
|
|
522
|
+
</s-stack>
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
* #### Nested hierarchical containers
|
|
526
|
+
|
|
527
|
+
##### Description
|
|
528
|
+
|
|
529
|
+
Demonstrates creating nested, hierarchical layouts using multiple boxes, showing how boxes can be combined to organize related content sections with different styling.
|
|
530
|
+
|
|
531
|
+
##### jsx
|
|
532
|
+
|
|
533
|
+
```jsx
|
|
534
|
+
<s-stack gap="base">
|
|
535
|
+
{/* Inventory status section */}
|
|
536
|
+
<s-box
|
|
537
|
+
padding="base"
|
|
538
|
+
background="base"
|
|
539
|
+
borderRadius="base"
|
|
540
|
+
borderWidth="base"
|
|
541
|
+
borderColor="base"
|
|
542
|
+
>
|
|
543
|
+
<s-stack gap="base">
|
|
544
|
+
<s-box padding="small-100" background="subdued" borderRadius="small">
|
|
545
|
+
<s-paragraph>In stock: 45 units</s-paragraph>
|
|
546
|
+
</s-box>
|
|
547
|
+
<s-box padding="small-100" background="subdued" borderRadius="small">
|
|
548
|
+
<s-paragraph>Low stock alert: 5 units</s-paragraph>
|
|
549
|
+
</s-box>
|
|
550
|
+
</s-stack>
|
|
551
|
+
</s-box>
|
|
552
|
+
|
|
553
|
+
{/* Product information section */}
|
|
554
|
+
<s-box
|
|
555
|
+
padding="base"
|
|
556
|
+
background="base"
|
|
557
|
+
borderRadius="base"
|
|
558
|
+
borderWidth="base"
|
|
559
|
+
borderColor="base"
|
|
560
|
+
>
|
|
561
|
+
<s-stack gap="base">
|
|
562
|
+
<s-heading>Product sales</s-heading>
|
|
563
|
+
<s-paragraph color="subdued">No recent sales of this product</s-paragraph>
|
|
564
|
+
<s-link>View details</s-link>
|
|
565
|
+
</s-stack>
|
|
566
|
+
</s-box>
|
|
567
|
+
</s-stack>
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
##### html
|
|
571
|
+
|
|
572
|
+
```html
|
|
573
|
+
<s-stack gap="base">
|
|
574
|
+
<!-- Inventory status section -->
|
|
575
|
+
<s-box
|
|
576
|
+
padding="base"
|
|
577
|
+
background="base"
|
|
578
|
+
borderRadius="base"
|
|
579
|
+
borderWidth="base"
|
|
580
|
+
borderColor="base"
|
|
581
|
+
>
|
|
582
|
+
<s-stack gap="base">
|
|
583
|
+
<s-box padding="small-100" background="subdued" borderRadius="small">
|
|
584
|
+
<s-paragraph>In stock: 45 units</s-paragraph>
|
|
585
|
+
</s-box>
|
|
586
|
+
<s-box padding="small-100" background="subdued" borderRadius="small">
|
|
587
|
+
<s-paragraph>Low stock alert: 5 units</s-paragraph>
|
|
588
|
+
</s-box>
|
|
589
|
+
</s-stack>
|
|
590
|
+
</s-box>
|
|
591
|
+
|
|
592
|
+
<!-- Product information section -->
|
|
593
|
+
<s-box
|
|
594
|
+
padding="base"
|
|
595
|
+
background="base"
|
|
596
|
+
borderRadius="base"
|
|
597
|
+
borderWidth="base"
|
|
598
|
+
borderColor="base"
|
|
599
|
+
>
|
|
600
|
+
<s-stack gap="base">
|
|
601
|
+
<s-heading>Product sales</s-heading>
|
|
602
|
+
<s-paragraph color="subdued">No recent sales of this product</s-paragraph>
|
|
603
|
+
<s-link>View details</s-link>
|
|
604
|
+
</s-stack>
|
|
605
|
+
</s-box>
|
|
606
|
+
</s-stack>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
## Useful for
|
|
610
|
+
|
|
611
|
+
* Creating custom designs when you can't build what you need with the existing components.
|
|
612
|
+
* Setting up specific stylings such as background colors, paddings, and borders.
|
|
613
|
+
* Nesting with other components.
|
|
614
|
+
|
|
615
|
+
## Best practices
|
|
616
|
+
|
|
617
|
+
* Use for structural layouts with consistent spacing patterns
|
|
618
|
+
* Avoid adding too many borders that may visually fragment the interface
|