Skip to Main Content
Builder.io Ideas
Categories Visual Editor
Created by Ersin Akinci
Created on Sep 23, 2022

Allow buttons to accept inline children

The button block currently doesn't allow for child elements. I understand the reasoning: only inline elements can be children of `<button>`, so maybe it's easier just to prevent any children.

However, a common use case is when you want to create a button with an icon/image on it. Right now, to do that you need to create a box, set the HTML tag to `button` (which is buggy in its own way: https://forum.builder.io/t/blocks-dont-respect-the-background-color-when-you-set-the-html-tag-to-button/2657/2), and then add your children.

Would be much simpler if you could add a child element and then Visual Editor highlights an error if the element isn't inline, prompting the user to set `display: inline-block` or something like that.

  • Attach files