Missing HTML properties

Hello all,

I am pretty new to PureScript and am building a toy website in Halogen with UI elements borrowed from Bootstrap 5. In Bootstrap 5 there is lots of HTML code that uses uncommon properties. Here’s an example:

<a class="nav-link active" aria-current="page" href="#">Dashboard</a>

I read the Halogen guide about adding a missing property but the trouble is HTMLa simply doesn’t support properties like aria-current. Is there any way to get around this?

you should be fine with just using attr

For your example attr (AttrName "aria-current") "page" (you’ll need to import the data-constructor AttrName too.


disclaimer

What the documentation recommends is surely the better way if you want to stick with type-driven/safe properties Halogen provides.
Personally I don’t really care too much and it’s a bit to much hassle for me so I work-around this using attr and co. … so in a way this is morally wrong :man_shrugging:

2 Likes

There is an ARIA property module. Might just need additions?

https://pursuit.purescript.org/packages/purescript-halogen/6.1.2/docs/Halogen.HTML.Properties.ARIA

They are all polymorphic, since aria attributes are annotations on pretty much anything.

2 Likes