How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Limit block rows or alternative to block for single decorator?

7 repliesLast updated: Nov 29, 2025

Hi! I have a block with one decorator - it's only used to set part of the text as pink. Is there a way of limiting rows of block same as we can do with type 'text'? It won't ever be a long text and at the moment it takes a few rows. Or maybe there is a better way than using a block if I need only one decorator?
AI Update

Based on the information I found, there is no built-in rows option for Portable Text (block) fields like there is for simple text fields. This is a known limitation that has been requested by the community.

However, there are a couple of approaches you can take:

CSS Workaround

You can limit the height of the Portable Text editor using CSS overrides. According to a community discussion, you can add this to your Studio styling overrides:

:global([class^="PortableTextInput_editorBoxContent"]) {
  height: 8rem;
}

Note: This approach will affect all block content fields in your Studio. To target a specific field, you'd need to find a way to add a custom class or use more specific CSS selectors based on the field's position in the DOM.

Consider Using a Simple Text Field

Since you mentioned:

You might want to reconsider whether you actually need a full Portable Text block. If you only need basic inline styling and no other block features (like headings, lists, custom blocks, etc.), you could use:

The downside is you'd lose the ability to apply that pink decorator inline. However, you could potentially:

Better Alternative: Custom Input Component

Since you only need one decorator, you might consider creating a custom input component that:

This would give you better control over the UI while keeping the data structure simpler for your specific use case.

Feature Request

The ability to control Portable Text editor height (or have a "single-line" block variant) has been requested multiple times in the community. Consider upvoting or creating a feature request on Sanity's feedback channels if this is important for your use case.

Bottom line: The CSS workaround is currently your best option if you need to stick with Portable Text, but given your simple requirements (one decorator, short text), you might want to explore using a regular text field with rows or creating a custom input component that better fits your specific needs.

Show original thread
7 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions