Formatting textareas with elm-ui

It is possible to format a text input area using the contenteditable attribute in HTML.

And I was wondering, if not the same thing was possible in Elm?

You can use Html.Attributes.contenteditable
https://ellie-app.com/cd6W8V9y42ma1

If there is an attribute that you cannot find in Html package, you can use:
Html.Attributes.attribute
https://package.elm-lang.org/packages/elm/html/latest/Html-Attributes#attribute

The same for html nodes that you can’t find in the package:
https://package.elm-lang.org/packages/elm/html/latest/Html#node

And can that be done using elm-ui as well?

Yes, you can interop with Html from elm-ui using Element.htmlAttribute.
https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/Element#htmlAttribute

You can also transform html into elm-ui Element:
https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/Element#html

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.