mui-base

mui-base

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).

1星標
0分支
更新於 1/22/2026
SKILL.md
readonlyread-only
name
mui-base
description

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).

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 comp-
2 Naming Conventions HIGH name-
3 Organization HIGH org-
4 Error Handling HIGH err-
5 Style MEDIUM style-

Quick Reference

1. Component Patterns (CRITICAL)

  • comp-forward-ref-named - Use forwardRef with Named Function
  • comp-props-parameter-naming - Name Props Parameter componentProps
  • comp-use-render-element - Use useRenderElement for DOM Rendering
  • comp-context-undefined-default - Create Context with Undefined Default
  • comp-context-error-message - Context Error Messages with Hierarchy
  • comp-use-controlled - Use useControlled Hook for Dual Modes
  • comp-state-memoization - Memoize State Objects
  • comp-context-value-memo - Memoize Context Provider Values
  • comp-plain-function-root - Plain Function for Non-DOM Roots
  • comp-hook-namespace-exports - Hook Namespace Exports
  • comp-props-destructure-order - Props Destructuring Order
  • comp-use-client-directive - Add use client Directive

2. Naming Conventions (HIGH)

  • name-component-naming - Component Naming as ParentPart
  • name-file-matches-export - File Name Matches Primary Export
  • name-directory-kebab-case - Directory Naming kebab-case
  • name-part-directory-lowercase - Part Directory Naming lowercase
  • name-context-suffix - Context Naming with Suffix
  • name-context-hook - Context Hook as useComponentContext
  • name-props-interface - Props Interface as ComponentProps
  • name-state-interface - State Interface as ComponentState
  • name-namespace-type-exports - Namespace Type Exports
  • name-event-type - Event Type Naming Convention
  • name-constants - Constant Naming SCREAMING_SNAKE_CASE
  • name-data-attributes - Data Attribute Naming lowercase
  • name-hooks - Hook Naming with use Prefix
  • name-refs - Ref Variable Naming with Suffix
  • name-handlers - Handler Naming Convention

3. Organization (HIGH)

  • org-component-directory - Component Directory Structure
  • org-dual-barrel-exports - Dual Barrel Export Pattern
  • org-test-colocation - Test File Colocation
  • org-context-placement - Context File Placement
  • org-data-attributes-file - Data Attributes Documentation File
  • org-state-attributes-mapping - State Attributes Mapping File
  • org-css-vars-file - CSS Variables Documentation File
  • org-package-exports - Package-Level Wildcard Exports

4. Error Handling (HIGH)

  • err-dev-only-warnings - Development-Only Warnings
  • err-deduplicated-warnings - Deduplicated Warning Messages
  • err-message-prefix - Message Prefix Standard
  • err-context-error-guidance - Context Error Guidance
  • err-prop-validation-timing - Prop Validation Timing
  • err-cancelable-events - Cancelable Event Pattern
  • err-event-reason-constants - Event Reason Constants
  • err-typed-event-reasons - Type-Safe Event Reasons

5. Style (MEDIUM)

  • style-react-import - React Import as Namespace
  • style-internal-imports - Internal Import Paths
  • style-explicit-undefined - Explicit Undefined in Prop Types
  • style-default-values - Default Values in Destructuring
  • style-jsdoc-documentation - JSDoc Documentation

How to Use

Read individual reference files for detailed explanations and code examples:

Source

Extracted from MUI Base UI codebase on 2026-01-17.

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

You Might Also Like

Related Skills

cache-components

cache-components

137Kdev-frontend

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

vercel avatarvercel
獲取
component-refactoring

component-refactoring

128Kdev-frontend

Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring.

langgenius avatarlanggenius
獲取
web-artifacts-builder

web-artifacts-builder

47Kdev-frontend

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

anthropics avataranthropics
獲取
frontend-design

frontend-design

47Kdev-frontend

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

anthropics avataranthropics
獲取
react-modernization

react-modernization

28Kdev-frontend

Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.

wshobson avatarwshobson
獲取
tailwind-design-system

tailwind-design-system

28Kdev-frontend

Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.

wshobson avatarwshobson
獲取