Issue #1353✓ SolvedOpened August 9, 2018by emilsedgh2 reactions

Checkbox property type

Quick answerby jmrgz2

Oh, sorry, I just got right what you need now. You could try a dirty jquery solution while waiting, using 2 radio buttons with the different on/off states and show/hide every button when you need it.

Read full answer below ↓

Question

I'm interested in developing a "checkbox" (toggle) property type for the style manager.

Basically it'd be like the radio, except that it's singular and can be turned on off.

Use case is this:

I want to have a Bold icon. If toggled on, it applies font-weight: bold otherwise applies font-weight: normal.

Just like the default rte. Except that I want it in the style manager.

Would you guys accept that in grapes? Should I call it PropertyToggle or PropertyCheckbox?

Answers (3)

👍 Most helpfuljmrgzAugust 9, 2018

Oh, sorry, I just got right what you need now. You could try a dirty jquery solution while waiting, using 2 radio buttons with the different on/off states and show/hide every button when you need it.

jmrgzAugust 9, 2018

If I understood you ok, you are trying to create a new button like the others under "text-decoration" in https://grapesjs.com/demo.html I do not have text decoration in my project, but I have text-align buttons that work the same. This should be the code that creates the text-align buttons in the s...

emilsedghAugust 9, 2018

Your example provides a radio button of a few choices.

I want single toggle on/off buttons.

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.