How to increase dialog size in Portable Text editor for internal links?
Based on the search results, I found the solution! You can control the dialog width for annotations in Portable Text by using the options.modal configuration.
Here's how to increase the dialog size for your internal link annotation:
annotations: [
{
name: "internalLink",
type: "object",
icon: FiLink,
options: {
modal: {
type: "dialog",
width: 'auto' // or specify a value like 'large', 1, 2, etc.
},
},
title: "Internal Link",
fields: [
// your fields here
]
}
]The options.modal object accepts two properties:
type: Set to"dialog"for a modal dialogwidth: Can be set to:'auto'- automatically sizes based on content- Numeric values like
1,2,3for different preset widths (where higher numbers = wider dialogs)
This configuration is documented in the Array type documentation and also applies to object types within Portable Text annotations. The same modal option is available for Object types as well.
Setting width: 'auto' should resolve your issue with document titles being cut off at 300px, as it will allow the dialog to expand to fit the content. If you need even more control, you can experiment with the numeric width values (try width: 2 or width: 3) to find what works best for your use case.
This is a common issue that others have encountered - there's even a community discussion specifically about this problem with the same solution.
Show original thread4 replies
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.