You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/components/content/Item/Item.docs.mdx
+44-12Lines changed: 44 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,12 +25,6 @@ A foundational component that provides a standardized layout and styling for ite
25
25
26
26
<Controlsof={ItemStories.Default} />
27
27
28
-
### Content Properties
29
-
30
-
#### actions
31
-
-**Type**: `ReactNode`
32
-
-**Description**: Inline action buttons displayed on the right side of the item. Use `Item.Action` for consistent styling. Actions automatically inherit the parent's `type` prop and the component reserves space to prevent content overlap.
33
-
34
28
### Base Properties
35
29
36
30
Supports [Base properties](/BaseProperties)
@@ -48,26 +42,39 @@ Customizes the root element of the component.
48
42
-`Description` - The secondary text below or inline with the main content
49
43
-`Prefix` - Additional content displayed before the main content
50
44
-`Suffix` - Additional content displayed after the main content
45
+
-`Actions` - Container for inline action buttons displayed on the right side
51
46
52
47
### Style Properties
53
48
54
-
Direct style application without using the `styles` prop: `width`, `height`, `padding`, `margin`, `color`, `fill`, `opacity`, `display`, `position`, `zIndex`, `gap`, `flow`, `placeItems`, `placeContent`, `alignItems`, `justifyContent`, `border`, `radius`, `shadow`, `overflow`.
The `mods` property accepts the following modifiers:
59
54
60
55
| Modifier | Type | Description |
61
56
|----------|------|-------------|
57
+
| has-icon |`boolean`| Applied when icon prop is provided |
58
+
| has-right-icon |`boolean`| Applied when rightIcon prop is provided |
59
+
| has-prefix |`boolean`| Applied when prefix prop is provided |
60
+
| has-suffix |`boolean`| Applied when suffix prop is provided |
61
+
| has-label |`boolean`| Applied when children or labelProps are provided |
62
+
| has-start-content |`boolean`| Applied when icon or prefix is present |
63
+
| has-end-content |`boolean`| Applied when rightIcon, suffix, or actions are present |
64
+
| has-description |`boolean`| Applied when description is provided |
62
65
| has-description-block |`boolean`| Applied when description placement is "block" |
66
+
| has-actions |`boolean`| Applied when actions prop is provided |
63
67
| has-actions-content |`boolean`| Applied when actions have actual content (not just placeholder) |
64
68
| checkbox |`boolean`| Applied when using checkbox icon (icon="checkbox") |
65
69
| selected |`boolean`| Applied when isSelected is true |
66
-
| shape-card |`boolean`| Applied when shape is "card" |
67
-
| shape-button |`boolean`| Applied when shape is "button" |
68
-
| shape-sharp |`boolean`| Applied when shape is "sharp" |
69
-
70
-
**Note:** Element presence (Icon, RightIcon, Prefix, Suffix, Description, Actions) is now automatically detected via CSS `:has()` selectors and doesn't require manual modifiers.
70
+
| disabled |`boolean`| Applied when isDisabled is true or when loading |
71
+
| loading |`boolean`| Applied when isLoading is true |
72
+
| card |`boolean`| Applied when isCard is true |
73
+
| button |`boolean`| Applied when isButton is true |
74
+
| size |`string`| Applied based on size prop value (xsmall, small, medium, large, xlarge, inline) |
75
+
| type |`string`| Applied based on type prop value (item, primary, secondary, outline, neutral, clear, link) |
76
+
| theme |`string`| Applied based on theme prop value (default, danger, success, special) |
77
+
| shape |`string`| Applied based on shape prop value (card, button, sharp) |
71
78
72
79
## Variants
73
80
@@ -155,6 +162,31 @@ The `mods` property accepts the following modifiers:
155
162
156
163
<Storyof={ItemStories.DifferentShapes} />
157
164
165
+
### With Loading State
166
+
167
+
The `isLoading` prop displays a loading indicator and disables the item. The `loadingSlot` prop controls which slot the loading icon replaces:
168
+
169
+
```jsx
170
+
<Item
171
+
icon={<IconSave />}
172
+
isLoading={true}
173
+
loadingSlot="icon"
174
+
>
175
+
Saving...
176
+
</Item>
177
+
178
+
<Item
179
+
icon={<IconFile />}
180
+
rightIcon={<IconDownload />}
181
+
isLoading={true}
182
+
loadingSlot="rightIcon"
183
+
>
184
+
Downloading...
185
+
</Item>
186
+
```
187
+
188
+
When `loadingSlot="auto"` (default), the loading icon intelligently selects the best slot: prefers `icon` if present, then `rightIcon`, or falls back to `icon`.
189
+
158
190
### With Actions
159
191
160
192
Item supports inline actions that appear on the right side. Use the `Item.Action` compound component for consistent styling:
0 commit comments