Search code examples
content-management-systemsanityheadless-cms

How to change field style in the sanity io user interface?


How can I change a style of a component easy? I just want limit a text-field height in a sanity user inerface. enter image description here It is uncomfortable to scroll all the text every time. Where can I write something like that:

{
  overflow-y: auto;
  height: 200px;
}


Solution

  • From the screenshot provided in the question, it seems you're using rexxars markdown plugin for Sanity. When defining the markdown field in your schema, you have some options to choose from. I'm guessing what you want is a low minimum number of rows and to disable auto grow? E.g.:

    export default {
      name: 'blogPost',
      title: 'Blog Post',
      type: 'document',
      fields: [
        // ... other blogPost fields 
        {
          name: 'body',
          title: 'Body',
          type: 'markdown',
          options: {
            minRows: 10,
            autoGrow: false
          }
        }
      ]
    }

    If the options you need aren't available, try creating an issue or submit a pull request, proposing the change you need?