Issue #2592✓ SolvedOpened February 21, 2020by kaoz704 reactions

Modal width

Quick answerby ronaldaug2

For those who don't know how to use modal attributes. You can add option opts.attributes to modal's open method as below. Because I didn't find how to use it in the documentation here.

Read full answer below ↓

Question

Hello, is there a way to set a modal's width, its currently set to 850px by CSS, but I would like to create a dialog with a small amount of text and its too big for this: But it would be great to get this: Without overriding the CSS, because I would still like to use large modals. I checked the source code and the docs, it seems the only properties you can set are title and content.

Answers (3)

👍 Most helpfulronaldaugJuly 21, 2021

For those who don't know how to use modal attributes. You can add option opts.attributes to modal's open method as below. Because I didn't find how to use it in the documentation here.

kaoz70February 27, 2020

OK, what I'm thinking is to create a function to be able to set the width like: setWidth('400px'), and also a method to set custom attributes: setAttributes({'data-custom-attribute': 123}). I think 2 functions are needed because the width is controlled by CSS, and so is the modal's design, so just...

kaoz70May 8, 2020

Hello, sorry I'm piled with work now, if @sunnykgupta can give this a shot it would be great.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.