tamagui
БесплатноБез исполняемых скриптовНе проверенUniversal React UI framework for web and native with flat conditional values. Use when building cross-platform apps with Tamagui, writing styled components…
от tamagui★ 14 322 звезды на GitHubОб этом скилле
Tamagui Skill
Universal React UI framework for web and native. In v3, conditions are flat clauses in the style value, tokens and themes are bare names, and nested condition props such as hoverStyle are removed.
1. Project Configuration First
Before writing Tamagui code, generate or read the project prompt:
npx tamagui generate-prompt
This writes tamagui-prompt.md containing the project's exact token names, theme keys, media breakpoints, shorthands, and components. In an existing app, always inspect and use the project's local component wrappers first before importing from raw packages.
2. Flat Value Grammar
Every conditional style value follows this grammar:
value := base? clause*
clause := modifier(:modifier)*:payload
- Modifiers chain left-to-right:
dark:hover:navyapplies when both dark and hover match. - Payloads extend to the next top-level clause or end of string.
- An empty payload is invalid. Clear a property with
none,transparent,initial, orunset. - Do not author raw
transformstrings with clauses; use atomic transform props (scale,rotate,x,y).
Supported Modifiers
- Interaction:
hover:,press:,focus:,focus-visible:,focus-within:,disabled: - Media: configured keys such as
sm:(min-width),max-sm:(max-width),md:,max-md: - Theme:
dark:,light:, and configured theme names - Platform:
web:,native:,ios:,android: - Group:
group-hover:,group-hover/name:,group-press/name: - Container:
@sm:,@sm/name:(measures nearest query container) - Presence:
enter:,exit:(requirestransition=)
Rules
- No
$sigil: tokens and theme names are bare:bg="background",p="4", notbg="$background". - Kebab theme names: built-in theme keys use kebab-case:
background-hover,background-press,border-color,border-color-hover,placeholder-color,shadow-color. - Numbers are px: a quoted number string
p="4"resolves the configured space token. A raw numeric literalp={4}is literal 4px on web or 4 points on native. - Specificity precedence ladder: when multiple clauses match, the winner is decided by specificity, not authored order:
- Platform rank (
ios:>native:> bare) - Condition count (more conditions win)
- Category rank: media (1) < container (65) < theme (129) < group (161) < state (225)
- Authored order breaks exact ties only.
- A chain supports at most five distinct non-platform conditions.
- Platform rank (
3. Style Value Syntax
Tamagui supports both string and object syntax. Projects can configure settings.styleValueSyntax to enforce one form.
String Form
import { View } from 'tamagui'
export function Demo() {
return (
<View
bg="background hover:background-hover dark:blue-500"
p="4 sm:6 max-sm:2"
w="100% md:50%"
opacity="web:0.9"
scale="1 enter:0.9 exit:0.9"
transition="quick"
/>
)
}
Object Form
import { View } from 'tamagui'
export function Demo() {
return (
<View
bg={{ default: 'background', hover: 'background-hover', dark: 'blue-500' }}
p={{ default: '4', sm: '6', 'max-sm': '2' }}
w={{ default: '100%', md: '50%' }}
opacity={{ web: 0.9 }}
scale={{ default: 1, enter: 0.9, exit: 0.9 }}
transition="quick"
/>
)
}
4. Shorthands vs Longhands
Check onlyAllowShorthands in tamagui-prompt.md. Under stock v6 it is true, meaning longhand property names are removed from types and will cause type errors. Always author using shorthands:
p,px,py,pt,pb,pl,pr: paddingm,mx,my,mt,mb,ml,mr: marginw,h,minW,maxW,minH,maxH: dimensionsbg: backgroundcolor: text color (unshortened in v6)rounded: border radiusitems: align itemsjustify: justify content
5. Control Sizes
With the v6 config, controls (Button, Input, Select, etc.) accept named sizes: xs, sm, md, lg, xl. The default is md.
import { Button, YStack } from 'tamagui'
export function Buttons() {
return (
<YStack gap="2">
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
</YStack>
)
}
Use named recipes for control sizes. Legacy token keys such as size="4" remain supported, but use the old height-based sizing model. Spinner has its own small and large sizes.
6. Groups and Containers
Declare group and container as props on the parent, then target them in children:
import { Text, View } from 'tamagui'
export function CardGroup() {
return (
<View group="card" container="card">
<Text color="color group-hover/card:color-focus @sm/card:color">Card title</Text>
</View>
)
}
7. Animations and Presence
The v3 animation prop is transition (not animation). For enter and exit transitions, specify enter: and exit: c
Установить tamagui в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tamagui?
Universal React UI framework for web and native with flat conditional values. Use when building cross-platform apps with Tamagui, writing styled components, or applying tokens, themes, animations, and media queries.
Как установить скилл tamagui?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tamagui запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic