Skip to main content

Full screen mode for a rich text editor in ASP.NET Core

The editor with a formatted document

A small editor box on a form is fine for a paragraph and painful for a report. A full screen button lets people expand it for as long as they need, and return to the page without losing anything.

Add the button

Its name is fullscreenenter, and it is in the basic, default and full toolbars. In your own:

<richtextbox name="Body"
             toolbar="{bold,italic}|{insertlink}|{undo,redo}|{fullscreenenter}"
             height="300px"></richtextbox>

There is nothing to set up on the server. Press the button or Escape to return. Content stays where it was, and the form still posts it normally.

Things to check on your page

Use it to keep forms short

Since people can expand on demand, you can keep the editor modest in the form:

<richtextbox asp-for="Description" toolbar="default" height="220px"></richtextbox>

The rest of the form stays visible, and people who write a lot have the room they need. resize-mode="height" is another option, letting them drag the box taller on the page instead. See the resize demo.

Read next