chakra-ui

chakra-ui is a cursor rule for coding agents from sanjeed5/awesome-cursor-rules-mdc. It costs 2,128 tokens per session, scanned A, original, CC0-1.0.

A set of rules for using Chakra UI in React applications. Chakra UI is a library of ready-made interface components, such as buttons and forms, with support for themes and responsive layouts.

In plain words
What is it for?
Use it when building or reviewing React 18+ interfaces with Chakra UI. It guides installation, provider setup, theming, responsive design, component structure, accessibility, and performance.
Why use it?
It prevents inconsistent styling, missing setup, and compatibility problems between Chakra UI and React. It also keeps shared design choices in reusable theme settings.

Cursor rule

About the project

awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.

sanjeed5/awesome-cursor-rules-mdc · 3,571 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/chakra-ui
Clone the repo
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdc

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chakra-ui

README.md
[![agentmods](https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/chakra-ui.svg)](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/chakra-ui)
Your own site
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/chakra-ui"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/chakra-ui.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,128 This file is loaded in full into every session.
When invoked 2,128 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02128 $0.02128
Opus 5 $0.01064 $0.01064
Sonnet 5 $0.00426 $0.00426
Haiku 4.5 $0.00213 $0.00213

Measured 6d ago against content hash f919f2e17212, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

chakra-ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules-mdc/chakra-ui.mdc · 289 lines

How it starts

The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.

chakra-ui Best Practices

Chakra UI is our definitive choice for building accessible, design-system-driven React applications. Adhere to these guidelines for a consistent, maintainable, and performant codebase.

1. Core Setup & Dependencies

Always ensure correct installation and root provider setup for Chakra UI v2+ (React 18+).

❌ BAD: Incorrect or missing dependencies, old React versions.

// package.json (missing emotion/framer-motion)
"dependencies": {
  "@chakra-ui/react": "^2.x.x",
  "react": "^17.0.0" // Chakra v2 requires React 18+
}

// App.jsx (missing ChakraProvider)
function App() {
  return <HomePage />;
}

✅ GOOD: Use React 18+ and all required peer dependencies. Wrap your app with <ChakraProvider>.

// package.json
"dependencies": {
  "@chakra-ui/react": "^2.x.x",
  "@emotion/react": "^11.x.x",
  "@emotion/styled": "^11.x.x",
  "framer-motion": "^6.x.x", // or newer compatible versions
  "react": "^18.x.x",
  "react-dom": "^18.x.x"
}

// src/index.jsx or src/main.jsx
import { ChakraProvider } from '@chakra-ui/react';
import React from 'react';
import ReactDOM from 'react-dom/client'; // Use createRoot for React 18
import App from './App';
import theme from './theme'; // Import your custom theme

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <ChakraProvider theme={theme}>
      <App />
    </ChakraProvider>
  </React.StrictMode>,
);

2. Theming: Token-First & Recipes

Centralize your design system. Define semantic tokens and use defineRecipe for component variants.

2.1. Define Semantic Tokens

Avoid hardcoding values. Define colors, fonts, and spacing once with defineTokens.

❌ BAD: Inline hex codes or magic numbers.

<Box bg="#0FEE0F" p="16px" />

✅ GOOD: Use defineTokens and reference them via theme keys.

// src/theme/tokens.js
import { defineTokens } from "@chakra-ui/react";
export const tokens = defineTokens({
  colors: {
    primary: { value: "#0FEE0F" },
    secondary: { value: "#EE0F0F" },
  },
  space: {
    'md': { value: '16px' }
  },
});

// src/theme/index.js
import { extendTheme } from '@chakra-ui/react';
import { tokens } from './tokens';
const theme = extendTheme({ tokens });
export default theme;

// YourComponent.jsx
<Box bg="primary" p="md" />

Read the full file on GitHub · 289 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 289 lines · 0 tokens per session scan A f919f2e17212

Subscribe to this mod's changes

chakra-ui is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 2,128 tokens to every session, about $0.0106 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.