Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
0xbigboss avatar

Tamagui Best Practices

  • 340 installs
  • 52 repo stars
  • Updated June 24, 2026
  • 0xbigboss/claude-code

tamagui-best-practices is an agent skill that teaches Tamagui patterns for shared React Native and web UIs so developers building cross-platform product screens follow performant styling, theming, and component conventio

About

tamagui-best-practices is an agent skill from 0xbigboss/claude-code that encodes Tamagui conventions for building shared React Native and web interfaces. It guides agents through cross-platform screens, design tokens, theme setup, and performant styled components so one Tamagui codebase renders consistently on iOS, Android, and web. Developers reach for tamagui-best-practices when implementing product UI with Tamagui instead of maintaining separate React DOM and React Native style systems. The skill reduces inconsistent theming, ad-hoc styling, and platform-specific UI drift during feature development.

  • cross-platform UI
  • design tokens
  • styled components
  • performance
  • theming

Tamagui Best Practices by the numbers

  • 340 all-time installs (skills.sh)
  • Ranked #705 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Jul 30, 2026 (Skillselion catalog sync)
npx skills add https://github.com/0xbigboss/claude-code --skill tamagui-best-practices

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs340
repo stars52
Last updatedJune 24, 2026
Repository0xbigboss/claude-code

How do you build shared React Native and web UIs with Tamagui?

Build shared React Native and web UIs with Tamagui when agents implement cross-platform screens, themes, tokens, and performant styled components for product interfaces.

Who is it for?

Frontend developers shipping cross-platform React Native and web product UIs with a single Tamagui design system.

Skip if: Projects using only React DOM, only bare React Native StyleSheet, or a different cross-platform UI kit like NativeWind without Tamagui.

When should I use this skill?

The user asks to build or refactor Tamagui screens, themes, tokens, or styled components for React Native and web.

What you get

Cross-platform Tamagui screens, theme token definitions, and performant styled component implementations.

  • Tamagui screen components
  • theme token config
  • styled component patterns

Files

SKILL.mdMarkdownGitHub ↗

Tamagui Best Practices

Tamagui v1.x patterns beyond fundamentals: Config v4, compiler optimization, compound components, and gotchas.

Reference Files — Read Before Writing Code

ContextFileWhat it covers
Dialog, Sheet, modal overlays@DIALOG_PATTERNS.mdAdapt component, accessibility
Form, Input, Label, validation@FORM_PATTERNS.mdzod integration
Animations, transitions@ANIMATION_PATTERNS.mddrivers, enterStyle/exitStyle
Popover, Tooltip, Select@OVERLAY_PATTERNS.mdoverlay primitives
Compiler optimization@COMPILER_PATTERNS.mdwhat the compiler can/cannot flatten
Design tokens, theming@DESIGN_SYSTEM.mdpalette, 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 context pattern (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 const on variants objects (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 consistencytamagui, @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

Related skills

How it compares

Pick tamagui-best-practices over generic React Native skills when the stack is Tamagui and the goal is one shared UI layer across mobile and web.

FAQ

What does tamagui-best-practices cover?

tamagui-best-practices is an agent skill for Tamagui cross-platform UI development. It teaches shared React Native and web screens, theme tokens, and performant styled components so agents follow consistent Tamagui conventions.

When should I invoke tamagui-best-practices?

Invoke tamagui-best-practices when building or refactoring Tamagui product interfaces across React Native and web. The skill fits theme setup, token definitions, and styled component work during active frontend development.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.