RichText block renders Sanity Portable Text inside a constrained, typographically styled prose container. Use it for long-form editorial content such as program descriptions, policy text, announcements, or any body copy that needs formatting beyond a simple paragraph.
Props
Portable Text value array from Sanity. Rendered by
astro-portabletext using the project’s shared portableTextComponents, which includes custom renderers for marks, annotations, and embedded images.Background colour token from the shared block base. Defaults to
white.Vertical padding override. Defaults to
default.Content container max-width. Defaults to
default.Additional CSS classes.
HTML
id for anchor targeting.Usage in Sanity Studio
- Add a Rich Text block to a page’s Blocks array.
- Use the Content Portable Text editor to write or paste body copy.
- Apply inline formatting: bold, italic, links, code, headings (H2–H4), and block quotes.
- Expand Layout Options to adjust spacing or max-width for narrow editorial columns.
Variants / Options
This block has novariant field. The prose container (SectionProse) applies consistent Tailwind prose styles. Use the Max Width layout option to constrain long-form text to a narrower reading column.
Example
Embedded images in Portable Text are handled by the shared
portableTextComponents renderer, which applies the same urlFor optimisation pipeline used throughout the site.