chakra
БесплатноБез исполняемых скриптовНе проверенHow to use the Chakra component library for React. Use when working on a React+Chakra codebase.
от elentok★ 25 звёзд на GitHubОб этом скилле
Chakra UI v3 Highlights
Key API Changes (v2 → v3)
- Compound components with dot notation:
Dialog.Root,Dialog.Content, etc. - No more
forwardRef(React 19 —refis a regular prop) colorPalettereplacescolorSchemeNativeSelectreplacesSelectfor simple selectsField.Root/Field.Label/Field.ErrorTextreplacesFormControl
Style Props
<Box bg="blue.500" color="white" p="4" rounded="lg" shadow="md" _hover={{ bg: 'blue.600' }}>
Common: bg, color, p/px/py, m/mx/my, w/h, rounded, shadow, gap, display
Layout
<Flex gap="4" justify="space-between" align="center">
<Grid templateColumns="repeat(3, 1fr)" gap="4">
<HStack gap="4"> / <VStack gap="4">
<Stack gap="4"> // vertical by default
<Center h="100vh">
<Container maxW="6xl">
Responsive Styles
// Object syntax (preferred)
<Box fontSize={{ base: 'sm', md: 'md', lg: 'lg' }} p={{ base: '2', md: '4' }}>
// Array syntax (mobile-first)
<Box fontSize={['sm', 'md', 'lg']}>
Breakpoints: base 0px · sm 480px · md 768px · lg 992px · xl 1280px
Common Components
Button
<Button colorPalette="blue">Solid</Button>
<Button colorPalette="blue" variant="outline">Outline</Button>
<Button colorPalette="blue" variant="ghost">Ghost</Button>
<Button loading loadingText="Saving...">Submit</Button>
Forms
<Field.Root invalid>
<Field.Label>Email</Field.Label>
<Input placeholder="..." />
<Field.ErrorText>Required</Field.ErrorText>
</Field.Root>
Dialog (Modal)
<Dialog.Root open={open} onOpenChange={(e) => setOpen(e.open)}>
<Dialog.Trigger asChild>
<Button>Open</Button>
</Dialog.Trigger>
<Portal>
<Dialog.Backdrop />
<Dialog.Positioner>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Title</Dialog.Title>
</Dialog.Header>
<Dialog.Body>...</Dialog.Body>
<Dialog.Footer>
<Dialog.ActionTrigger asChild>
<Button variant="outline">Cancel</Button>
</Dialog.ActionTrigger>
<Button colorPalette="blue">Confirm</Button>
</Dialog.Footer>
<Dialog.CloseTrigger />
</Dialog.Content>
</Dialog.Positioner>
</Portal>
</Dialog.Root>
Menu
<Menu.Root>
<Menu.Trigger asChild>
<Button>Actions</Button>
</Menu.Trigger>
<Portal>
<Menu.Positioner>
<Menu.Content>
<Menu.Item value="edit">Edit</Menu.Item>
<Menu.Separator />
<Menu.Item value="delete" color="red.500">
Delete
</Menu.Item>
</Menu.Content>
</Menu.Positioner>
</Portal>
</Menu.Root>
Tabs
<Tabs.Root defaultValue="tab1">
<Tabs.List>
<Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
<Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
</Tabs.List>
<Tabs.Content value="tab1">...</Tabs.Content>
</Tabs.Root>
Theming
// theme.ts
import { createSystem, defaultConfig, defineConfig } from '@chakra-ui/react'
const config = defineConfig({
theme: {
tokens: {
colors: { brand: { 500: { value: '#0073e6' }, ... } },
fonts: { heading: { value: 'Inter, sans-serif' } },
},
semanticTokens: {
colors: {
brand: {
solid: { value: '{colors.brand.500}' }, // bg for solid buttons
contrast: { value: 'white' }, // text on solid bg
fg: { value: '{colors.brand.700}' }, // foreground text
muted: { value: '{colors.brand.100}' },
subtle: { value: '{colors.brand.50}' },
emphasized: { value: '{colors.brand.200}' }, // hover states
focusRing: { value: '{colors.brand.500}' },
},
},
},
},
})
export const system = createSystem(defaultConfig, config)
Prefer brand.subtle / brand.fg over raw brand.500 for dark-mode compatibility.
Design System Discipline
No color, font size, spacing, or radius literal lives in component code — every visual value is a
token, referenced by name. This isn't a style preference; untokenized values are how a codebase ends
up with 60+ one-off rgba()s and 8 near-identical border-radii that nobody can safely change. One
theme/ module (or theme.ts) is the single source of truth.
Two token layers, never collapsed:
- Primitive — raw values (
gray.50…900, an accent ramp, a spacing scale, named font sizes). Primitives are referenced only by semantic tokens and recipes, never by components. - Semantic — role names (
bg.canvas,fg.muted,accent.solid,danger) mapped onto primitives viadefineSemanticTokens. Components reference semantic tokens only. This is what makes re-skinning or adding a light mode a one-file edit to the mapping, not a component rewrite. For a mode-aware app, map each semantic token per mode in one place:const dual = (light: string, dark: string) => ({ value: { _light: `{colors.primitive.${light}}`, _dark: `{colors.
Установить chakra в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл chakra?
How to use the Chakra component library for React. Use when working on a React+Chakra codebase.
Как установить скилл chakra?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл chakra запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic