xiaohongshu
xiaohongshu
mantine-reviewing
Review React components using Mantine UI library for accessibility, Styles API correctness, component patterns, and common pitfalls. Use when reviewing Mantine code or before merging Mantine-based PRs.
Full skill instructions
Review React components using Mantine UI library for accessibility compliance, Styles API correctness, component pattern adherence, and common pitfall detection.
mantine-developing skill instead)# Find files using Mantine
grep -r "from '@mantine" --include="*.tsx" --include="*.ts" -l
# TypeScript errors
npm run typecheck
# Lint issues
npm run lint
# Check for common issues
grep -rn "disabled.*Tooltip\|Tooltip.*disabled" --include="*.tsx"
grep -rn "Accordion\.Control.*Button\|Button.*Accordion\.Control" --include="*.tsx"
grep -rn "ActionIcon[^>]*>" --include="*.tsx" | grep -v "aria-label"
Use CHECKLIST.md for comprehensive review criteria.
Format findings by severity:
Must check:
// ❌ FAIL: Missing aria-label on icon button
<ActionIcon onClick={handleSearch}>
<IconSearch />
</ActionIcon>
// ✅ PASS: Has aria-label
<ActionIcon aria-label="Search" onClick={handleSearch}>
<IconSearch />
</ActionIcon>
Review for:
ActionIcon components have aria-labelCloseButton have aria-label or parent has closeButtonLabelorder prop on Accordion)Invalid HTML - browsers will break layout:
// ❌ FAIL: Button inside button (Accordion.Control is a button)
<Accordion.Control>
Click here <Button>Delete</Button>
</Accordion.Control>
// ✅ PASS: Button outside Control
<Group>
<Accordion.Control style={{ flex: 1 }}>Click here</Accordion.Control>
<Button>Delete</Button>
</Group>
Check all:
Accordion.Control has no Button, ActionIcon, or Link childrenButton has no interactive childrenUnstyledButton has no interactive childrenCheck for anti-patterns:
// ❌ FAIL: Inline style only affects root
<Button style={{ color: 'red' }}>Text won't be red</Button>
// ❌ FAIL: !important hack
<Button className="my-button">...</Button>
.my-button span { color: red !important; }
// ✅ PASS: Correct Styles API usage
<Button styles={{ label: { color: 'red' } }}>Red text</Button>
<Button classNames={{ label: classes.redLabel }}>Red text</Button>
Review for:
classNames or styles prop for inner elements!important in CSS targeting Mantine componentsTooltip won't show on truly disabled elements:
// ❌ FAIL: Tooltip invisible
<Tooltip label="Cannot submit">
<Button disabled>Submit</Button>
</Tooltip>
// ✅ PASS: Use data-disabled
<Tooltip label="Cannot submit">
<Button data-disabled onClick={(e) => e.preventDefault()}>
Submit
</Button>
</Tooltip>
Direct children only:
// ❌ FAIL: Wrapped children break styling
<ActionIcon.Group>
<div><ActionIcon><IconEdit /></ActionIcon></div>
</ActionIcon.Group>
// ✅ PASS: Direct ActionIcon children
<ActionIcon.Group>
<ActionIcon aria-label="Edit"><IconEdit /></ActionIcon>
<ActionIcon aria-label="Delete"><IconTrash /></ActionIcon>
</ActionIcon.Group>
// When value MUST be from list → Select
<Select data={countries} />
// When free text is acceptable → Autocomplete
<Autocomplete data={suggestions} />
Review for correct component choice based on requirements.
Prefer @mantine/form over manual state:
// ❌ Suboptimal: Manual state for each field
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
// ✅ Better: useForm hook
const form = useForm({
initialValues: { email: '', password: '' },
validate: { email: (v) => ... }
});
<TextInput {...form.getInputProps('email')} />
Review for:
useForm for forms with validationgetInputProps for input bindingtype: 'checkbox' for checkbox/switch inputs// ❌ FAIL: Hardcoded colors break dark mode
<Box style={{ background: 'white', color: 'black' }}>
// ✅ PASS: Theme-aware colors
<Box style={{
background: 'light-dark(white, var(--mantine-color-dark-7))',
color: 'light-dark(black, white)'
}}>
// ✅ PASS: Theme color references
<Box bg="gray.0" c="dark.9">
Check for:
useMemo/useCallback for expensive operations// ❌ FAIL: New object every render
<Button styles={{ root: { padding: 10 } }}>
// ✅ PASS: Stable reference
const buttonStyles = { root: { padding: 10 } };
<Button styles={buttonStyles}>
// ✅ PASS: Or use CSS modules
<Button classNames={{ root: classes.button }}>
// When using component prop, ref type changes
const buttonRef = useRef<HTMLButtonElement>(null); // Default
const linkRef = useRef<HTMLAnchorElement>(null); // With component="a"
<Button ref={buttonRef}>Button</Button>
<Button component="a" ref={linkRef} href="/">Link</Button>
Review for TypeScript errors related to ref types.
## Mantine Code Review: [Component/File]
### Summary
[1-2 sentence overview]
### Critical Issues
- [ ] [Issue description] - [file:line]
### High Priority
- [ ] [Issue description] - [file:line]
### Medium Priority
- [ ] [Issue description] - [file:line]
### Low Priority / Suggestions
- [ ] [Suggestion]
### Accessibility Audit
- [ ] All icon buttons have aria-label
- [ ] No nested interactive elements
- [ ] Keyboard navigation works
- [ ] Focus states visible
### Styles API Audit
- [ ] No !important hacks
- [ ] Correct selector usage
- [ ] Theme-aware colors
### Passed Checks
- [x] [What's good about the code]
# Find missing aria-labels on ActionIcon
grep -rn "ActionIcon" --include="*.tsx" | grep -v "aria-label"
# Find potential nested interactives
grep -rn "Accordion\.Control" -A5 --include="*.tsx" | grep -E "Button|ActionIcon|Link"
# Find disabled buttons in tooltips
grep -rn "Tooltip" -A3 --include="*.tsx" | grep "disabled"
# Find hardcoded colors
grep -rn "style={{" --include="*.tsx" | grep -E "color:|background:|bg:"
# Find inline style objects (potential perf issue)
grep -rn "styles={{" --include="*.tsx"
Related skills:
mantine-developing - Development patterns and guidancehermes-code-reviewer - General TypeScript reviewFor detailed checklist: See CHECKLIST.md
For comprehensive React + Mantine UI guidance that coordinates this and other Mantine skills, use the mantine-ui-expert agent.
Cost Optimization: Use model="haiku" when invoking this agent for routine code reviews. Haiku is sufficient for pattern matching and Styles API validation.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience