
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@patternfly/patternfly-component-schemas
Advanced tools
JSON Schema and Zod schema metadata for PatternFly React components
JSON Schema and Zod schema metadata for PatternFly React components, providing structured validation and documentation for component props.
npm install @patternfly/patternfly-component-schemas
Note: This package includes Zod v4 for runtime validation support.Learn more at zod.dev/v4.
This package uses a split structure for optimal performance and modularity:
@patternfly/patternfly-component-schemas/
├── components/
│ ├── AboutModal/
│ │ ├── schema.json # JSON Schema for AboutModal props
│ │ ├── schema.zod.ts # Zod Schema for AboutModal props ✨
│ │ └── index.js # Component metadata exports
│ ├── Button/
│ │ ├── schema.json
│ │ ├── schema.zod.ts ✨
│ │ └── index.js
│ ├── Alert/
│ │ ├── schema.json
│ │ ├── schema.zod.ts ✨
│ │ └── index.js
│ └── ... (462 total components)
├── zod/
│ └── index.ts # Barrel export of all Zod schemas ✨
├── scripts/
│ ├── generate-schemas.js # JSON Schema generation
│ └── generate-zod-schemas.js # Zod Schema generation ✨
├── index.js # Main JSON Schema exports
├── 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:
// MCP servers can load and query component schemas
import { componentNames, getComponentSchema } from '@patternfly/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 }
// JSON-optimized interface with lazy loading:
// - Single import of lightweight metadata for fast discovery of all components
// - Bulk schema access lazy loaded on first query
// - Fast subsequent queries after initial load
import { componentNames, getComponentSchema } from '@patternfly/patternfly-component-schemas/json';
// Discover all available components (no full schemas loaded yet)
const components = componentNames; // 462 PatternFly components
// Get detailed component information (lazy loads full schemas on first call)
const buttonSchema = await getComponentSchema('Button');
// Returns JSON Schema with properties, required props, etc.
import { ButtonSchema, AlertSchema } from '@patternfly/patternfly-component-schemas/zod';
// Validate LLM-generated component props at runtime
const llmGeneratedProps = {
variant: "primary",
size: "lg",
children: "Click me"
};
// Type-safe validation with detailed error messages
const validatedProps = ButtonSchema.parse(llmGeneratedProps);
// ✅ Returns type-safe props ready for React component
// Safe parsing with error handling
const result = AlertSchema.safeParse(userInput);
if (result.success) {
// Use result.data with confidence
return <Alert {...result.data} />;
} else {
console.error('Invalid props:', result.error.issues);
}
This package provides two interfaces optimized for different use cases:
Import: @patternfly/patternfly-component-schemas
Characteristics:
Import: @patternfly/patternfly-component-schemas/json
Characteristics:
Use Tree-Shakeable if you:
Use JSON-Optimized if you:
# 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)
npm run build:props in the doc-core directorydist/props.json content to component-metadata.json of this reponpm run build to regenerate schemasfeat(components): sync with PatternFly vX.X.Xmain → automatic release triggers 🚀🔮 Future Automation
This package is specifically designed for:
import { Button, Alert } from '@patternfly/patternfly-component-schemas';
// Use for documentation, IDE support, or MCP servers
console.log(Button.schema); // Full JSON Schema
console.log(Button.componentName); // "Button"
console.log(Button.propsCount); // 24
import { ButtonSchema, AlertSchema, type ButtonProps } from '@patternfly/patternfly-component-schemas/zod';
import type { z } from 'zod';
// Basic validation
const props = ButtonSchema.parse({ variant: "primary" });
// Type inference
type InferredButtonProps = z.infer<typeof ButtonSchema>;
// Or use the exported type directly
const myProps: ButtonProps = { variant: "primary", size: "lg" };
// Safe parsing with error handling
const result = AlertSchema.safeParse(dynamicProps);
if (result.success) {
console.log('Valid props:', result.data);
} else {
console.error('Validation errors:', result.error.format());
}
// Dynamic component validation
import { getComponentSchema } from '@patternfly/patternfly-component-schemas/zod';
async function validateComponent(name: string, props: unknown) {
const schema = await getComponentSchema(name);
return schema.parse(props);
}
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
main branch using conventional formatcomponent-metadata.json with your changesnpm run build to regenerate schemas# 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.
FAQs
JSON Schema and Zod schema metadata for PatternFly React components
We found that @patternfly/patternfly-component-schemas demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.