You can reuse a Vue component's props as part of your collection schema. This helps keep your content model aligned with your UI, reduces duplication, and prevents drift.
Nuxt Content provides a property() helper that augments your validator and adds the following utility:
pathUnder the hood, Nuxt Content reads the component's props (via nuxt-component-meta) and converts them to JSON Schema, then merges them into your collection schema.
import { defineContentConfig, defineCollection, property } from '@nuxt/content'
import { z } from 'zod'
export default defineContentConfig({
collections: {
pages: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
// Reuse props from a local component
hero: property(z.object({})).inherit('app/components/HeroSection.vue'),
// Reuse props from a dependency (path is resolved like an import)
button: property(z.object({})).inherit('@nuxt/ui/components/Button.vue')
})
})
}
})
inherit() is resolved like a module path. You can pass a relative path from project root or a package path.inherit() expects to be used on an object field (e.g., property(z.object({}))).$content.inherit markers.inherit() with editor(...) for better Studio forms if you need custom inputs on top of the component's props.