Implement frontend designs from figma using Chakra UI v3 and Storybook
92
92%
Does it follow best practices?
Impact
92%
1.64xAverage score across 6 eval scenarios
Advisory
Suggest reviewing before use
Build generic, reusable UI components that extend Chakra UI v3 or fill gaps where Chakra has no built-in solution. These are Tier 1 components — they have no page-specific logic, no business logic, and can be dropped into any page. For form field components, see FORM_FIELDS.md.
Before building anything:
src/components/ui/ for existing low-level primitives (Provider, ColorMode, Prose, Toaster).src/components/ for shared components that may already solve the problem.src/components/form/ for existing form field components (TextField, TextareaField, CheckboxField, ComboboxField, etc.).If something close exists, extend it with new props or variants rather than building from scratch.
Before writing code, define:
StatusBadge not GreenPill.HTMLChakraProps or BoxProps for flexibility.variant="outline" | "solid").Card + Card.Header + Card.Body).p, bg, color, etc.) via ...rest spread.as or asChild patterns — allow consumers to change the rendered element when appropriate.Create the component in src/components/ in its own PascalCase folder:
src/components/MyComponent/
├── MyComponent.tsx
└── MyComponent.stories.tsx@chakra-ui/react.~/* alias for project-internal imports (e.g., import { MyComponent } from '~/components/MyComponent').Translate all styles into Chakra style props. Never mix Tailwind and Chakra. See ../building-composite-components/TOKENS.md for the full Tailwind-to-Chakra mapping and all available tokens.
Every visual property must use design tokens — never hardcode hex codes, pixel values, or font names.
Key rules:
fg, fg.muted, bg.muted, border.muted, etc.). When a Figma color has no matching token, add a new semantic token to src/components/ui/Provider.tsx."1" = 4px, "2" = 8px, "4" = 16px, etc.).fontSize, fontWeight, and lineHeight props with named scale values.l1 (4px) and l2 (6px).import { Box, type BoxProps } from '@chakra-ui/react';
export interface MyComponentProps extends BoxProps {
/** Brief description of what this prop controls */
variant?: 'default' | 'outline';
}
export function MyComponent({
variant = 'default',
children,
...rest
}: MyComponentProps) {
return (
<Box
borderRadius="l2"
bg={variant === 'outline' ? 'transparent' : 'bg.muted'}
borderWidth={variant === 'outline' ? '1px' : undefined}
borderColor="border.muted"
{...rest}
>
{children}
</Box>
);
}Every low-level component must have a .stories.tsx file co-located next to it. Stories are the primary way to verify and document these components.
See STORY_TEMPLATES.md for full story templates (UI components and form fields) and the list of required story variants.
bun run storybook -- -p 6XXX from apps/frontend, where 6XXX is a random port in the 6000–6999 range.bun run build-storybookUse playwright-cli for browser-based verification:
playwright-cli snapshot <storybook-url> — verify rendered structure.playwright-cli screenshot <storybook-url> — capture visual output. If building from a Figma design, compare against the Figma screenshot.Use Chrome DevTools MCP to inspect live rendered output:
getStyles to verify computed styles use Chakra tokens, not hardcoded values.evaluate to read CSS custom property values.API Quality:
...restDesign Token Compliance:
Stories:
parameters.backgrounds set to { default: 'dark' }Form Fields (if applicable):
useFieldContext and FormFieldWrapperfield.handleChange and field.handleBlur~/lib/form/form-hooksForm contextComponents/Form/ title prefixVisual Verification: