react-chakra-ui-cursorrules-prompt-file — Cursor rule
A Cursor rule for React projects using Chakra UI, covering component style, theming, responsive layouts, accessibility, and project structure.
.cursor/rules/react-chakra-ui-cursorrules-prompt-file.mdcWhat react-chakra-ui-cursorrules-prompt-file does
This rule gives Cursor guidance for React work with Chakra UI. It favors functional components with hooks, places ChakraProvider at the application root, and uses Chakra UI components for the interface. It also calls for a custom theme, responsive styles based on Chakra UI breakpoints, and Chakra UI hooks where they fit.
The suggested layout puts components/, pages/, theme/, hooks/, and utils/ under src/. The theme area includes index.js, foundations/, and components/. The instructions ask for TypeScript, component composition, built-in accessibility support, semantic HTML through the as prop, color mode for dark mode, and Chakra UI layout components.
The rule uses globs: **/*, while alwaysApply: false keeps it from being active at all times. That setting matters when checking why its guidance is not present in every Cursor interaction.
What it helps with
- build React components with Chakra UI
- create a brand-specific Chakra UI theme
- apply responsive breakpoint styles
- organize source files under
src/ - add dark mode with Chakra UI color mode
Example prompts for the agent
- Create a functional React component with hooks and Chakra UI components.
- Set up the Chakra UI theme in
src/theme/index.jsand add responsive breakpoints. - Organize the code under
src/components/,src/pages/,src/hooks/, andsrc/utils/.
How to install react-chakra-ui-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/react-chakra-ui-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/react-chakra-ui-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/react-chakra-ui-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/react-chakra-ui-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/react-chakra-ui-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about react-chakra-ui-cursorrules-prompt-file
How do I install react-chakra-ui-cursorrules-prompt-file in Cursor?
Create .cursor/rules/react-chakra-ui-cursorrules-prompt-file.mdc and place the rule in that file.
What does react-chakra-ui-cursorrules-prompt-file do?
It guides Cursor while building React interfaces with Chakra UI. Its guidance covers components, theming, responsive design, accessibility, and folder layout.
Why is the rule not always active?
Its settings contain alwaysApply: false, so Cursor does not keep it active for every interaction. The globs: **/* pattern still covers every path when Cursor applies rules by glob.
Source text
react-chakra-ui-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for React development with Chakra UI integration."
globs: **/*
alwaysApply: false
---
// React + Chakra UI .cursorrules
// Prefer functional components with hooks
const preferFunctionalComponents = true;
// Chakra UI best practices
const chakraUIBestPractices = [
"Use ChakraProvider at the root of your app",
"Utilize Chakra UI components for consistent design",
"Implement custom theme for brand-specific styling",
"Use responsive styles with the Chakra UI breakpoint system",
"Leverage Chakra UI hooks for enhanced functionality",
];
// Folder structure
const folderStructure = `
src/
components/
pages/
theme/
index.js
foundations/
components/
hooks/
utils/
`;
// Additional instructions
const additionalInstructions = `
1. Use TypeScript for type safety with Chakra UI components
2. Implement proper component composition using Chakra UI
3. Utilize Chakra UI's built-in accessibility features
4. Use the 'as' prop for semantic HTML rendering
5. Implement dark mode using Chakra UI's color mode
6. Use Chakra UI's layout components for responsive design
7. Follow Chakra UI best practices for performance optimization
`;
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules