
tamagui-best-practices
Use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).
- Installs
- 363
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/alleneubank/claude-code --skill tamagui-best-practices- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads tamagui-best-practices automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Tamagui Best Practices
Tamagui v1.x patterns beyond fundamentals: Config v4, compiler optimization, compound components, and gotchas.
Reference Files — Read Before Writing Code
| 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 |
Config v4
Minimal setup with @tamagui/config/v4. Add styleCompat: 'react-native' for new projects to align flexBasis with React Native behavior:
import { 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.
Compiler Optimization Rules
- Use
styled()variants instead of inline conditionals — dynamic values break flattening. - Avoid
style={{ ... }}with variables; use variant props instead. - The
contextpattern (createStyledContext) disables compiler flattening — use for higher-level components (Button, Card), not primitives.
// BAD — breaks compiler
<View backgroundColor={isDark ? '$gray1' : '$gray12'} />
// GOOD — use variants
const Box = styled(View, {
variants: {
dark: { true: { backgroundColor: '$gray1' }, false: { backgroundColor: '$gray12' } },
},
})
styled() vs Inline
styled(): reusable components, variant-driven behavior, compiler-optimizable primitives.- Inline props: one-off layout adjustments on already-styled components.
- Always use
as constonvariantsobjects (TypeScript limitation until inferred const generics).
Key Gotchas
Prop order determines override priority — props after a spread cannot be overridden by callers:
// width is locked; backgroundColor can be overridden
<View backgroundColor="$red10" {...props} width={200} />
Variant order matters — later props win:
<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:
const CorrectWrapper = StyledText.styleable((props, ref) => (
<StyledText ref={ref} {...props} />
))
accept prop for non-standard token resolution (SVG fill/stroke, contentContainerStyle):
const 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).
Quick Reference
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] })
Fetching Current Docs
curl -sL "https://tamagui.dev/docs/core/configuration.md"
curl -sL "https://tamagui.dev/llms.txt" # full index
FAQ
What does the tamagui-best-practices skill do?
Use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).
How do I install tamagui-best-practices?
Run npx skills add https://github.com/alleneubank/claude-code --skill tamagui-best-practices in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/tamagui-best-practices/ (personal) or .claude/skills/tamagui-best-practices/ (project).
Which AI agents can use tamagui-best-practices?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is tamagui-best-practices safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains tamagui-best-practices?
It is published by alleneubank in alleneubank/claude-code. It has 363 recorded installs.
More from alleneubank/claude-code
typescript-best-practices
alleneubank/claude-code
Use when reading or writing TypeScript or JavaScript files (.ts, .tsx, .js, tsconfig.json).
react-best-practices
alleneubank/claude-code
Use when reading or writing React components (.tsx, .jsx files with React imports).
python-best-practices
alleneubank/claude-code
Use when reading or writing Python files (.py, pyproject.toml, requirements.txt).
web-fetch
alleneubank/claude-code
Fetches web content as clean markdown by preferring markdown-native responses and falling back to selector-based HTML extraction. Use for documentation, articles, and reference pages at http/https URLs.
nix-best-practices
alleneubank/claude-code
Use when working with Nix flakes, overlays, shell.nix, or flake.nix files.
zig-best-practices
alleneubank/claude-code
Use when reading or writing Zig files (.zig, build.zig, build.zig.zon).
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.