JSON Schema metadata for PatternFly React components, providing structured validation and documentation for component props.
npm install @patternfly/patternfly-component-schemas
This package uses a split structure for optimal performance and modularity:
@patternfly/patternfly-component-schemas/
├── components/
│ ├── AboutModal/
│ │ ├── schema.json # JSON Schema for AboutModal props
│ │ └── index.js # Component metadata exports
│ ├── Button/
│ │ ├── schema.json
│ │ └── index.js
│ ├── Alert/
│ │ ├── schema.json
│ │ └── index.js
│ └── ... (462 total components)
├── scripts/
│ └── generate-schemas.js # Generation script
├── index.js # Main export file
├── component-metadata.json # Source metadata (dev only)
└── package.json
This package is specifically designed for AI-assisted development tools and Model Context Protocol (MCP) servers. AI systems can consume these schemas to:
- Understand component structure and available props
- Validate component usage in generated code
- Provide intelligent suggestions for prop values
- Generate documentation and examples
- Assist with component selection based on requirements
// MCP servers can load and query component schemas
import { componentNames, getComponentSchema } from 'patternfly-component-schemas';
// Discover available components
const components = componentNames; // 462 PatternFly components
// Get detailed component information
const buttonSchema = await getComponentSchema('Button');
// Returns: { schema, componentName, propsCount, requiredProps }
- "What props does the Button component accept?" → AI reads Button schema
- "Generate a PatternFly Alert component" → AI uses Alert schema for validation
- "Show me all navigation components" → AI filters components by name/description
- "Create a form with proper PatternFly components" → AI selects appropriate form components
# Install dependencies
npm install
# Regenerate schemas from metadata
npm run build
# Clean and rebuild
npm run rebuild
The package is generated from component-metadata.json
which contains the raw PatternFly component metadata for the latest release. This file is included in the git repository for development but excluded from the NPM package.
📋 Manual Process (Current)
- Clone https://github.com/patternfly/patternfly-doc-core
- Run
npm run build:props
in the doc-core directory - Copy
dist/props.json
content tocomponent-metadata.json
of this repo - Run
npm run build
to regenerate schemas - Commit with:
feat(components): sync with PatternFly vX.X.X
- Push to
main
→ automatic release triggers 🚀
🔮 Future Automation
- Dependency management via Renovate/Dependabot
- Automated PRs for PatternFly quarterly releases
- Human-in-the-loop review for component updates
- 462 PatternFly components with JSON Schema validation
- Individual exports for tree-shaking optimization
- TypeScript-friendly prop definitions
- Enum validation for variant props
- Required prop indicators
- Default value documentation
This package is specifically designed for:
- AI/LLM consumption via Model Context Protocol
- IDE autocompletion and IntelliSense
- Component validation and linting
- Documentation generation
- Form builders and UI tools
- Code generation assistants
MIT
This package uses semantic-release for automated versioning and publishing based on conventional commits.
Follow Conventional Commits specification:
<type>[optional scope]: <description>
Examples:
feat: add new component schemas
fix: correct required props validation
docs: update installation instructions
chore: update dependencies
- Push commits to
main
branch using conventional format - GitHub Actions runs CI and tests
- Semantic-release analyzes commits and publishes to NPM
- GitHub releases created automatically
- Fork the repository
- Create a feature branch
- Update
component-metadata.json
with your changes - Run
npm run build
to regenerate schemas - Commit using conventional commit format
- Submit a pull request
# Install dependencies
npm install
# Build schemas
npm run build
# Watch for changes
npm run dev
# Clean and rebuild
npm run rebuild
Generated schemas follow JSON Schema Draft 2020-12 specification.