@neynar/ui 1.0.1 → 1.0.3
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/context7.json +17 -0
- package/llm/components/accordion.llm.md +205 -0
- package/llm/components/alert-dialog.llm.md +289 -0
- package/llm/components/alert.llm.md +310 -0
- package/llm/components/aspect-ratio.llm.md +110 -0
- package/llm/components/avatar.llm.md +282 -0
- package/llm/components/badge.llm.md +185 -0
- package/llm/components/blockquote.llm.md +86 -0
- package/llm/components/breadcrumb.llm.md +245 -0
- package/llm/components/button-group.llm.md +248 -0
- package/llm/components/button.llm.md +247 -0
- package/llm/components/calendar.llm.md +252 -0
- package/llm/components/card.llm.md +356 -0
- package/llm/components/carousel.llm.md +281 -0
- package/llm/components/chart.llm.md +278 -0
- package/llm/components/checkbox.llm.md +234 -0
- package/llm/components/code.llm.md +75 -0
- package/llm/components/collapsible.llm.md +271 -0
- package/llm/components/color-mode.llm.md +196 -0
- package/llm/components/combobox.llm.md +346 -0
- package/llm/components/command.llm.md +353 -0
- package/llm/components/context-menu.llm.md +368 -0
- package/llm/components/dialog.llm.md +283 -0
- package/llm/components/drawer.llm.md +326 -0
- package/llm/components/dropdown-menu.llm.md +404 -0
- package/llm/components/empty.llm.md +282 -0
- package/llm/components/field.llm.md +303 -0
- package/llm/components/first-light.llm.md +129 -0
- package/llm/components/hover-card.llm.md +278 -0
- package/llm/components/input-group.llm.md +334 -0
- package/llm/components/input-otp.llm.md +270 -0
- package/llm/components/input.llm.md +197 -0
- package/llm/components/item.llm.md +347 -0
- package/llm/components/kbd.llm.md +221 -0
- package/llm/components/label.llm.md +219 -0
- package/llm/components/menubar.llm.md +378 -0
- package/llm/components/navigation-menu.llm.md +320 -0
- package/llm/components/pagination.llm.md +337 -0
- package/llm/components/popover.llm.md +278 -0
- package/llm/components/progress.llm.md +259 -0
- package/llm/components/radio-group.llm.md +269 -0
- package/llm/components/resizable.llm.md +222 -0
- package/llm/components/scroll-area.llm.md +290 -0
- package/llm/components/select.llm.md +338 -0
- package/llm/components/separator.llm.md +129 -0
- package/llm/components/sheet.llm.md +275 -0
- package/llm/components/sidebar.llm.md +528 -0
- package/llm/components/skeleton.llm.md +140 -0
- package/llm/components/slider.llm.md +213 -0
- package/llm/components/sonner.llm.md +299 -0
- package/llm/components/spinner.llm.md +187 -0
- package/llm/components/switch.llm.md +258 -0
- package/llm/components/table.llm.md +334 -0
- package/llm/components/tabs.llm.md +245 -0
- package/llm/components/text.llm.md +108 -0
- package/llm/components/textarea.llm.md +236 -0
- package/llm/components/title.llm.md +88 -0
- package/llm/components/toggle-group.llm.md +228 -0
- package/llm/components/toggle.llm.md +235 -0
- package/llm/components/tooltip.llm.md +191 -0
- package/llm/contributing.llm.md +273 -0
- package/llm/hooks.llm.md +91 -0
- package/llm/index.llm.md +178 -0
- package/llm/theming.llm.md +381 -0
- package/llm/utilities.llm.md +97 -0
- package/llms-full.txt +15995 -0
- package/llms.txt +182 -0
- package/package.json +5 -1
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
Dropdown component for selecting a single value from a list of options with grouping, icons, and keyboard navigation.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import {
|
|
9
|
+
Select,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectGroup,
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectLabel,
|
|
14
|
+
SelectSeparator,
|
|
15
|
+
SelectTrigger,
|
|
16
|
+
SelectValue,
|
|
17
|
+
} from "@neynar/ui/select"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Anatomy
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Select>
|
|
24
|
+
<SelectTrigger>
|
|
25
|
+
<SelectValue />
|
|
26
|
+
</SelectTrigger>
|
|
27
|
+
<SelectContent>
|
|
28
|
+
<SelectGroup>
|
|
29
|
+
<SelectLabel>Group Label</SelectLabel>
|
|
30
|
+
<SelectItem value="1">Option 1</SelectItem>
|
|
31
|
+
<SelectItem value="2">Option 2</SelectItem>
|
|
32
|
+
</SelectGroup>
|
|
33
|
+
<SelectSeparator />
|
|
34
|
+
<SelectGroup>
|
|
35
|
+
<SelectLabel>Another Group</SelectLabel>
|
|
36
|
+
<SelectItem value="3">Option 3</SelectItem>
|
|
37
|
+
</SelectGroup>
|
|
38
|
+
</SelectContent>
|
|
39
|
+
</Select>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Components
|
|
43
|
+
|
|
44
|
+
| Component | Description |
|
|
45
|
+
|-----------|-------------|
|
|
46
|
+
| Select | Root container, manages selection state and keyboard navigation |
|
|
47
|
+
| SelectTrigger | Button that opens the dropdown, includes chevron icon automatically |
|
|
48
|
+
| SelectValue | Displays the selected item's value or placeholder |
|
|
49
|
+
| SelectContent | Dropdown popup with automatic portal, positioning, and scroll buttons |
|
|
50
|
+
| SelectGroup | Groups related items under a label |
|
|
51
|
+
| SelectLabel | Non-selectable label for a group |
|
|
52
|
+
| SelectItem | Individual selectable option with automatic check indicator |
|
|
53
|
+
| SelectSeparator | Visual divider between groups |
|
|
54
|
+
| SelectScrollUpButton | Scroll indicator at top (automatic) |
|
|
55
|
+
| SelectScrollDownButton | Scroll indicator at bottom (automatic) |
|
|
56
|
+
|
|
57
|
+
## Props
|
|
58
|
+
|
|
59
|
+
### Select
|
|
60
|
+
|
|
61
|
+
| Prop | Type | Default | Description |
|
|
62
|
+
|------|------|---------|-------------|
|
|
63
|
+
| value | string | - | Controlled selected value |
|
|
64
|
+
| defaultValue | string | - | Uncontrolled default value |
|
|
65
|
+
| onValueChange | (value: string \| null) => void | - | Called when selection changes |
|
|
66
|
+
| disabled | boolean | false | Disables the entire select |
|
|
67
|
+
| name | string | - | Name attribute for form submission |
|
|
68
|
+
|
|
69
|
+
### SelectTrigger
|
|
70
|
+
|
|
71
|
+
Button that opens the dropdown. Automatically includes chevron icon.
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Default | Description |
|
|
74
|
+
|------|------|---------|-------------|
|
|
75
|
+
| size | "sm" \| "default" | "default" | Trigger button size |
|
|
76
|
+
| className | string | - | Additional CSS classes |
|
|
77
|
+
|
|
78
|
+
### SelectValue
|
|
79
|
+
|
|
80
|
+
Displays the selected value or placeholder. Automatically shows selected item text.
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Default | Description |
|
|
83
|
+
|------|------|---------|-------------|
|
|
84
|
+
| placeholder | string | - | Text shown when no value selected |
|
|
85
|
+
| className | string | - | Additional CSS classes |
|
|
86
|
+
|
|
87
|
+
### SelectContent
|
|
88
|
+
|
|
89
|
+
Automatically renders in a portal with backdrop overlay, positioning, and scroll indicators.
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Default | Description |
|
|
92
|
+
|------|------|---------|-------------|
|
|
93
|
+
| side | "top" \| "right" \| "bottom" \| "left" | "bottom" | Preferred side to position relative to trigger |
|
|
94
|
+
| sideOffset | number | 4 | Distance from trigger in pixels |
|
|
95
|
+
| align | "start" \| "center" \| "end" | "center" | Alignment relative to trigger |
|
|
96
|
+
| alignOffset | number | 0 | Offset from aligned position |
|
|
97
|
+
| alignItemWithTrigger | boolean | true | Whether to align selected item with trigger |
|
|
98
|
+
| className | string | - | Additional CSS classes |
|
|
99
|
+
|
|
100
|
+
### SelectItem
|
|
101
|
+
|
|
102
|
+
Individual option. Automatically shows check icon when selected.
|
|
103
|
+
|
|
104
|
+
| Prop | Type | Default | Description |
|
|
105
|
+
|------|------|---------|-------------|
|
|
106
|
+
| value | string | - | **Required.** Unique value for this option |
|
|
107
|
+
| disabled | boolean | false | Disables this specific item |
|
|
108
|
+
| label | string | - | Label for keyboard text navigation (defaults to text content) |
|
|
109
|
+
| className | string | - | Additional CSS classes |
|
|
110
|
+
|
|
111
|
+
### SelectGroup
|
|
112
|
+
|
|
113
|
+
| Prop | Type | Default | Description |
|
|
114
|
+
|------|------|---------|-------------|
|
|
115
|
+
| className | string | - | Additional CSS classes |
|
|
116
|
+
|
|
117
|
+
### SelectLabel
|
|
118
|
+
|
|
119
|
+
| Prop | Type | Default | Description |
|
|
120
|
+
|------|------|---------|-------------|
|
|
121
|
+
| className | string | - | Additional CSS classes |
|
|
122
|
+
|
|
123
|
+
### SelectSeparator
|
|
124
|
+
|
|
125
|
+
| Prop | Type | Default | Description |
|
|
126
|
+
|------|------|---------|-------------|
|
|
127
|
+
| className | string | - | Additional CSS classes |
|
|
128
|
+
|
|
129
|
+
## Data Attributes (for styling)
|
|
130
|
+
|
|
131
|
+
### SelectTrigger
|
|
132
|
+
|
|
133
|
+
| Attribute | When Present |
|
|
134
|
+
|-----------|--------------|
|
|
135
|
+
| data-size | Always present with value "sm" or "default" |
|
|
136
|
+
| data-placeholder | No value selected |
|
|
137
|
+
| aria-invalid | Invalid state (for forms) |
|
|
138
|
+
|
|
139
|
+
### SelectItem
|
|
140
|
+
|
|
141
|
+
| Attribute | When Present |
|
|
142
|
+
|-----------|--------------|
|
|
143
|
+
| data-selected | Item is currently selected |
|
|
144
|
+
| data-highlighted | Item is keyboard-highlighted |
|
|
145
|
+
| data-disabled | Item is disabled |
|
|
146
|
+
|
|
147
|
+
### SelectContent
|
|
148
|
+
|
|
149
|
+
| Attribute | When Present |
|
|
150
|
+
|-----------|--------------|
|
|
151
|
+
| data-open | Popup is open |
|
|
152
|
+
| data-closed | Popup is closed |
|
|
153
|
+
| data-side | Position side (top/right/bottom/left) |
|
|
154
|
+
|
|
155
|
+
## Examples
|
|
156
|
+
|
|
157
|
+
### Basic Select
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
<Select defaultValue="option2">
|
|
161
|
+
<SelectTrigger className="w-[200px]">
|
|
162
|
+
<SelectValue />
|
|
163
|
+
</SelectTrigger>
|
|
164
|
+
<SelectContent>
|
|
165
|
+
<SelectItem value="option1">Option 1</SelectItem>
|
|
166
|
+
<SelectItem value="option2">Option 2</SelectItem>
|
|
167
|
+
<SelectItem value="option3">Option 3</SelectItem>
|
|
168
|
+
</SelectContent>
|
|
169
|
+
</Select>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Controlled with State
|
|
173
|
+
|
|
174
|
+
```tsx
|
|
175
|
+
const [region, setRegion] = useState("us-east-1")
|
|
176
|
+
|
|
177
|
+
<Select value={region} onValueChange={(v) => v && setRegion(v)}>
|
|
178
|
+
<SelectTrigger className="w-full">
|
|
179
|
+
<SelectValue />
|
|
180
|
+
</SelectTrigger>
|
|
181
|
+
<SelectContent>
|
|
182
|
+
<SelectItem value="us-east-1">US East (N. Virginia)</SelectItem>
|
|
183
|
+
<SelectItem value="us-west-2">US West (Oregon)</SelectItem>
|
|
184
|
+
<SelectItem value="eu-west-1">EU (Ireland)</SelectItem>
|
|
185
|
+
</SelectContent>
|
|
186
|
+
</Select>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### With Icons
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
<Select defaultValue="admin">
|
|
193
|
+
<SelectTrigger className="w-[280px]">
|
|
194
|
+
<SelectValue />
|
|
195
|
+
</SelectTrigger>
|
|
196
|
+
<SelectContent>
|
|
197
|
+
<SelectItem value="admin">
|
|
198
|
+
<SettingsIcon data-icon="inline-start" />
|
|
199
|
+
Administrator
|
|
200
|
+
</SelectItem>
|
|
201
|
+
<SelectItem value="user">
|
|
202
|
+
<UserIcon data-icon="inline-start" />
|
|
203
|
+
Regular User
|
|
204
|
+
</SelectItem>
|
|
205
|
+
</SelectContent>
|
|
206
|
+
</Select>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Grouped Options
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
<Select defaultValue="react">
|
|
213
|
+
<SelectTrigger className="w-[280px]">
|
|
214
|
+
<SelectValue />
|
|
215
|
+
</SelectTrigger>
|
|
216
|
+
<SelectContent>
|
|
217
|
+
<SelectGroup>
|
|
218
|
+
<SelectLabel>Frontend</SelectLabel>
|
|
219
|
+
<SelectItem value="react">React</SelectItem>
|
|
220
|
+
<SelectItem value="vue">Vue</SelectItem>
|
|
221
|
+
</SelectGroup>
|
|
222
|
+
<SelectSeparator />
|
|
223
|
+
<SelectGroup>
|
|
224
|
+
<SelectLabel>Backend</SelectLabel>
|
|
225
|
+
<SelectItem value="node">Node.js</SelectItem>
|
|
226
|
+
<SelectItem value="python">Python</SelectItem>
|
|
227
|
+
</SelectGroup>
|
|
228
|
+
</SelectContent>
|
|
229
|
+
</Select>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Form Integration
|
|
233
|
+
|
|
234
|
+
```tsx
|
|
235
|
+
<div className="space-y-2">
|
|
236
|
+
<label htmlFor="country" className="text-sm font-medium">
|
|
237
|
+
Country
|
|
238
|
+
</label>
|
|
239
|
+
<Select defaultValue="us">
|
|
240
|
+
<SelectTrigger id="country">
|
|
241
|
+
<SelectValue />
|
|
242
|
+
</SelectTrigger>
|
|
243
|
+
<SelectContent>
|
|
244
|
+
<SelectItem value="us">United States</SelectItem>
|
|
245
|
+
<SelectItem value="uk">United Kingdom</SelectItem>
|
|
246
|
+
<SelectItem value="ca">Canada</SelectItem>
|
|
247
|
+
</SelectContent>
|
|
248
|
+
</Select>
|
|
249
|
+
<p className="text-muted-foreground text-xs">
|
|
250
|
+
Select your country of residence.
|
|
251
|
+
</p>
|
|
252
|
+
</div>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Small Size
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
<Select defaultValue="sm">
|
|
259
|
+
<SelectTrigger size="sm" className="w-[180px]">
|
|
260
|
+
<SelectValue />
|
|
261
|
+
</SelectTrigger>
|
|
262
|
+
<SelectContent>
|
|
263
|
+
<SelectItem value="sm">Small option</SelectItem>
|
|
264
|
+
<SelectItem value="sm2">Another small</SelectItem>
|
|
265
|
+
</SelectContent>
|
|
266
|
+
</Select>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Disabled States
|
|
270
|
+
|
|
271
|
+
```tsx
|
|
272
|
+
// Disabled select
|
|
273
|
+
<Select defaultValue="option1" disabled>
|
|
274
|
+
<SelectTrigger className="w-[200px]">
|
|
275
|
+
<SelectValue />
|
|
276
|
+
</SelectTrigger>
|
|
277
|
+
<SelectContent>
|
|
278
|
+
<SelectItem value="option1">Option 1</SelectItem>
|
|
279
|
+
</SelectContent>
|
|
280
|
+
</Select>
|
|
281
|
+
|
|
282
|
+
// Disabled items
|
|
283
|
+
<Select defaultValue="available">
|
|
284
|
+
<SelectTrigger className="w-[200px]">
|
|
285
|
+
<SelectValue />
|
|
286
|
+
</SelectTrigger>
|
|
287
|
+
<SelectContent>
|
|
288
|
+
<SelectItem value="available">Available</SelectItem>
|
|
289
|
+
<SelectItem value="unavailable" disabled>
|
|
290
|
+
Unavailable
|
|
291
|
+
</SelectItem>
|
|
292
|
+
</SelectContent>
|
|
293
|
+
</Select>
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Placeholder
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
<Select>
|
|
300
|
+
<SelectTrigger className="w-[280px]">
|
|
301
|
+
<SelectValue placeholder="Select a fruit" />
|
|
302
|
+
</SelectTrigger>
|
|
303
|
+
<SelectContent>
|
|
304
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
305
|
+
<SelectItem value="banana">Banana</SelectItem>
|
|
306
|
+
</SelectContent>
|
|
307
|
+
</Select>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## Keyboard
|
|
311
|
+
|
|
312
|
+
| Key | Action |
|
|
313
|
+
|-----|--------|
|
|
314
|
+
| Space / Enter | Open dropdown (when closed) |
|
|
315
|
+
| Space / Enter | Select highlighted item (when open) |
|
|
316
|
+
| Escape | Close dropdown |
|
|
317
|
+
| ArrowDown | Highlight next item |
|
|
318
|
+
| ArrowUp | Highlight previous item |
|
|
319
|
+
| Home | Highlight first item |
|
|
320
|
+
| End | Highlight last item |
|
|
321
|
+
| Type characters | Jump to item starting with typed text |
|
|
322
|
+
| Tab | Close and move to next focusable element |
|
|
323
|
+
|
|
324
|
+
## Accessibility
|
|
325
|
+
|
|
326
|
+
- Uses `role="combobox"` on trigger with proper ARIA attributes
|
|
327
|
+
- Implements `aria-expanded`, `aria-controls`, and `aria-activedescendant`
|
|
328
|
+
- Selected items marked with `aria-selected="true"`
|
|
329
|
+
- Disabled items use `aria-disabled="true"`
|
|
330
|
+
- Keyboard navigation follows ARIA combobox pattern
|
|
331
|
+
- Focus management returns to trigger on close
|
|
332
|
+
- Screen readers announce selection changes
|
|
333
|
+
|
|
334
|
+
## Related
|
|
335
|
+
|
|
336
|
+
- [Combobox](/components/combobox) - Searchable select with filtering
|
|
337
|
+
- [Radio Group](/components/radio-group) - Single selection from visible options
|
|
338
|
+
- [Command](/components/command) - Command palette with search
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Separator
|
|
2
|
+
|
|
3
|
+
Visual divider for separating content sections with support for horizontal and vertical orientations.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Separator } from "@neynar/ui/separator"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Anatomy
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Separator />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
|
|
19
|
+
### Separator
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
|------|------|---------|-------------|
|
|
23
|
+
| orientation | "horizontal" \| "vertical" | "horizontal" | Direction of the separator |
|
|
24
|
+
| className | string | - | Additional CSS classes |
|
|
25
|
+
| render | ReactElement \| function | - | Custom render function or element |
|
|
26
|
+
|
|
27
|
+
All Base UI Separator props are supported via SeparatorProps type.
|
|
28
|
+
|
|
29
|
+
## Data Attributes
|
|
30
|
+
|
|
31
|
+
| Attribute | When Present |
|
|
32
|
+
|-----------|--------------|
|
|
33
|
+
| data-slot | Always set to "separator" |
|
|
34
|
+
| data-orientation | Set to "horizontal" or "vertical" |
|
|
35
|
+
|
|
36
|
+
## Styling
|
|
37
|
+
|
|
38
|
+
The Separator uses data attributes for responsive sizing:
|
|
39
|
+
|
|
40
|
+
- **Horizontal**: `data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full`
|
|
41
|
+
- **Vertical**: `data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch`
|
|
42
|
+
|
|
43
|
+
For vertical separators, you typically need to set an explicit height:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<Separator orientation="vertical" className="h-6" />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### Basic Horizontal Separator
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<div className="space-y-4">
|
|
55
|
+
<p>First section</p>
|
|
56
|
+
<Separator />
|
|
57
|
+
<p>Second section</p>
|
|
58
|
+
</div>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Vertical Separator in Toolbar
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<div className="flex items-center gap-3">
|
|
65
|
+
<Button>Bold</Button>
|
|
66
|
+
<Button>Italic</Button>
|
|
67
|
+
<Separator orientation="vertical" className="h-6" />
|
|
68
|
+
<Button>Link</Button>
|
|
69
|
+
<Button>Image</Button>
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### In List Items
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<div className="border rounded-lg space-y-0">
|
|
77
|
+
<div className="p-4">
|
|
78
|
+
<p className="font-medium">Dashboard</p>
|
|
79
|
+
</div>
|
|
80
|
+
<Separator />
|
|
81
|
+
<div className="p-4">
|
|
82
|
+
<p className="font-medium">API Keys</p>
|
|
83
|
+
</div>
|
|
84
|
+
<Separator />
|
|
85
|
+
<div className="p-4">
|
|
86
|
+
<p className="font-medium">Settings</p>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Inline Metadata with Vertical Separators
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<div className="flex items-center gap-2 text-sm">
|
|
95
|
+
<span>Status: 200 OK</span>
|
|
96
|
+
<Separator orientation="vertical" className="h-4" />
|
|
97
|
+
<span>Latency: 142ms</span>
|
|
98
|
+
<Separator orientation="vertical" className="h-4" />
|
|
99
|
+
<span>2 minutes ago</span>
|
|
100
|
+
</div>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Custom Spacing
|
|
104
|
+
|
|
105
|
+
Control spacing with margin utilities:
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<div>
|
|
109
|
+
<p>Tight spacing</p>
|
|
110
|
+
<Separator className="my-2" />
|
|
111
|
+
<p>Default spacing</p>
|
|
112
|
+
<Separator className="my-4" />
|
|
113
|
+
<p>Loose spacing</p>
|
|
114
|
+
<Separator className="my-6" />
|
|
115
|
+
</div>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Accessibility
|
|
119
|
+
|
|
120
|
+
- Renders as a `<div>` with proper ARIA role
|
|
121
|
+
- Accessible to screen readers
|
|
122
|
+
- Provides semantic separation between content sections
|
|
123
|
+
- Works with keyboard navigation (doesn't receive focus)
|
|
124
|
+
|
|
125
|
+
## Related
|
|
126
|
+
|
|
127
|
+
- [Card](./card.llm.md) - Often uses Separator to divide card sections
|
|
128
|
+
- [Dialog](./dialog.llm.md) - May use Separator between header/body/footer
|
|
129
|
+
- [Dropdown Menu](./dropdown-menu.llm.md) - Uses Separator to group menu items
|