一键导入
chakra
How to use the Chakra component library for React. Use when working on a React+Chakra codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How to use the Chakra component library for React. Use when working on a React+Chakra codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Author a teach workspace's lessons/reference/index in markdown and build both the browsable HTML site and a phone-friendly EPUB from that one source.
A relentless interview that asks every frontier question at once, round by round.
Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker — edges as text in one file per ticket locally, or native blocking links on a real tracker.
Print the relevant text as raw copy-able markdown and copy it to the clipboard. Run `/markdown file` to copy it as a file reference instead, for pasting into Slack.
Move issues and external PRs through a state machine of triage roles — categorise, verify, grill if needed, and write agent-ready briefs.
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
| name | chakra |
| description | How to use the Chakra component library for React. Use when working on a React+Chakra codebase. |
Dialog.Root, Dialog.Content, etc.forwardRef (React 19 — ref is a regular prop)colorPalette replaces colorSchemeNativeSelect replaces Select for simple selectsField.Root / Field.Label / Field.ErrorText replaces FormControl<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
<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">
// 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
<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>
<Field.Root invalid>
<Field.Label>Email</Field.Label>
<Input placeholder="..." />
<Field.ErrorText>Required</Field.ErrorText>
</Field.Root>
<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.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.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>
// 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.
import { defineRecipe, defineSlotRecipe } from "@chakra-ui/react"
// Single element
const buttonRecipe = defineRecipe({
base: { display: "inline-flex", rounded: "lg" },
variants: {
visual: {
solid: { bg: "brand.500", color: "white", _hover: { bg: "brand.600" } },
outline: { border: "2px solid", borderColor: "brand.500" },
},
size: {
sm: { h: "8", px: "3", fontSize: "sm" },
md: { h: "10", px: "4", fontSize: "md" },
},
},
defaultVariants: { visual: "solid", size: "md" },
})
// Multi-part component
const cardRecipe = defineSlotRecipe({
slots: ["root", "header", "body", "footer"],
base: { root: { bg: "white", rounded: "xl", shadow: "md" } },
variants: { variant: { elevated: { root: { shadow: "xl" } } } },
})
Dialog.Root, Menu.Content, etc.)brand.solid) not raw values (brand.500) for theme flexibility
recipes for component variants — not inline conditionals