Key Features & Benefits
The Hero Block includes three essential fields—text, image, and actions—each designed for common hero section needs. However, every field can be extended, customized, or even hidden if not required, keeping the content model clean and efficient.
Text
By default, the text field is a portable text editor with support for h1 and normal style definitions, ensuring a clean and structured content approach. However, this can be fully customized—whether by adding more styles, switching to a string field for simpler implementations, or removing it altogether if for some reason text isn’t needed.
Image
The image field is built on Sanity’s native image type, but with an added alt text field for improved accessibility. Like the Hero Block itself, the image field supports custom fields and can be hidden if a hero section doesn’t require an image.
Actions
The actions field supports a variety of call-to-action (CTA) types out of the box, including:
- External links (for directing users to other websites)
- Relative links (for internal navigation)
- Media links (for linking to downloadable assets)
If additional linking capabilities are needed, you can extend the actions field with reference types, enabling support for internal links to structured content within Sanity.
import {defineConfig, defineField} from 'sanity'
import {heroBlock} from '@trenda/sanity-plugin-page-blocks'
export default defineConfig({
//...
plugins: [
heroBlock({
actions: {
internal: {
types: [{type: 'page'}],
},
},
//...
}),
],
})Alternatively, if no CTAs are needed, the actions field can be disabled entirely to streamline the content model.
import {defineConfig, defineField} from 'sanity'
import {heroBlock} from '@trenda/sanity-plugin-page-blocks'
export default defineConfig({
//...
plugins: [
heroBlock({
actions: false,
//...
}),
],
})By leveraging the Hero Block, you get a ready-made yet highly flexible solution that balances structure with customization. Whether you need a fully featured hero section or a minimalist variant, the Hero Block adapts to your needs effortlessly.