mui-base
Original:🇺🇸 English
Translated
MUI Base UI style guidelines for building headless React component libraries (formerly headless-ui-style). This skill should be used when creating unstyled UI components, compound components with render props, accessibility-first patterns, or component libraries that separate logic from styling. Extracted from the MUI Base UI codebase (github.com/mui/base-ui).
32installs
Sourcepproenca/dot-skills
Added on
NPX Install
npx skill4agent add pproenca/dot-skills mui-baseTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →MUI Headless UI Best Practices
Comprehensive style guide for building headless React component libraries following MUI Base UI patterns. Contains 48 rules across 5 categories, prioritized by impact.
When to Apply
Reference these guidelines when:
- Building headless/unstyled component libraries
- Creating compound components with context-based composition
- Implementing accessible UI primitives with ARIA patterns
- Using render props and className callbacks for styling flexibility
- Writing components that support both controlled and uncontrolled modes
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Component Patterns | CRITICAL | |
| 2 | Naming Conventions | HIGH | |
| 3 | Organization | HIGH | |
| 4 | Error Handling | HIGH | |
| 5 | Style | MEDIUM | |
Quick Reference
1. Component Patterns (CRITICAL)
- - Use forwardRef with Named Function
comp-forward-ref-named - - Name Props Parameter componentProps
comp-props-parameter-naming - - Use useRenderElement for DOM Rendering
comp-use-render-element - - Create Context with Undefined Default
comp-context-undefined-default - - Context Error Messages with Hierarchy
comp-context-error-message - - Use useControlled Hook for Dual Modes
comp-use-controlled - - Memoize State Objects
comp-state-memoization - - Memoize Context Provider Values
comp-context-value-memo - - Plain Function for Non-DOM Roots
comp-plain-function-root - - Hook Namespace Exports
comp-hook-namespace-exports - - Props Destructuring Order
comp-props-destructure-order - - Add use client Directive
comp-use-client-directive
2. Naming Conventions (HIGH)
- - Component Naming as ParentPart
name-component-naming - - File Name Matches Primary Export
name-file-matches-export - - Directory Naming kebab-case
name-directory-kebab-case - - Part Directory Naming lowercase
name-part-directory-lowercase - - Context Naming with Suffix
name-context-suffix - - Context Hook as useComponentContext
name-context-hook - - Props Interface as ComponentProps
name-props-interface - - State Interface as ComponentState
name-state-interface - - Namespace Type Exports
name-namespace-type-exports - - Event Type Naming Convention
name-event-type - - Constant Naming SCREAMING_SNAKE_CASE
name-constants - - Data Attribute Naming lowercase
name-data-attributes - - Hook Naming with use Prefix
name-hooks - - Ref Variable Naming with Suffix
name-refs - - Handler Naming Convention
name-handlers
3. Organization (HIGH)
- - Component Directory Structure
org-component-directory - - Dual Barrel Export Pattern
org-dual-barrel-exports - - Test File Colocation
org-test-colocation - - Context File Placement
org-context-placement - - Data Attributes Documentation File
org-data-attributes-file - - State Attributes Mapping File
org-state-attributes-mapping - - CSS Variables Documentation File
org-css-vars-file - - Package-Level Wildcard Exports
org-package-exports
4. Error Handling (HIGH)
- - Development-Only Warnings
err-dev-only-warnings - - Deduplicated Warning Messages
err-deduplicated-warnings - - Message Prefix Standard
err-message-prefix - - Context Error Guidance
err-context-error-guidance - - Prop Validation Timing
err-prop-validation-timing - - Cancelable Event Pattern
err-cancelable-events - - Event Reason Constants
err-event-reason-constants - - Type-Safe Event Reasons
err-typed-event-reasons
5. Style (MEDIUM)
- - React Import as Namespace
style-react-import - - Internal Import Paths
style-internal-imports - - Explicit Undefined in Prop Types
style-explicit-undefined - - Default Values in Destructuring
style-default-values - - JSDoc Documentation
style-jsdoc-documentation
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- Example: comp-forward-ref-named
- Example: org-component-directory
Source
Extracted from MUI Base UI codebase on 2026-01-17.
Full Compiled Document
For the complete guide with all rules expanded:
AGENTS.md