Skip to main content

Patterns: Quick Reference

Detailed rules live in docs/patterns/*.md. Load the matching context group (patterns-styling, patterns-components, patterns-review) from docs/AI_INDEX.md when you need the full rules.

TaskApproach
Add spacingUse utility class: className="mb-4 px-2" (n * 4px)
Use a colorUse utility class: className="text-primary bg-success"
Set font sizeUse utility class: className="fs-lg fw-bold"
Add a borderUse utility class: className="bordered border-bottom"
Make something flexclassName="d-flex align-items-center justify-content-between"
Apply dynamic stylestyle={{ width: computedValue }} with useTheme() for tokens
Customize an antd componentAdd to antd-overrides.less or use existing modifier classNames
Add a new design tokenDefine as @var in variables.less, add to :root block if needed in JS
Add component-specific stylesCreate/extend a .less file in components/, use baseClassName pattern
Define a new constantAdd to the appropriate file in src/constants/, UPPER_SNAKE_CASE
Build conditional classesUse classnames package: className={classNames('base', { 'modifier': condition })}
Fetch dataRTK Query: add endpoint to the domain's *Api.js, use generated hook
Manage local stateuseState (always), never useReducer
Create a formForm.useForm() with Ant Design's <Form> and <Form.Item>