Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aurelienbobenrieth/gadget/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheRuleCard component displays a summary of an ESLint rule with its severity, scope, fixability status, and description. Designed for rule listing pages with hover effects and clickable navigation.
Import
Basic Usage
Props
The name of the ESLint rule (displayed in monospace font).
A brief description of what the rule does.
The severity level of the rule:
"error", "warn", "suggestion", or "off".The scope where the rule applies:
"action", "cross-cutting", "global-action", "model-action", or "route".Whether the rule has an automatic fixer. Displays a green “fixable” badge when true.
The URL to navigate to when the card is clicked.
Additional CSS classes to apply.
HTMLAttributes<HTMLAnchorElement>, so all standard anchor attributes are supported.
Rule Scopes
TheRuleScope type defines where a rule applies:
action- General action codecross-cutting- Multiple contextsglobal-action- Global action functionsmodel-action- Model-specific actionsroute- Route handlers
Design Details
- Renders as an anchor (
<a>) element for navigation - Card background and border change on hover
- Smooth transitions (150ms duration)
- Three badges displayed: severity, scope, and optionally fixable
- Rule name in monospace font (12px/xs)
- Description in muted color with relaxed leading
- No underline on the link (uses
no-underlineclass)
Examples
Error Rule with Fixer
Warning Rule
Rule Grid Layout
Hover Effects
When hovering over the card:- Border changes to accent color with muted opacity
- Shadow elevation increases (shadow-raised)
- Smooth transition applied
Type Exports
The component exports theRuleScope type:
Component Definition
Location:packages/gadget-ui/src/components/rule-card.tsx:19
The component uses Card, CardHeader, CardTitle, CardContent, SeverityBadge, and Badge components internally.