@neynar/ui 1.0.1 → 1.0.2

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.
Files changed (68) hide show
  1. package/context7.json +17 -0
  2. package/llm/components/accordion.llm.md +205 -0
  3. package/llm/components/alert-dialog.llm.md +289 -0
  4. package/llm/components/alert.llm.md +310 -0
  5. package/llm/components/aspect-ratio.llm.md +110 -0
  6. package/llm/components/avatar.llm.md +282 -0
  7. package/llm/components/badge.llm.md +185 -0
  8. package/llm/components/blockquote.llm.md +86 -0
  9. package/llm/components/breadcrumb.llm.md +245 -0
  10. package/llm/components/button-group.llm.md +248 -0
  11. package/llm/components/button.llm.md +247 -0
  12. package/llm/components/calendar.llm.md +252 -0
  13. package/llm/components/card.llm.md +356 -0
  14. package/llm/components/carousel.llm.md +281 -0
  15. package/llm/components/chart.llm.md +278 -0
  16. package/llm/components/checkbox.llm.md +234 -0
  17. package/llm/components/code.llm.md +75 -0
  18. package/llm/components/collapsible.llm.md +271 -0
  19. package/llm/components/color-mode.llm.md +196 -0
  20. package/llm/components/combobox.llm.md +346 -0
  21. package/llm/components/command.llm.md +353 -0
  22. package/llm/components/context-menu.llm.md +368 -0
  23. package/llm/components/dialog.llm.md +283 -0
  24. package/llm/components/drawer.llm.md +326 -0
  25. package/llm/components/dropdown-menu.llm.md +404 -0
  26. package/llm/components/empty.llm.md +282 -0
  27. package/llm/components/field.llm.md +303 -0
  28. package/llm/components/first-light.llm.md +129 -0
  29. package/llm/components/hover-card.llm.md +278 -0
  30. package/llm/components/input-group.llm.md +334 -0
  31. package/llm/components/input-otp.llm.md +270 -0
  32. package/llm/components/input.llm.md +197 -0
  33. package/llm/components/item.llm.md +347 -0
  34. package/llm/components/kbd.llm.md +221 -0
  35. package/llm/components/label.llm.md +219 -0
  36. package/llm/components/menubar.llm.md +378 -0
  37. package/llm/components/navigation-menu.llm.md +320 -0
  38. package/llm/components/pagination.llm.md +337 -0
  39. package/llm/components/popover.llm.md +278 -0
  40. package/llm/components/progress.llm.md +259 -0
  41. package/llm/components/radio-group.llm.md +269 -0
  42. package/llm/components/resizable.llm.md +222 -0
  43. package/llm/components/scroll-area.llm.md +290 -0
  44. package/llm/components/select.llm.md +338 -0
  45. package/llm/components/separator.llm.md +129 -0
  46. package/llm/components/sheet.llm.md +275 -0
  47. package/llm/components/sidebar.llm.md +528 -0
  48. package/llm/components/skeleton.llm.md +140 -0
  49. package/llm/components/slider.llm.md +213 -0
  50. package/llm/components/sonner.llm.md +299 -0
  51. package/llm/components/spinner.llm.md +187 -0
  52. package/llm/components/switch.llm.md +258 -0
  53. package/llm/components/table.llm.md +334 -0
  54. package/llm/components/tabs.llm.md +245 -0
  55. package/llm/components/text.llm.md +108 -0
  56. package/llm/components/textarea.llm.md +236 -0
  57. package/llm/components/title.llm.md +88 -0
  58. package/llm/components/toggle-group.llm.md +228 -0
  59. package/llm/components/toggle.llm.md +235 -0
  60. package/llm/components/tooltip.llm.md +191 -0
  61. package/llm/contributing.llm.md +273 -0
  62. package/llm/hooks.llm.md +91 -0
  63. package/llm/index.llm.md +178 -0
  64. package/llm/theming.llm.md +381 -0
  65. package/llm/utilities.llm.md +97 -0
  66. package/llms-full.txt +15995 -0
  67. package/llms.txt +182 -0
  68. package/package.json +5 -1
@@ -0,0 +1,185 @@
1
+ # Badge
2
+
3
+ Small label for displaying metadata, status indicators, counts, and categorical information.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Badge } from "@neynar/ui/badge"
9
+ ```
10
+
11
+ ## Anatomy
12
+
13
+ ```tsx
14
+ <Badge variant="default">Label</Badge>
15
+ ```
16
+
17
+ ## Props
18
+
19
+ ### Badge
20
+
21
+ Extends all HTML span attributes plus:
22
+
23
+ | Prop | Type | Default | Description |
24
+ |------|------|---------|-------------|
25
+ | variant | "default" \| "secondary" \| "destructive" \| "success" \| "warning" \| "info" \| "outline" \| "ghost" \| "link" | "default" | Visual style variant |
26
+ | render | React.ReactElement \| ((state) => React.ReactElement) | - | Custom element to render as (e.g., `<a />`) |
27
+ | className | string | - | Additional CSS classes |
28
+
29
+ All standard HTML span attributes are supported (onClick, aria-*, data-*, etc.).
30
+
31
+ ### Special Props
32
+
33
+ **render prop** - Render Badge as a different element:
34
+
35
+ ```tsx
36
+ <Badge render={<a href="/docs" />}>Documentation</Badge>
37
+ ```
38
+
39
+ ## Variants
40
+
41
+ ### Visual Variants
42
+
43
+ | Variant | Use Case | Appearance |
44
+ |---------|----------|------------|
45
+ | default | Primary emphasis, featured items | Solid primary color background |
46
+ | secondary | Neutral status, less emphasis | Subtle secondary background |
47
+ | outline | Low emphasis, borders | Border with transparent background |
48
+ | ghost | Minimal, hover reveals | Transparent, hover shows background |
49
+ | link | Clickable, link-style | Underlined text style |
50
+
51
+ ### Semantic Variants
52
+
53
+ | Variant | Use Case | Appearance |
54
+ |---------|----------|------------|
55
+ | destructive | Errors, critical warnings | Red/destructive color with subtle background |
56
+ | success | Success states, confirmations | Green/success color with subtle background |
57
+ | warning | Warnings, alerts | Yellow/warning color with subtle background |
58
+ | info | Informational messages | Blue/info color with subtle background |
59
+
60
+ ## Examples
61
+
62
+ ### Basic Variants
63
+
64
+ ```tsx
65
+ <Badge>Default</Badge>
66
+ <Badge variant="secondary">Secondary</Badge>
67
+ <Badge variant="outline">Outline</Badge>
68
+ <Badge variant="destructive">Error</Badge>
69
+ ```
70
+
71
+ ### With Icons
72
+
73
+ Add `data-icon="inline-start"` or `data-icon="inline-end"` to icon elements for proper spacing:
74
+
75
+ ```tsx
76
+ import { StarIcon, FlameIcon } from "lucide-react"
77
+
78
+ <Badge>
79
+ <StarIcon data-icon="inline-start" />
80
+ Featured
81
+ </Badge>
82
+
83
+ <Badge variant="destructive">
84
+ <FlameIcon data-icon="inline-start" />
85
+ Hot
86
+ </Badge>
87
+ ```
88
+
89
+ ### Counter Badges
90
+
91
+ ```tsx
92
+ <Badge>3</Badge>
93
+ <Badge>12</Badge>
94
+ <Badge>99+</Badge>
95
+ <Badge variant="destructive">5</Badge>
96
+ ```
97
+
98
+ ### Status Indicators
99
+
100
+ Use colored dots for operational status:
101
+
102
+ ```tsx
103
+ <Badge variant="secondary">
104
+ <span className="bg-green-500 mr-1 size-2 rounded-full" />
105
+ Online
106
+ </Badge>
107
+
108
+ <Badge variant="secondary">
109
+ <span className="bg-yellow-500 mr-1 size-2 rounded-full" />
110
+ Degraded
111
+ </Badge>
112
+
113
+ <Badge variant="secondary">
114
+ <span className="bg-red-500 mr-1 size-2 rounded-full" />
115
+ Offline
116
+ </Badge>
117
+ ```
118
+
119
+ ### As Link
120
+
121
+ ```tsx
122
+ <Badge render={<a href="/pricing" />} variant="outline">
123
+ Upgrade to Pro
124
+ </Badge>
125
+ ```
126
+
127
+ ### Plan Tiers
128
+
129
+ ```tsx
130
+ import { CrownIcon, SparklesIcon } from "lucide-react"
131
+
132
+ <Badge variant="secondary">Free</Badge>
133
+ <Badge>
134
+ <SparklesIcon data-icon="inline-start" />
135
+ Popular
136
+ </Badge>
137
+ <Badge variant="outline">
138
+ <CrownIcon data-icon="inline-start" />
139
+ Enterprise
140
+ </Badge>
141
+ ```
142
+
143
+ ## Data Attributes
144
+
145
+ The Badge component sets these data attributes for styling:
146
+
147
+ | Attribute | Value |
148
+ |-----------|-------|
149
+ | data-slot | "badge" |
150
+ | data-icon | "inline-start" or "inline-end" (on icon elements) |
151
+
152
+ ## Styling
153
+
154
+ ### Icon Sizing
155
+
156
+ Icons inside Badge automatically get `size-3` (12px). Use `data-icon="inline-start"` or `data-icon="inline-end"` for proper padding:
157
+
158
+ ```tsx
159
+ // Automatic icon sizing and spacing
160
+ <Badge>
161
+ <StarIcon data-icon="inline-start" />
162
+ Text
163
+ </Badge>
164
+ ```
165
+
166
+ ### Custom Styling
167
+
168
+ ```tsx
169
+ <Badge className="text-lg px-4">
170
+ Large Badge
171
+ </Badge>
172
+ ```
173
+
174
+ ## Accessibility
175
+
176
+ - Badge uses semantic HTML `<span>` by default
177
+ - Can be rendered as `<a>` via render prop for clickable badges
178
+ - Supports all ARIA attributes for enhanced semantics
179
+ - No built-in focus management (use render prop with `<button>` or `<a>` for interactive badges)
180
+
181
+ ## Related
182
+
183
+ - **Button** - For clickable actions instead of labels
184
+ - **Avatar** - Can be combined with Badge for status indicators
185
+ - **Card** - Badges commonly used in card headers for categorization
@@ -0,0 +1,86 @@
1
+ # Blockquote
2
+
3
+ Quoted content with left border accent and italic styling.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Blockquote } from "@neynar/ui/typography"
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ <Blockquote>
15
+ The best way to predict the future is to invent it.
16
+ </Blockquote>
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | Prop | Type | Default | Description |
22
+ |------|------|---------|-------------|
23
+ | color | "default" \| "muted" \| "subtle" | "default" | Text color (limited to neutral colors) |
24
+ | className | string | - | Additional CSS classes |
25
+
26
+ ## Examples
27
+
28
+ ### Basic Quote
29
+
30
+ ```tsx
31
+ <Blockquote>
32
+ Design is not just what it looks like and feels like.
33
+ Design is how it works.
34
+ </Blockquote>
35
+ ```
36
+
37
+ ### With Attribution
38
+
39
+ ```tsx
40
+ <figure>
41
+ <Blockquote>
42
+ The only way to do great work is to love what you do.
43
+ </Blockquote>
44
+ <figcaption>
45
+ <Caption>— Steve Jobs</Caption>
46
+ </figcaption>
47
+ </figure>
48
+ ```
49
+
50
+ ### Muted Style
51
+
52
+ ```tsx
53
+ <Blockquote color="muted">
54
+ A subtle quote that doesn't demand attention.
55
+ </Blockquote>
56
+ ```
57
+
58
+ ### In Article Context
59
+
60
+ ```tsx
61
+ <article>
62
+ <Title order={2}>Key Insights</Title>
63
+ <Text>The author makes several important points:</Text>
64
+ <Blockquote>
65
+ Simplicity is the ultimate sophistication.
66
+ </Blockquote>
67
+ <Text>This philosophy guides the entire design system.</Text>
68
+ </article>
69
+ ```
70
+
71
+ ## Styling
72
+
73
+ Default styling:
74
+ - Left border accent (`border-l-4 border-border`)
75
+ - Left padding (`pl-4`)
76
+ - Italic text
77
+
78
+ ## Color Restriction
79
+
80
+ Colors are limited to `default`, `muted`, and `subtle` for semantic appropriateness. Blockquotes represent quoted content, not status messages.
81
+
82
+ ## Related
83
+
84
+ - [Text](./text.llm.md) - Paragraph text
85
+ - [Title](./title.llm.md) - Headings
86
+ - [Card](./card.llm.md) - For featured quotes
@@ -0,0 +1,245 @@
1
+ # Breadcrumb
2
+
3
+ Semantic navigation component displaying hierarchical page location with accessible breadcrumb trail.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ Breadcrumb,
10
+ BreadcrumbList,
11
+ BreadcrumbItem,
12
+ BreadcrumbLink,
13
+ BreadcrumbPage,
14
+ BreadcrumbSeparator,
15
+ BreadcrumbEllipsis,
16
+ } from "@neynar/ui/breadcrumb"
17
+ ```
18
+
19
+ ## Anatomy
20
+
21
+ ```tsx
22
+ <Breadcrumb>
23
+ <BreadcrumbList>
24
+ <BreadcrumbItem>
25
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
26
+ </BreadcrumbItem>
27
+ <BreadcrumbSeparator />
28
+ <BreadcrumbItem>
29
+ <BreadcrumbLink href="/dashboard">Dashboard</BreadcrumbLink>
30
+ </BreadcrumbItem>
31
+ <BreadcrumbSeparator />
32
+ <BreadcrumbItem>
33
+ <BreadcrumbPage>Settings</BreadcrumbPage>
34
+ </BreadcrumbItem>
35
+ </BreadcrumbList>
36
+ </Breadcrumb>
37
+ ```
38
+
39
+ ## Components
40
+
41
+ | Component | Description |
42
+ |-----------|-------------|
43
+ | Breadcrumb | Root `<nav>` container with `aria-label="breadcrumb"` |
44
+ | BreadcrumbList | Ordered list (`<ol>`) with responsive flex layout |
45
+ | BreadcrumbItem | List item (`<li>`) wrapper for links/pages |
46
+ | BreadcrumbLink | Interactive link (`<a>`) for navigable pages, supports custom `render` prop |
47
+ | BreadcrumbPage | Current page indicator (`<span>`) with `aria-current="page"` |
48
+ | BreadcrumbSeparator | Visual separator (`<li>`) between items, defaults to chevron icon |
49
+ | BreadcrumbEllipsis | Collapsed section indicator (`<span>`) for long paths |
50
+
51
+ ## Props
52
+
53
+ ### Breadcrumb
54
+
55
+ Standard `<nav>` HTML attributes. Automatically includes `aria-label="breadcrumb"`.
56
+
57
+ ### BreadcrumbList
58
+
59
+ Standard `<ol>` HTML attributes. Automatically styled with responsive spacing (1.5 gap on mobile, 2.5 on desktop).
60
+
61
+ ### BreadcrumbItem
62
+
63
+ Standard `<li>` HTML attributes. Styled as inline-flex container.
64
+
65
+ ### BreadcrumbLink
66
+
67
+ Extends standard `<a>` HTML attributes with Base UI's `render` prop support.
68
+
69
+ | Prop | Type | Default | Description |
70
+ |------|------|---------|-------------|
71
+ | render | ReactElement | - | Custom element to render as (e.g., Next.js Link) |
72
+ | href | string | - | Link destination |
73
+
74
+ **Using render prop:**
75
+ ```tsx
76
+ import { Link } from "next/link"
77
+
78
+ <BreadcrumbLink render={<Link href="/dashboard" />}>
79
+ Dashboard
80
+ </BreadcrumbLink>
81
+ ```
82
+
83
+ ### BreadcrumbPage
84
+
85
+ Standard `<span>` HTML attributes. Automatically includes `aria-current="page"` and `aria-disabled="true"`.
86
+
87
+ ### BreadcrumbSeparator
88
+
89
+ Standard `<li>` HTML attributes with custom separator support.
90
+
91
+ | Prop | Type | Default | Description |
92
+ |------|------|---------|-------------|
93
+ | children | ReactNode | ChevronRightIcon | Custom separator content (icon or text) |
94
+
95
+ ### BreadcrumbEllipsis
96
+
97
+ Standard `<span>` HTML attributes. Renders MoreHorizontalIcon with screen reader text "More".
98
+
99
+ ## Data Attributes
100
+
101
+ All components include `data-slot` attributes for styling:
102
+
103
+ | Component | Attribute |
104
+ |-----------|-----------|
105
+ | Breadcrumb | `data-slot="breadcrumb"` |
106
+ | BreadcrumbList | `data-slot="breadcrumb-list"` |
107
+ | BreadcrumbItem | `data-slot="breadcrumb-item"` |
108
+ | BreadcrumbLink | `data-slot="breadcrumb-link"` |
109
+ | BreadcrumbPage | `data-slot="breadcrumb-page"` |
110
+ | BreadcrumbSeparator | `data-slot="breadcrumb-separator"` |
111
+ | BreadcrumbEllipsis | `data-slot="breadcrumb-ellipsis"` |
112
+
113
+ ## Examples
114
+
115
+ ### Basic Navigation
116
+
117
+ ```tsx
118
+ <Breadcrumb>
119
+ <BreadcrumbList>
120
+ <BreadcrumbItem>
121
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
122
+ </BreadcrumbItem>
123
+ <BreadcrumbSeparator />
124
+ <BreadcrumbItem>
125
+ <BreadcrumbLink href="/dashboard">Dashboard</BreadcrumbLink>
126
+ </BreadcrumbItem>
127
+ <BreadcrumbSeparator />
128
+ <BreadcrumbItem>
129
+ <BreadcrumbPage>Settings</BreadcrumbPage>
130
+ </BreadcrumbItem>
131
+ </BreadcrumbList>
132
+ </Breadcrumb>
133
+ ```
134
+
135
+ ### With Icons
136
+
137
+ ```tsx
138
+ import { HomeIcon, SettingsIcon } from "lucide-react"
139
+
140
+ <Breadcrumb>
141
+ <BreadcrumbList>
142
+ <BreadcrumbItem>
143
+ <BreadcrumbLink href="/" aria-label="Home">
144
+ <HomeIcon className="size-4" />
145
+ </BreadcrumbLink>
146
+ </BreadcrumbItem>
147
+ <BreadcrumbSeparator />
148
+ <BreadcrumbItem>
149
+ <BreadcrumbPage>
150
+ <SettingsIcon className="mr-2 size-4" />
151
+ Settings
152
+ </BreadcrumbPage>
153
+ </BreadcrumbItem>
154
+ </BreadcrumbList>
155
+ </Breadcrumb>
156
+ ```
157
+
158
+ ### Custom Separator
159
+
160
+ ```tsx
161
+ import { SlashIcon } from "lucide-react"
162
+
163
+ <Breadcrumb>
164
+ <BreadcrumbList>
165
+ <BreadcrumbItem>
166
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
167
+ </BreadcrumbItem>
168
+ <BreadcrumbSeparator>
169
+ <SlashIcon />
170
+ </BreadcrumbSeparator>
171
+ <BreadcrumbItem>
172
+ <BreadcrumbPage>Dashboard</BreadcrumbPage>
173
+ </BreadcrumbItem>
174
+ </BreadcrumbList>
175
+ </Breadcrumb>
176
+ ```
177
+
178
+ ### Truncated Long Paths
179
+
180
+ ```tsx
181
+ <Breadcrumb>
182
+ <BreadcrumbList>
183
+ <BreadcrumbItem>
184
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
185
+ </BreadcrumbItem>
186
+ <BreadcrumbSeparator />
187
+ <BreadcrumbItem>
188
+ <BreadcrumbLink href="/dashboard">Dashboard</BreadcrumbLink>
189
+ </BreadcrumbItem>
190
+ <BreadcrumbSeparator />
191
+ <BreadcrumbItem>
192
+ <BreadcrumbEllipsis />
193
+ </BreadcrumbItem>
194
+ <BreadcrumbSeparator />
195
+ <BreadcrumbItem>
196
+ <BreadcrumbLink href="/settings">Settings</BreadcrumbLink>
197
+ </BreadcrumbItem>
198
+ <BreadcrumbSeparator />
199
+ <BreadcrumbItem>
200
+ <BreadcrumbPage>API Keys</BreadcrumbPage>
201
+ </BreadcrumbItem>
202
+ </BreadcrumbList>
203
+ </Breadcrumb>
204
+ ```
205
+
206
+ ### With Next.js Link
207
+
208
+ ```tsx
209
+ import { Link } from "next/link"
210
+
211
+ <Breadcrumb>
212
+ <BreadcrumbList>
213
+ <BreadcrumbItem>
214
+ <BreadcrumbLink render={<Link href="/" />}>
215
+ Home
216
+ </BreadcrumbLink>
217
+ </BreadcrumbItem>
218
+ <BreadcrumbSeparator />
219
+ <BreadcrumbItem>
220
+ <BreadcrumbLink render={<Link href="/dashboard" />}>
221
+ Dashboard
222
+ </BreadcrumbLink>
223
+ </BreadcrumbItem>
224
+ <BreadcrumbSeparator />
225
+ <BreadcrumbItem>
226
+ <BreadcrumbPage>Settings</BreadcrumbPage>
227
+ </BreadcrumbItem>
228
+ </BreadcrumbList>
229
+ </Breadcrumb>
230
+ ```
231
+
232
+ ## Accessibility
233
+
234
+ - Root component uses semantic `<nav>` with `aria-label="breadcrumb"`
235
+ - Uses ordered list (`<ol>`) for proper navigation structure
236
+ - Current page has `aria-current="page"` and `aria-disabled="true"`
237
+ - Separators marked with `role="presentation"` and `aria-hidden="true"`
238
+ - Ellipsis includes screen reader text "More"
239
+ - Links have hover state with color transition for visual feedback
240
+ - Automatically wraps on small screens for responsive behavior
241
+
242
+ ## Related
243
+
244
+ - [Link](/docs/components/link) - For custom link rendering
245
+ - [Navigation Menu](/docs/components/navigation-menu) - For primary navigation