[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EHEZ2C9BE59ZE6T80XD3CS":3,"skill-same:01M6EHEZ2C9BE59ZE6T80XD3CS":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":41,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6EHEZ2C9BE59ZE6T80XD3CS","tamagui-best-practices",null,"Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"best practices","tamagui best practices","config","compiler","Optimization","projects","context","use","styling","patterns","cross-platform","platform","2026-11-10 10:12:30",false,"---\nname: tamagui-best-practices\ndescription: Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).\n---\n\nThis skill provides patterns for Tamagui v1.x that go beyond fundamentals. It focuses on Config v4, compiler optimization, compound components, and common mistakes.\n\n## Mandatory Context Loading\n\nWhen working with these components, read the corresponding pattern file BEFORE writing code:\n\n| Component Type | Required Reading | Cross-Skills |\n|---------------|------------------|--------------|\n| Dialog, Sheet, modal overlays | @DIALOG_PATTERNS.md | |\n| Form, Input, Label, validation | @FORM_PATTERNS.md | `typescript-best-practices` (zod) |\n| Animations, transitions | @ANIMATION_PATTERNS.md | |\n| Popover, Tooltip, Select | @OVERLAY_PATTERNS.md | |\n| Compiler optimization | @COMPILER_PATTERNS.md | |\n| Design tokens, theming | @DESIGN_SYSTEM.md | |\n\n## Config v4 Quick Start\n\nUse `@tamagui\u002Fconfig\u002Fv4` for simplified setup:\n\n```tsx\n\u002F\u002F tamagui.config.ts\nimport { defaultConfig } from '@tamagui\u002Fconfig\u002Fv4'\nimport { createTamagui } from 'tamagui'\n\nexport const config = createTamagui(defaultConfig)\n\ntype CustomConfig = typeof config\n\ndeclare module 'tamagui' {\n  interface TamaguiCustomConfig extends CustomConfig {}\n}\n```\n\n**Recommended setting** for new projects (aligns flexBasis to React Native):\n```tsx\nexport const config = createTamagui({\n  ...defaultConfig,\n  settings: {\n    ...defaultConfig.settings,\n    styleCompat: 'react-native',\n  },\n})\n```\n\n### createThemes Pattern\n\nFor custom themes, use `createThemes` with palette\u002Faccent\u002FchildrenThemes:\n\n```tsx\nimport { createThemes, defaultComponentThemes } from '@tamagui\u002Fconfig\u002Fv4'\n\nconst generatedThemes = createThemes({\n  componentThemes: defaultComponentThemes,\n  base: {\n    palette: {\n      dark: ['#050505', '#151515', \u002F* ...12 colors *\u002F '#fff'],\n      light: ['#fff', '#f8f8f8', \u002F* ...12 colors *\u002F '#000'],\n    },\n    extra: {\n      light: { ...Colors.blue, shadowColor: 'rgba(0,0,0,0.04)' },\n      dark: { ...Colors.blueDark, shadowColor: 'rgba(0,0,0,0.2)' },\n    },\n  },\n  accent: {\n    palette: { dark: lightPalette, light: darkPalette }, \u002F\u002F inverted\n  },\n  childrenThemes: {\n    blue: { palette: { dark: Object.values(Colors.blueDark), light: Object.values(Colors.blue) } },\n    red: { \u002F* ... *\u002F },\n    green: { \u002F* ... *\u002F },\n  },\n})\n```\n\n## Token and Theme Syntax\n\n### $ Prefix Rules\n\n- **Props**: Use `$` prefix for token references: `\u003CText color=\"$color\" fontSize=\"$4\" \u002F>`\n- **Theme keys**: Access without `$` in theme definitions: `{ color: palette[11] }`\n- **Token access in variants**: Use `tokens.size[name]` pattern\n\n### Variant Spread Operators\n\nSpecial spread operators map token categories to variant values:\n\n```tsx\nconst Button = styled(View, {\n  variants: {\n    size: {\n      \u002F\u002F Maps size tokens: $1, $2, $true, etc.\n      '...size': (size, { tokens }) => ({\n        height: tokens.size[size] ?? size,\n        borderRadius: tokens.radius[size] ?? size,\n        gap: tokens.space[size]?.val * 0.2,\n      }),\n    },\n    textSize: {\n      \u002F\u002F Maps fontSize tokens\n      '...fontSize': (name, { font }) => ({\n        fontSize: font?.size[name],\n      }),\n    },\n  } as const,\n})\n```\n\n**Important**: Use `as const` on variants object until TypeScript supports inferred const generics.\n\n## Compound Components with createStyledContext\n\nFor compound APIs like `\u003CButton>\u003CButton.Text>Click\u003C\u002FButton.Text>\u003C\u002FButton>`:\n\n```tsx\nimport {\n  SizeTokens,\n  View,\n  Text,\n  createStyledContext,\n  styled,\n  withStaticProperties,\n} from '@tamagui\u002Fcore'\n\n\u002F\u002F 1. Create context with shared variant types\nexport const ButtonContext = createStyledContext\u003C{ size: SizeTokens }>({\n  size: '$medium',\n})\n\n\u002F\u002F 2. Create frame with context\nexport const ButtonFrame = styled(View, {\n  name: 'Button',\n  context: ButtonContext,\n  variants: {\n    size: {\n      '...size': (name, { tokens }) => ({\n        height: tokens.size[name],\n        borderRadius: tokens.radius[name],\n        gap: tokens.space[name].val * 0.2,\n      }),\n    },\n  } as const,\n  defaultVariants: {\n    size: '$medium',\n  },\n})\n\n\u002F\u002F 3. Create text with same context (variants auto-sync)\nexport const ButtonText = styled(Text, {\n  name: 'ButtonText',\n  context: ButtonContext,\n  variants: {\n    size: {\n      '...fontSize': (name, { font }) => ({\n        fontSize: font?.size[name],\n      }),\n    },\n  } as const,\n})\n\n\u002F\u002F 4. Compose with withStaticProperties\nexport const Button = withStaticProperties(ButtonFrame, {\n  Props: ButtonContext.Provider,\n  Text: ButtonText,\n})\n```\n\n**Usage**:\n```tsx\n\u003CButton size=\"$large\">\n  \u003CButton.Text>Click me\u003C\u002FButton.Text>\n\u003C\u002FButton>\n\n\u002F\u002F Or override defaults from above:\n\u003CButton.Props size=\"$small\">\n  \u003CButton>\u003CButton.Text>Small\u003C\u002FButton.Text>\u003C\u002FButton>\n\u003C\u002FButton.Props>\n```\n\n**Note**: `context` pattern does not work with compiler flattening. Use for higher-level components (Button, Card), not primitives (Stack, Text).\n\n## styleable() for Wrapper Components\n\nWhen wrapping a styled component in a functional component, use `.styleable()` to preserve variant inheritance:\n\n```tsx\nconst StyledText = styled(Text)\n\n\u002F\u002F WITHOUT styleable - BROKEN variant inheritance\nconst BrokenWrapper = (props) => \u003CStyledText {...props} \u002F>\n\n\u002F\u002F WITH styleable - CORRECT\nconst CorrectWrapper = StyledText.styleable((props, ref) => (\n  \u003CStyledText ref={ref} {...props} \u002F>\n))\n\n\u002F\u002F Now this works:\nconst StyledCorrectWrapper = styled(CorrectWrapper, {\n  variants: {\n    bold: { true: { fontWeight: 'bold' } },\n  },\n})\n```\n\n### Adding Extra Props\n\nPass generic type argument for additional props:\n\n```tsx\ntype ExtraProps = { icon?: React.ReactNode }\n\nconst IconText = StyledText.styleable\u003CExtraProps>((props, ref) => {\n  const { icon, ...rest } = props\n  return (\n    \u003CXStack>\n      {icon}\n      \u003CStyledText ref={ref} {...rest} \u002F>\n    \u003C\u002FXStack>\n  )\n})\n```\n\n## accept Prop for Custom Components\n\nEnable token\u002Ftheme resolution on non-standard props:\n\n```tsx\n\u002F\u002F For SVG fill\u002Fstroke that should accept theme colors\nconst StyledSVG = styled(SVG, {}, {\n  accept: { fill: 'color', stroke: 'color' } as const,\n})\n\n\u002F\u002F Usage: \u003CStyledSVG fill=\"$blue10\" \u002F>\n\n\u002F\u002F For style objects (like ScrollView's contentContainerStyle)\nconst MyScrollView = styled(ScrollView, {}, {\n  accept: { contentContainerStyle: 'style' } as const,\n})\n\n\u002F\u002F Usage: \u003CMyScrollView contentContainerStyle={{ padding: '$4' }} \u002F>\n```\n\n**Important**: Use `as const` on the accept object.\n\n## Prop Order Matters\n\nIn `styled()`, prop order determines override priority:\n\n```tsx\n\u002F\u002F backgroundColor can be overridden by props\nconst Overridable = (props) => (\n  \u003CView backgroundColor=\"$red10\" {...props} width={200} \u002F>\n)\n\u002F\u002F width CANNOT be overridden (comes after spread)\n\n\u002F\u002F Variant order matters too:\n\u003CComponent scale={3} huge \u002F>  \u002F\u002F scale = 3 (scale comes first)\n\u003CComponent huge scale={3} \u002F>  \u002F\u002F scale = 2 (huge overrides)\n```\n\n## Anti-Patterns\n\n### Dynamic Styles Break Optimization\n\n```tsx\n\u002F\u002F BAD - breaks compiler optimization\n\u003CView style={{ width: someVariable * 2 }} \u002F>\n\u003CView backgroundColor={isDark ? '$gray1' : '$gray12'} \u002F>\n\n\u002F\u002F GOOD - use variants\nconst Box = styled(View, {\n  variants: {\n    dark: { true: { backgroundColor: '$gray1' }, false: { backgroundColor: '$gray12' } },\n  },\n})\n\u003CBox dark={isDark} \u002F>\n```\n\n### Inline Functions\n\n```tsx\n\u002F\u002F BAD - new function every render\n\u003CView onPress={() => handlePress(id)} \u002F>\n\n\u002F\u002F GOOD - stable reference\nconst handlePressCallback = useCallback(() => handlePress(id), [id])\n\u003CView onPress={handlePressCallback} \u002F>\n```\n\n### Wrong Import Paths\n\n```tsx\n\u002F\u002F These are different packages with different contents:\nimport { View } from 'tamagui'           \u002F\u002F Full UI kit\nimport { View } from '@tamagui\u002Fcore'     \u002F\u002F Core only (smaller)\nimport { Button } from '@tamagui\u002Fbutton' \u002F\u002F Individual component\n\n\u002F\u002F Pick one approach and be consistent\n```\n\n### Mixing RN StyleSheet with Tamagui\n\n```tsx\n\u002F\u002F BAD - StyleSheet values don't resolve tokens\nconst styles = StyleSheet.create({ box: { padding: 20 } })\n\u003CView style={styles.box} backgroundColor=\"$blue10\" \u002F>\n\n\u002F\u002F GOOD - all Tamagui\n\u003CView padding=\"$4\" backgroundColor=\"$blue10\" \u002F>\n```\n\n### Platform.OS Branching for Dialog\u002FSheet\n\n```tsx\n\u002F\u002F BAD - manual platform branching\nif (Platform.OS === 'web') {\n  return \u003CDialog>...\u003C\u002FDialog>\n}\nreturn \u003CSheet>...\u003C\u002FSheet>\n\n\u002F\u002F GOOD - use Adapt (see @DIALOG_PATTERNS.md)\n\u003CDialog>\n  \u003CDialog.Portal>...\u003C\u002FDialog.Portal>\n  \u003CAdapt when=\"sm\" platform=\"touch\">\n    \u003CSheet>\u003CAdapt.Contents \u002F>\u003C\u002FSheet>\n  \u003C\u002FAdapt>\n\u003C\u002FDialog>\n```\n\n## Fetching Current Documentation\n\nFor latest API details, fetch markdown docs directly:\n\n```bash\n# Core docs\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fconfiguration.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fstyled.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fvariants.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fanimations.md\"\n\n# Component docs\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fui\u002Fsheet.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fui\u002Fdialog.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fui\u002Fselect.md\"\n\n# Full docs index\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fllms.txt\"\n```\n\nFor HTML pages, use the web-fetch skill with appropriate selectors.\n\n## Quick Reference\n\n### Config v4 Shorthands (Tailwind-aligned)\n\n| Shorthand | Property |\n|-----------|----------|\n| `bg` | backgroundColor |\n| `p` | padding |\n| `m` | margin |\n| `w` | width |\n| `h` | height |\n| `br` | borderRadius |\n\n### Media Query Breakpoints\n\n| Token | Default | Server Default |\n|-------|---------|----------------|\n| `$xs` | 660px | true |\n| `$sm` | 800px | false |\n| `$md` | 1020px | false |\n| `$lg` | 1280px | false |\n| `$xl` | 1420px | false |\n\n### Animation Drivers\n\n| Driver | Platform | Use Case |\n|--------|----------|----------|\n| `css` | Web | Default, best performance |\n| `react-native-reanimated` | Native | Required for native animations |\n\n## Additional Pattern Files\n\n- @DIALOG_PATTERNS.md - Dialog, Sheet, Adapt, accessibility\n- @FORM_PATTERNS.md - Form, Input, Label, validation with zod\n- @ANIMATION_PATTERNS.md - Animation drivers, enterStyle\u002FexitStyle\n- @OVERLAY_PATTERNS.md - Popover, Tooltip, Select\n- @COMPILER_PATTERNS.md - Compiler optimization details\n- @DESIGN_SYSTEM.md - Design tokens and theming\n","This skill provides patterns for Tamagui v1.x that go beyond fundamentals. It focuses on Config v4, compiler optimization, compound components, and common mistakes.\n\n## Mandatory Context Loading\n\nWhen working with these components, read the corresponding pattern file BEFORE writing code:\n\n| Component Type | Required Reading | Cross-Skills |\n|---------------|------------------|--------------|\n| Dialog, Sheet, modal overlays | @DIALOG_PATTERNS.md | |\n| Form, Input, Label, validation | @FORM_PATTERNS.md | `typescript-best-practices` (zod) |\n| Animations, transitions | @ANIMATION_PATTERNS.md | |\n| Popover, Tooltip, Select | @OVERLAY_PATTERNS.md | |\n| Compiler optimization | @COMPILER_PATTERNS.md | |\n| Design tokens, theming | @DESIGN_SYSTEM.md | |\n\n## Config v4 Quick Start\n\nUse `@tamagui\u002Fconfig\u002Fv4` for simplified setup:\n\n```tsx\n\u002F\u002F tamagui.config.ts\nimport { defaultConfig } from '@tamagui\u002Fconfig\u002Fv4'\nimport { createTamagui } from 'tamagui'\n\nexport const config = createTamagui(defaultConfig)\n\ntype CustomConfig = typeof config\n\ndeclare module 'tamagui' {\n  interface TamaguiCustomConfig extends CustomConfig {}\n}\n```\n\n**Recommended setting** for new projects (aligns flexBasis to React Native):\n```tsx\nexport const config = createTamagui({\n  ...defaultConfig,\n  settings: {\n    ...defaultConfig.settings,\n    styleCompat: 'react-native',\n  },\n})\n```\n\n### createThemes Pattern\n\nFor custom themes, use `createThemes` with palette\u002Faccent\u002FchildrenThemes:\n\n```tsx\nimport { createThemes, defaultComponentThemes } from '@tamagui\u002Fconfig\u002Fv4'\n\nconst generatedThemes = createThemes({\n  componentThemes: defaultComponentThemes,\n  base: {\n    palette: {\n      dark: ['#050505', '#151515', \u002F* ...12 colors *\u002F '#fff'],\n      light: ['#fff', '#f8f8f8', \u002F* ...12 colors *\u002F '#000'],\n    },\n    extra: {\n      light: { ...Colors.blue, shadowColor: 'rgba(0,0,0,0.04)' },\n      dark: { ...Colors.blueDark, shadowColor: 'rgba(0,0,0,0.2)' },\n    },\n  },\n  accent: {\n    palette: { dark: lightPalette, light: darkPalette }, \u002F\u002F inverted\n  },\n  childrenThemes: {\n    blue: { palette: { dark: Object.values(Colors.blueDark), light: Object.values(Colors.blue) } },\n    red: { \u002F* ... *\u002F },\n    green: { \u002F* ... *\u002F },\n  },\n})\n```\n\n## Token and Theme Syntax\n\n### $ Prefix Rules\n\n- **Props**: Use `$` prefix for token references: `\u003CText color=\"$color\" fontSize=\"$4\" \u002F>`\n- **Theme keys**: Access without `$` in theme definitions: `{ color: palette[11] }`\n- **Token access in variants**: Use `tokens.size[name]` pattern\n\n### Variant Spread Operators\n\nSpecial spread operators map token categories to variant values:\n\n```tsx\nconst Button = styled(View, {\n  variants: {\n    size: {\n      \u002F\u002F Maps size tokens: $1, $2, $true, etc.\n      '...size': (size, { tokens }) => ({\n        height: tokens.size[size] ?? size,\n        borderRadius: tokens.radius[size] ?? size,\n        gap: tokens.space[size]?.val * 0.2,\n      }),\n    },\n    textSize: {\n      \u002F\u002F Maps fontSize tokens\n      '...fontSize': (name, { font }) => ({\n        fontSize: font?.size[name],\n      }),\n    },\n  } as const,\n})\n```\n\n**Important**: Use `as const` on variants object until TypeScript supports inferred const generics.\n\n## Compound Components with createStyledContext\n\nFor compound APIs like `\u003CButton>\u003CButton.Text>Click\u003C\u002FButton.Text>\u003C\u002FButton>`:\n\n```tsx\nimport {\n  SizeTokens,\n  View,\n  Text,\n  createStyledContext,\n  styled,\n  withStaticProperties,\n} from '@tamagui\u002Fcore'\n\n\u002F\u002F 1. Create context with shared variant types\nexport const ButtonContext = createStyledContext\u003C{ size: SizeTokens }>({\n  size: '$medium',\n})\n\n\u002F\u002F 2. Create frame with context\nexport const ButtonFrame = styled(View, {\n  name: 'Button',\n  context: ButtonContext,\n  variants: {\n    size: {\n      '...size': (name, { tokens }) => ({\n        height: tokens.size[name],\n        borderRadius: tokens.radius[name],\n        gap: tokens.space[name].val * 0.2,\n      }),\n    },\n  } as const,\n  defaultVariants: {\n    size: '$medium',\n  },\n})\n\n\u002F\u002F 3. Create text with same context (variants auto-sync)\nexport const ButtonText = styled(Text, {\n  name: 'ButtonText',\n  context: ButtonContext,\n  variants: {\n    size: {\n      '...fontSize': (name, { font }) => ({\n        fontSize: font?.size[name],\n      }),\n    },\n  } as const,\n})\n\n\u002F\u002F 4. Compose with withStaticProperties\nexport const Button = withStaticProperties(ButtonFrame, {\n  Props: ButtonContext.Provider,\n  Text: ButtonText,\n})\n```\n\n**Usage**:\n```tsx\n\u003CButton size=\"$large\">\n  \u003CButton.Text>Click me\u003C\u002FButton.Text>\n\u003C\u002FButton>\n\n\u002F\u002F Or override defaults from above:\n\u003CButton.Props size=\"$small\">\n  \u003CButton>\u003CButton.Text>Small\u003C\u002FButton.Text>\u003C\u002FButton>\n\u003C\u002FButton.Props>\n```\n\n**Note**: `context` pattern does not work with compiler flattening. Use for higher-level components (Button, Card), not primitives (Stack, Text).\n\n## styleable() for Wrapper Components\n\nWhen wrapping a styled component in a functional component, use `.styleable()` to preserve variant inheritance:\n\n```tsx\nconst StyledText = styled(Text)\n\n\u002F\u002F WITHOUT styleable - BROKEN variant inheritance\nconst BrokenWrapper = (props) => \u003CStyledText {...props} \u002F>\n\n\u002F\u002F WITH styleable - CORRECT\nconst CorrectWrapper = StyledText.styleable((props, ref) => (\n  \u003CStyledText ref={ref} {...props} \u002F>\n))\n\n\u002F\u002F Now this works:\nconst StyledCorrectWrapper = styled(CorrectWrapper, {\n  variants: {\n    bold: { true: { fontWeight: 'bold' } },\n  },\n})\n```\n\n### Adding Extra Props\n\nPass generic type argument for additional props:\n\n```tsx\ntype ExtraProps = { icon?: React.ReactNode }\n\nconst IconText = StyledText.styleable\u003CExtraProps>((props, ref) => {\n  const { icon, ...rest } = props\n  return (\n    \u003CXStack>\n      {icon}\n      \u003CStyledText ref={ref} {...rest} \u002F>\n    \u003C\u002FXStack>\n  )\n})\n```\n\n## accept Prop for Custom Components\n\nEnable token\u002Ftheme resolution on non-standard props:\n\n```tsx\n\u002F\u002F For SVG fill\u002Fstroke that should accept theme colors\nconst StyledSVG = styled(SVG, {}, {\n  accept: { fill: 'color', stroke: 'color' } as const,\n})\n\n\u002F\u002F Usage: \u003CStyledSVG fill=\"$blue10\" \u002F>\n\n\u002F\u002F For style objects (like ScrollView's contentContainerStyle)\nconst MyScrollView = styled(ScrollView, {}, {\n  accept: { contentContainerStyle: 'style' } as const,\n})\n\n\u002F\u002F Usage: \u003CMyScrollView contentContainerStyle={{ padding: '$4' }} \u002F>\n```\n\n**Important**: Use `as const` on the accept object.\n\n## Prop Order Matters\n\nIn `styled()`, prop order determines override priority:\n\n```tsx\n\u002F\u002F backgroundColor can be overridden by props\nconst Overridable = (props) => (\n  \u003CView backgroundColor=\"$red10\" {...props} width={200} \u002F>\n)\n\u002F\u002F width CANNOT be overridden (comes after spread)\n\n\u002F\u002F Variant order matters too:\n\u003CComponent scale={3} huge \u002F>  \u002F\u002F scale = 3 (scale comes first)\n\u003CComponent huge scale={3} \u002F>  \u002F\u002F scale = 2 (huge overrides)\n```\n\n## Anti-Patterns\n\n### Dynamic Styles Break Optimization\n\n```tsx\n\u002F\u002F BAD - breaks compiler optimization\n\u003CView style={{ width: someVariable * 2 }} \u002F>\n\u003CView backgroundColor={isDark ? '$gray1' : '$gray12'} \u002F>\n\n\u002F\u002F GOOD - use variants\nconst Box = styled(View, {\n  variants: {\n    dark: { true: { backgroundColor: '$gray1' }, false: { backgroundColor: '$gray12' } },\n  },\n})\n\u003CBox dark={isDark} \u002F>\n```\n\n### Inline Functions\n\n```tsx\n\u002F\u002F BAD - new function every render\n\u003CView onPress={() => handlePress(id)} \u002F>\n\n\u002F\u002F GOOD - stable reference\nconst handlePressCallback = useCallback(() => handlePress(id), [id])\n\u003CView onPress={handlePressCallback} \u002F>\n```\n\n### Wrong Import Paths\n\n```tsx\n\u002F\u002F These are different packages with different contents:\nimport { View } from 'tamagui'           \u002F\u002F Full UI kit\nimport { View } from '@tamagui\u002Fcore'     \u002F\u002F Core only (smaller)\nimport { Button } from '@tamagui\u002Fbutton' \u002F\u002F Individual component\n\n\u002F\u002F Pick one approach and be consistent\n```\n\n### Mixing RN StyleSheet with Tamagui\n\n```tsx\n\u002F\u002F BAD - StyleSheet values don't resolve tokens\nconst styles = StyleSheet.create({ box: { padding: 20 } })\n\u003CView style={styles.box} backgroundColor=\"$blue10\" \u002F>\n\n\u002F\u002F GOOD - all Tamagui\n\u003CView padding=\"$4\" backgroundColor=\"$blue10\" \u002F>\n```\n\n### Platform.OS Branching for Dialog\u002FSheet\n\n```tsx\n\u002F\u002F BAD - manual platform branching\nif (Platform.OS === 'web') {\n  return \u003CDialog>...\u003C\u002FDialog>\n}\nreturn \u003CSheet>...\u003C\u002FSheet>\n\n\u002F\u002F GOOD - use Adapt (see @DIALOG_PATTERNS.md)\n\u003CDialog>\n  \u003CDialog.Portal>...\u003C\u002FDialog.Portal>\n  \u003CAdapt when=\"sm\" platform=\"touch\">\n    \u003CSheet>\u003CAdapt.Contents \u002F>\u003C\u002FSheet>\n  \u003C\u002FAdapt>\n\u003C\u002FDialog>\n```\n\n## Fetching Current Documentation\n\nFor latest API details, fetch markdown docs directly:\n\n```bash\n# Core docs\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fconfiguration.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fstyled.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fvariants.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fdocs\u002Fcore\u002Fanimations.md\"\n\n# Component docs\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fui\u002Fsheet.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fui\u002Fdialog.md\"\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fui\u002Fselect.md\"\n\n# Full docs index\ncurl -sL \"https:\u002F\u002Ftamagui.dev\u002Fllms.txt\"\n```\n\nFor HTML pages, use the web-fetch skill with appropriate selectors.\n\n## Quick Reference\n\n### Config v4 Shorthands (Tailwind-aligned)\n\n| Shorthand | Property |\n|-----------|----------|\n| `bg` | backgroundColor |\n| `p` | padding |\n| `m` | margin |\n| `w` | width |\n| `h` | height |\n| `br` | borderRadius |\n\n### Media Query Breakpoints\n\n| Token | Default | Server Default |\n|-------|---------|----------------|\n| `$xs` | 660px | true |\n| `$sm` | 800px | false |\n| `$md` | 1020px | false |\n| `$lg` | 1280px | false |\n| `$xl` | 1420px | false |\n\n### Animation Drivers\n\n| Driver | Platform | Use Case |\n|--------|----------|----------|\n| `css` | Web | Default, best performance |\n| `react-native-reanimated` | Native | Required for native animations |\n\n## Additional Pattern Files\n\n- @DIALOG_PATTERNS.md - Dialog, Sheet, Adapt, accessibility\n- @FORM_PATTERNS.md - Form, Input, Label, validation with zod\n- @ANIMATION_PATTERNS.md - Animation drivers, enterStyle\u002FexitStyle\n- @OVERLAY_PATTERNS.md - Popover, Tooltip, Select\n- @COMPILER_PATTERNS.md - Compiler optimization details\n- @DESIGN_SYSTEM.md - Design tokens and theming\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill tamagui-best-practices",{"tool":51,"command":52},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill tamagui-best-practices",{"tool":54,"command":55},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill tamagui-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FSKILL.md",true,[59,65,69,73,77,81,85],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"ANIMATION_PATTERNS.md","REFERENCE","参考文档",6438,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FANIMATION_PATTERNS.md",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"COMPILER_PATTERNS.md",5023,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FCOMPILER_PATTERNS.md",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"DESIGN_SYSTEM.md",7490,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FDESIGN_SYSTEM.md",{"path":74,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":75,"sourceHtmlUrl":76},"DIALOG_PATTERNS.md",7682,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FDIALOG_PATTERNS.md",{"path":78,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":79,"sourceHtmlUrl":80},"FORM_PATTERNS.md",8701,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FFORM_PATTERNS.md",{"path":82,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":83,"sourceHtmlUrl":84},"OVERLAY_PATTERNS.md",11019,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002FOVERLAY_PATTERNS.md",{"path":86,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":87,"sourceHtmlUrl":88},"skill-report.json",49091,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F0xbigboss\u002Ftamagui-best-practices\u002Fskill-report.json",[90,99,108,117,123,129],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":31},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[96,97,98],"model","model hierarchy","model hierarchy skill",{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":31},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[105,106,107],"MCP","zoom","zoom mcp",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":31},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[114,115,116,106],"sdk","zoom apps sdk","apps",{"skillNo":118,"name":119,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":31},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[119],{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":31},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[125],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":31},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[131]]