Join us live Sept. 27 – How Sanity and Vercel powered Morning Brew's transformation –>

is there a good solution to center or right align text in the richtext editor?

1 replies
Last updated: Dec 3, 2020

is there a good solution to center or right align text in the richtext editor?

Dec 1, 2020, 5:22 PM

The idea behind Portable Text is that the presentation layer should decide layout. In the original design we assumed that text-alignment was a presentation concern, and didn't include it in the spec. We might reconsider this.
Meanwhile you can make a custom

style
. e.g.
normal+right
 and implement alignment in your frontend with the block serializer.

Dec 3, 2020, 12:40 PM

Sanity.io: Get the most out of your content

Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Give your team exactly what they need to edit and publish their content with the customizable Sanity Studio. Get real-time collaboration out of the box. Sanity.io comes with a hosted datastore for JSON documents, query languages like GROQ and GraphQL, CDNs, on-demand asset transformations, presentation agnostic rich text, plugins, and much more.

Don't compromise on developer experience. Join thousands of developers and trusted companies and power your content with Sanity.io. Free to get started, pay-as-you-go on all plans.