const metadata = {
title: "ArticleLayout"
}
const properties = {
title: {
type: "string",
title: "Title",
default: ""
},
subtitle: {
type: "string",
title: "Subtitle"
},
heroImage: {
type: "image",
title: "Hero Image"
},
author: {
type: "string",
title: "Author"
},
publishDate: {
type: "date",
title: "Publish Date"
}
} satisfies ComponentProperties;
const body = (props: InferProps<typeof properties>, children: Component[]): Component => {
return ScrollView([
VStack({ spacing: 24 }, [
// Hero section
Image(props.heroImage)
.frame({ height: 300 })
.clipped(),
// Header
VStack({ spacing: 8, alignment: "leading" }, [
Text(props.title)
.font("largeTitle")
.bold(),
Text(props.subtitle)
.font("title3")
.foregroundStyle(Color("secondary")),
Text(`By ${props.author}`)
.font("caption")
])
.padding("horizontal", 16),
// Content blocks (added by content teams)
VStack({ spacing: 16 }, children)
.padding("horizontal", 16)
])
])
}
export default defineComponent({
metadata,
properties,
body
});