@take-out/docs 0.0.42

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/tamagui.md ADDED
@@ -0,0 +1,478 @@
1
+ ---
2
+ name: tamagui
3
+ description: Tamagui UI framework guide. Use when styling, components, tokens ($color, $size, $space), themes (light/dark mode), media queries, breakpoints, responsive design, shorthands (p, m, bg, f, ai, jc), Stack, XStack, YStack, Text, styled(), useTheme, or any Tamagui component.
4
+ ---
5
+
6
+ # Tamagui UI Framework
7
+
8
+ This guide covers the Tamagui configuration and usage patterns in this project.
9
+
10
+ ## Configuration Settings
11
+
12
+ **IMPORTANT:** These settings affect how you write Tamagui code in this project.
13
+
14
+ ### Default Font: `body`
15
+
16
+ All text components use the "body" font family by default. Available font families:
17
+ - `body` - System font for general UI text
18
+ - `heading` - System font for headings with adjusted sizing
19
+ - `mono` - JetBrains Mono for monospace text
20
+
21
+ ### Only Allow Shorthands: `true`
22
+
23
+ **You MUST use shorthand properties in this project.**
24
+
25
+ Full property names are not allowed. For example:
26
+ - ✅ `<Stack p="$4" />` (correct)
27
+ - ❌ `<Stack padding="$4" />` (will error)
28
+
29
+ See the Shorthand Properties section below for all available shorthands.
30
+
31
+ ### Theme Configuration
32
+
33
+ - **Theme Class Name on Root:** `true` - Theme classes applied to root HTML element
34
+ - **Max Dark/Light Nesting:** `2` - Maximum nesting depth for light/dark theme switching
35
+ - **Disable Root Theme Class:** `true` - vxrn color scheme handles this
36
+ - **Disable SSR:** `true` - SSR is disabled for Tamagui in this project
37
+
38
+ ## Shorthand Properties
39
+
40
+ These are the ONLY shorthand properties available in v4 (many from v3 were removed):
41
+
42
+ **Layout & Position:**
43
+ - `b` → `bottom`
44
+ - `l` → `left`
45
+ - `r` → `right`
46
+ - `t` → `top`
47
+ - `z` → `zIndex`
48
+
49
+ **Flexbox:**
50
+ - `content` → `alignContent`
51
+ - `grow` → `flexGrow`
52
+ - `items` → `alignItems`
53
+ - `justify` → `justifyContent`
54
+ - `self` → `alignSelf`
55
+ - `shrink` → `flexShrink`
56
+
57
+ **Spacing (Margin):**
58
+ - `m` → `margin`
59
+ - `mb` → `marginBottom`
60
+ - `ml` → `marginLeft`
61
+ - `mr` → `marginRight`
62
+ - `mt` → `marginTop`
63
+ - `mx` → `marginHorizontal`
64
+ - `my` → `marginVertical`
65
+
66
+ **Spacing (Padding):**
67
+ - `p` → `padding`
68
+ - `pb` → `paddingBottom`
69
+ - `pl` → `paddingLeft`
70
+ - `pr` → `paddingRight`
71
+ - `pt` → `paddingTop`
72
+ - `px` → `paddingHorizontal`
73
+ - `py` → `paddingVertical`
74
+
75
+ **Sizing:**
76
+ - `maxH` → `maxHeight`
77
+ - `maxW` → `maxWidth`
78
+ - `minH` → `minHeight`
79
+ - `minW` → `minWidth`
80
+
81
+ **Other:**
82
+ - `bg` → `backgroundColor`
83
+ - `rounded` → `borderRadius`
84
+ - `select` → `userSelect`
85
+ - `text` → `textAlign`
86
+
87
+ **Note:** Properties like `w` (width), `h` (height), `f` (flex), etc. from v3 are NOT available in v4. Use full property names for these.
88
+
89
+ ## Tokens
90
+
91
+ Tokens are design system values referenced using the `$` prefix.
92
+
93
+ ### Space Tokens
94
+
95
+ For margin, padding, gap:
96
+
97
+ ```tsx
98
+ <Stack p="$4" gap="$2" m="$3" />
99
+ ```
100
+
101
+ Available space tokens:
102
+ - Negative: `-20` through `-0.25` (negative spacing)
103
+ - Zero: `0`
104
+ - Positive: `0.25` through `20`
105
+ - `true`: `18` (default/fallback)
106
+
107
+ Common values:
108
+ - `$1`: 2px
109
+ - `$2`: 7px
110
+ - `$3`: 13px
111
+ - `$4`: 18px
112
+ - `$5`: 24px
113
+ - `$6`: 32px
114
+ - `$8`: 46px
115
+ - `$10`: 60px
116
+
117
+ ### Size Tokens
118
+
119
+ For width, height, dimensions:
120
+
121
+ ```tsx
122
+ <Stack width="$10" height="$6" />
123
+ ```
124
+
125
+ Available size tokens:
126
+ - `0` through `20`
127
+ - `true`: `44` (default/fallback)
128
+
129
+ Common values:
130
+ - `$1`: 20px
131
+ - `$2`: 28px
132
+ - `$4`: 44px
133
+ - `$6`: 64px
134
+ - `$8`: 84px
135
+ - `$10`: 104px
136
+ - `$12`: 144px
137
+
138
+ ### Radius Tokens
139
+
140
+ For border-radius:
141
+
142
+ ```tsx
143
+ <Stack rounded="$4" />
144
+ ```
145
+
146
+ Available radius tokens:
147
+ - `0` through `12`
148
+ - `true`: `9` (default/fallback)
149
+
150
+ Common values:
151
+ - `$0`: 0px
152
+ - `$1`: 3px
153
+ - `$2`: 5px
154
+ - `$4`: 9px
155
+ - `$6`: 16px
156
+ - `$8`: 22px
157
+
158
+ ### Z-Index Tokens
159
+
160
+ ```tsx
161
+ <Stack z="$3" />
162
+ ```
163
+
164
+ Available z-index tokens:
165
+ - `$0`: 0
166
+ - `$1`: 100
167
+ - `$2`: 200
168
+ - `$3`: 300
169
+ - `$4`: 400
170
+ - `$5`: 500
171
+
172
+ ### Color Tokens
173
+
174
+ Access theme colors:
175
+
176
+ ```tsx
177
+ <Stack bg="$background" color="$color" />
178
+ <Stack bg="$blue5" color="$gray12" />
179
+ ```
180
+
181
+ ## Themes
182
+
183
+ Themes are organized hierarchically and can be combined.
184
+
185
+ ### Theme Levels
186
+
187
+ **Level 1 (Base):**
188
+ - `dark`
189
+ - `light`
190
+
191
+ **Level 2 (Color Schemes):**
192
+ - `accent`, `black`, `blue`, `green`, `orange`, `pink`, `purple`, `red`, `teal`, `white`, `yellow`
193
+
194
+ **Component Themes:**
195
+ - `Button`, `Card`, `Checkbox`, `Input`, `ListItem`, `Progress`, `ProgressIndicator`
196
+ - `RadioGroupItem`, `SelectTrigger`, `SliderThumb`, `SliderTrack`, `SliderTrackActive`
197
+ - `Switch`, `SwitchThumb`, `TextArea`, `Tooltip`, `TooltipArrow`, `TooltipContent`
198
+
199
+ ### Theme Usage
200
+
201
+ ```tsx
202
+ // Apply a theme
203
+ <Theme name="dark">
204
+ <Button>I'm a dark button</Button>
205
+ </Theme>
206
+
207
+ // Themes nest and combine automatically
208
+ <Theme name="dark">
209
+ <Theme name="blue">
210
+ <Button>Uses dark_blue theme</Button>
211
+ </Theme>
212
+ </Theme>
213
+
214
+ // Special props
215
+ <Theme inverse> {/* Swaps light ↔ dark */}
216
+ <Theme reset> {/* Reverts to grandparent theme */}
217
+ ```
218
+
219
+ ### Theme Values
220
+
221
+ Available theme variables (access with `$` prefix):
222
+ - Colors: `$color1` through `$color12`, `$color0`, `$color02`, `$color04`, `$color06`, `$color08`
223
+ - Backgrounds: `$background`, `$backgroundHover`, `$backgroundPress`, `$backgroundFocus`
224
+ - Borders: `$borderColor`, `$borderColorHover`, `$borderColorPress`, `$borderColorFocus`
225
+ - Text: `$color`, `$colorHover`, `$colorPress`, `$colorFocus`, `$placeholderColor`
226
+ - Accents: `$accentBackground`, `$accentColor`
227
+ - Named colors: `$blue1` through `$blue12`, `$gray1` through `$gray12`, etc.
228
+
229
+ ## Media Queries
230
+
231
+ Available responsive breakpoints defined in `tamagui.config.ts`:
232
+
233
+ ### Width Breakpoints
234
+
235
+ **Min-width (mobile-first):**
236
+ - `xxxs`: 260px
237
+ - `xxs`: 380px
238
+ - `xs`: 440px
239
+ - `sm`: 500px
240
+ - `md`: 600px
241
+ - `lg`: 800px
242
+ - `xl`: 1024px
243
+ - `xxl`: 1240px
244
+
245
+ **Max-width (desktop-first):**
246
+ - `maxXXXS`: 260px
247
+ - `maxXXS`: 380px
248
+ - `maxXS`: 440px
249
+ - `maxSM`: 500px
250
+ - `maxMD`: 600px
251
+ - `maxLG`: 800px
252
+ - `maxXL`: 1024px
253
+ - `maxXXL`: 1240px
254
+
255
+ ### Height Breakpoints
256
+
257
+ - `heightXXXS`: 260px
258
+ - `heightXXS`: 380px
259
+ - `heightXS`: 440px
260
+ - `heightSM`: 500px
261
+ - `heightMD`: 600px
262
+ - `heightLG`: 800px
263
+
264
+ ### Other Media Queries
265
+
266
+ - `pointerTouch`: `{ pointer: 'coarse' }` - Touch devices
267
+
268
+ ### Media Query Usage
269
+
270
+ ```tsx
271
+ // As style props (prefix with $)
272
+ <Stack width="100%" $md={{ width: "50%" }} $lg={{ width: "33%" }} />
273
+
274
+ // Multiple breakpoints
275
+ <Stack
276
+ p="$2"
277
+ $sm={{ p: "$4" }}
278
+ $md={{ p: "$6" }}
279
+ $lg={{ p: "$8" }}
280
+ />
281
+
282
+ // Using the useMedia hook
283
+ import { useMedia } from 'tamagui'
284
+
285
+ const media = useMedia()
286
+ if (media.lg) {
287
+ // Render for large screens
288
+ }
289
+ ```
290
+
291
+ ## Animations
292
+
293
+ Available animation presets:
294
+
295
+ **Duration-based:**
296
+ - `0ms`, `30ms`, `50ms`, `75ms`, `100ms`, `200ms`, `300ms`
297
+
298
+ **Named presets:**
299
+ - Speed: `quickest`, `quicker`, `quick`, `medium`, `slow`, `slowest`, `superLazy`, `lazy`
300
+ - With bounce: `superBouncy`, `bouncy`, `kindaBouncy`
301
+ - Less bounce variants: `quickestLessBouncy`, `quickerLessBouncy`, `quickLessBouncy`
302
+ - Special: `tooltip`
303
+
304
+ Usage:
305
+
306
+ ```tsx
307
+ <Stack animation="quick" />
308
+ <Stack animation="bouncy" />
309
+ ```
310
+
311
+ ## Components
312
+
313
+ ### Core Layout Components
314
+
315
+ - `Stack`, `XStack`, `YStack`, `ZStack` - Flexbox containers
316
+ - `SizableStack`, `ThemeableStack` - Variants with additional features
317
+ - `View`, `Frame` - Basic containers
318
+ - `ScrollView` - Scrollable container
319
+ - `Spacer` - Flexible spacing
320
+ - `Group`, `XGroup`, `YGroup` - Grouped items
321
+
322
+ ### Typography
323
+
324
+ - `Text`, `SizableText` - Text components
325
+ - `Paragraph` - Paragraph text
326
+ - `Heading` - Heading text
327
+ - `H1`, `H2`, `H3`, `H4`, `H5`, `H6` - Heading levels
328
+
329
+ ### Form Components
330
+
331
+ - `Input` - Text input
332
+ - `Input.Frame` - Input container
333
+ - `TextArea` - Multi-line text input
334
+ - `Text.Area`, `Text.AreaFrame`
335
+ - `Button` - Button component
336
+ - `Button.Frame`, `Button.Text`
337
+ - `Checkbox` - Checkbox input
338
+ - `Checkbox.Frame`, `Checkbox.IndicatorFrame`
339
+ - `RadioGroup` - Radio button group
340
+ - `RadioGroup.Frame`, `RadioGroup.IndicatorFrame`, `RadioGroup.ItemFrame`
341
+ - `Switch` - Toggle switch
342
+ - `Switch.Frame`, `Switch.Thumb`
343
+ - `Slider` - Range slider
344
+ - `SliderFrame`, `SliderThumb`, `SliderThumb.Frame`
345
+ - `SliderTrackFrame`, `SliderTrackActiveFrame`
346
+ - `Label` - Form label
347
+ - `Label.Frame`
348
+ - `Fieldset` - Form fieldset
349
+ - `Form` - Form container
350
+ - `Form.Frame`, `Form.Trigger`
351
+
352
+ ### Display Components
353
+
354
+ - `Card` - Card container
355
+ - `Card.Frame`, `Card.Header`, `Card.Footer`, `Card.Background`
356
+ - `ListItem` - List item
357
+ - `ListItem.Frame`, `ListItem.Title`, `ListItem.Subtitle`, `ListItem.Text`
358
+ - `Image` - Image component
359
+ - `Avatar` - Avatar component
360
+ - `AvatarFrame`, `AvatarFallback`, `AvatarFallback.Frame`
361
+ - `Progress` - Progress bar
362
+ - `Progress.Frame`, `Progress.Indicator`, `Progress.IndicatorFrame`
363
+ - `Spinner` - Loading spinner
364
+ - `Separator` - Visual separator
365
+
366
+ ### Shapes
367
+
368
+ - `Circle` - Circle shape
369
+ - `Square` - Square shape
370
+
371
+ ### Overlays & Dialogs
372
+
373
+ - `Dialog` - Modal dialog
374
+ - `DialogOverlay`, `DialogOverlay.Frame`
375
+ - `DialogPortalFrame`
376
+ - `DialogContent`, `DialogTitle`, `DialogDescription`
377
+ - `DialogTrigger`, `DialogClose`
378
+ - `AlertDialog` - Alert dialog
379
+ - `AlertDialogOverlay`
380
+ - `AlertDialogTitle`, `AlertDialogDescription`
381
+ - `AlertDialogTrigger`, `AlertDialogAction`, `AlertDialogCancel`
382
+ - `Popover` - Popover overlay
383
+ - `PopoverContent`, `PopoverArrow`
384
+ - `Tooltip` - Tooltip
385
+ - `Tooltip`, `TooltipContent`, `TooltipArrow`
386
+ - `Sheet` - Bottom/side sheet
387
+ - `SheetOverlayFrame`, `SheetHandleFrame`
388
+ - `Overlay` - Generic overlay
389
+
390
+ ### Popper
391
+
392
+ - `PopperAnchor` - Anchor for positioned elements
393
+ - `PopperContentFrame` - Positioned content
394
+ - `PopperArrowFrame` - Arrow pointer
395
+
396
+ ### Select
397
+
398
+ - `SelectGroupFrame` - Select group container
399
+ - `SelectIcon` - Select icon
400
+ - `SelectSeparator` - Select separator
401
+
402
+ ### Navigation
403
+
404
+ - `Tabs` - Tab navigation
405
+ - `Anchor` - Link/anchor element
406
+
407
+ ### Semantic HTML
408
+
409
+ - `Article`, `Aside`, `Footer`, `Header`, `Main`, `Nav`, `Section`
410
+
411
+ ### Utilities
412
+
413
+ - `VisuallyHidden` - Accessible hidden content
414
+ - `EnsureFlexed` - Ensure flex layout
415
+ - `Handle`, `Thumb` - Draggable elements
416
+
417
+ ## Project-Specific Component Preferences
418
+
419
+ When building UI components, prefer these project-specific implementations over Tamagui defaults:
420
+
421
+ ### Custom Components (in `src/interface`)
422
+
423
+ - **Buttons:** Use `ButtonSimple` instead of Tamagui's `Button`
424
+ - **Select/Dropdown:** Use the custom `Select` component
425
+ - **Tabs:** Use the custom `Tabs` component
426
+ - **Popover:** Use the custom `Popover` component
427
+
428
+ ### Image Handling
429
+
430
+ - Use `@tamagui/image-next` for Next.js compatibility
431
+
432
+ ### Component Hierarchy
433
+
434
+ 1. Check if a project-specific component exists in `src/interface` first
435
+ 2. Check existing components for patterns before creating new ones
436
+ 3. Only use Tamagui's default components when no custom alternative exists
437
+ 4. Maintain consistency with existing UI patterns in the codebase
438
+
439
+ ## Default Props
440
+
441
+ ### Button
442
+
443
+ The Button component has custom default props:
444
+
445
+ ```tsx
446
+ {
447
+ fontFamily: '$mono',
448
+ cursor: 'default',
449
+ focusVisibleStyle: {
450
+ outlineWidth: 3,
451
+ outlineStyle: 'solid',
452
+ outlineColor: '$background04',
453
+ }
454
+ }
455
+ ```
456
+
457
+ ## Best Practices
458
+
459
+ 1. **Always use shorthands** - Full property names will cause errors due to `onlyAllowShorthands: true`
460
+ 2. **Use tokens consistently** - Prefer `$` token syntax over hardcoded values
461
+ 3. **Mobile-first responsive design** - Use min-width media queries (`sm`, `md`, `lg`) rather than max-width when possible
462
+ 4. **Leverage theme system** - Use theme tokens (`$color`, `$background`, etc.) for automatic light/dark mode support
463
+ 5. **Follow project component hierarchy** - Check `src/interface` for custom components before using Tamagui defaults
464
+ 6. **Maintain semantic HTML** - Use semantic components (`Article`, `Header`, `Nav`, etc.) for better accessibility
465
+ 7. **Type safety** - Tamagui provides full TypeScript support for all tokens and props
466
+ 8. **Performance** - Use media query props for responsive design rather than conditional rendering when possible
467
+
468
+ ## Additional Resources
469
+
470
+ - Tamagui configuration: `src/tamagui/tamagui.config.ts`
471
+ - Theme definitions: `src/tamagui/themes-out.ts`
472
+ - Breakpoints: `src/tamagui/breakpoints.ts`
473
+ - Animations: `src/tamagui/animations.ts`
474
+ - Custom components: `src/interface/`
475
+
476
+ ---
477
+
478
+ *This documentation was generated using `bunx tamagui generate-prompt` and enhanced with project-specific guidance.*