Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).
.claude/skills/aiskillstore-tamagui-best-practices/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -20% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 28% | 0% |
Tamagui v1.x patterns beyond fundamentals: Config v4, compiler optimization, compound components, and gotchas.
| Context | File | What it covers | |---------|------|----------------| | Dialog, Sheet, modal overlays | @DIALOG_PATTERNS.md | Adapt component, accessibility | | Form, Input, Label, validation | @FORM_PATTERNS.md | zod integration | | Animations, transitions | @ANIMATION_PATTERNS.md | drivers, enterStyle/exitStyle | | Popover, Tooltip, Select | @OVERLAY_PATTERNS.md | overlay primitives | | Compiler optimization | @COMPILER_PATTERNS.md | what the compiler can/cannot flatten | | Design tokens, theming | @DESIGN_SYSTEM.md | palette, token structure |
Minimal setup with @tamagui/config/v4. Add styleCompat: 'react-native' for new projects to align flexBasis with React Native behavior:
tsximport { defaultConfig } from '@tamagui/config/v4' import { createTamagui } from 'tamagui' export const config = createTamagui({ ...defaultConfig, settings: { ...defaultConfig.settings, styleCompat: 'react-native' }, }) declare module 'tamagui' { interface TamaguiCustomConfig extends typeof config {} }
For custom themes use createThemes with palette/accent/childrenThemes — see @DESIGN_SYSTEM.md.
styled() variants instead of inline conditionals — dynamic values break flattening.style={{ ... }} with variables; use variant props instead.context pattern (createStyledContext) disables compiler flattening — use for higher-level components (Button, Card), not primitives.tsx// BAD — breaks compiler <View backgroundColor={isDark ? '$gray1' : '$gray12'} /> // GOOD — use variants const Box = styled(View, { variants: { dark: { true: { backgroundColor: '$gray1' }, false: { backgroundColor: '$gray12' } }, }, })
styled(): reusable components, variant-driven behavior, compiler-optimizable primitives.as const on variants objects (TypeScript limitation until inferred const generics).Prop order determines override priority — props after a spread cannot be overridden by callers:
tsx// width is locked; backgroundColor can be overridden <View backgroundColor="$red10" {...props} width={200} />
Variant order matters — later props win:
tsx<Component scale={3} huge /> // scale = 3 (scale listed first) <Component huge scale={3} /> // scale = 2 (huge overrides, comes first in variants)
Use .styleable() when wrapping styled components — preserves variant inheritance:
tsxconst CorrectWrapper = StyledText.styleable((props, ref) => ( <StyledText ref={ref} {...props} /> ))
accept prop for non-standard token resolution (SVG fill/stroke, contentContainerStyle):
tsxconst StyledSVG = styled(SVG, {}, { accept: { fill: 'color', stroke: 'color' } as const })
Import consistency — tamagui, @tamagui/core, and @tamagui/button are different packages; pick one approach per project.
Never mix RN StyleSheet with Tamagui — StyleSheet values don't resolve tokens.
Platform branching for Dialog/Sheet — use Adapt instead of Platform.OS checks (see @DIALOG_PATTERNS.md).
Config v4 shorthands: bg backgroundColor, p padding, m margin, w width, h height, br borderRadius
Media breakpoints: $xs 660px, $sm 800px, $md 1020px, $lg 1280px, $xl 1420px
Animation drivers: css (web, default), react-native-reanimated (native, required)
Token $ prefix: use in props (color="$color"), omit in theme definitions ({ color: palette[11] })
bashcurl -sL "https://tamagui.dev/docs/core/configuration.md" curl -sL "https://tamagui.dev/llms.txt" # full index
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 7,582 | 5,117 | -33% | 1 | 1 | 0% | 1,386 | 1,977 | +43% | 0 | 0 | — |
case-02 | fail→pass | 14,289 | 8,585 | -40% | 1 | 1 | 0% | 2,431 | 2,556 | +5% | 0 | 0 | — |
case-03 | pass→pass | 11,065 | 6,310 | -43% | 1 | 1 | 0% | 1,903 | 2,183 | +15% | 0 | 0 | — |
case-04 | pass→pass | 8,268 | 4,630 | -44% | 1 | 1 | 0% | 962 | 1,879 | +95% | 0 | 0 | — |
case-05 | fail→fail | 5,708 | 7,786 | +36% | 1 | 1 | 0% | 932 | 2,581 | +177% | 0 | 0 | — |
case-06 | fail→pass | 16,077 | 5,641 | -65% | 1 | 1 | 0% | 2,654 | 2,112 | -20% | 0 | 0 | — |
case-07 | pass→pass | 16,643 | 8,474 | -49% | 1 | 1 | 0% | 2,491 | 2,470 | -1% | 0 | 0 | — |
case-08 | pass→pass | 10,550 | 2,925 | -72% | 1 | 1 | 0% | 1,683 | 1,586 | -6% | 0 | 0 | — |
case-09 | pass→pass | 14,397 | 8,334 | -42% | 1 | 1 | 0% | 2,208 | 2,404 | +9% | 0 | 0 | — |
case-10 | pass→pass | 12,168 | 8,033 | -34% | 1 | 1 | 0% | 2,026 | 2,587 | +28% | 0 | 0 | — |
case-11 | fail→pass | 6,311 | 3,333 | -47% | 1 | 1 | 0% | 1,147 | 1,648 | +44% | 0 | 0 | — |
case-12 | pass→pass | 13,749 | 12,761 | -7% | 1 | 1 | 0% | 2,257 | 3,192 | +41% | 0 | 0 | — |
case-13 | pass→pass | 6,072 | 1,753 | -71% | 1 | 1 | 0% | 601 | 1,305 | +117% | 0 | 0 | — |
case-14 | pass→pass | 4,955 | 2,776 | -44% | 1 | 1 | 0% | 854 | 1,511 | +77% | 0 | 0 | — |
case-15 | pass→pass | 6,653 | 2,789 | -58% | 1 | 1 | 0% | 1,238 | 1,456 | +18% | 0 | 0 | — |
case-16 | pass→pass | 6,265 | 2,965 | -53% | 1 | 1 | 0% | 1,316 | 1,560 | +19% | 0 | 0 | — |
case-17 | fail→pass | 13,336 | 9,606 | -28% | 1 | 1 | 0% | 2,037 | 2,611 | +28% | 0 | 0 | — |
case-18 | pass→pass | 10,854 | 3,624 | -67% | 1 | 1 | 0% | 1,823 | 1,605 | -12% | 0 | 0 | — |
case-19 | pass→pass | 11,821 | 8,999 | -24% | 1 | 1 | 0% | 2,070 | 2,752 | +33% | 0 | 0 | — |
case-20 | pass→pass | 13,036 | 8,673 | -33% | 1 | 1 | 0% | 2,274 | 2,516 | +11% | 0 | 0 | — |
case-21 | pass→pass | 4,534 | 2,784 | -39% | 1 | 1 | 0% | 591 | 1,573 | +166% | 0 | 0 | — |
case-22 | pass→pass | 9,029 | 9,130 | +1% | 1 | 1 | 0% | 1,483 | 2,729 | +84% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.