Version 0.14.0
🚀 New Features
Introduction of DataAttr
for Custom Data Attributes
This new function enables the addition of custom data attributes to HTML elements.
Example Usage
Div(attrs.Props{attrs.DataAttr("theme"): "cupcake"}, Text("foobar"))
// <div data-theme="cupcake">foobar</div>
Expanded ARIA Attributes for Accessibility
A comprehensive set of ARIA (Accessible Rich Internet Applications) attributes has been added to the attrs subpackage. For a full list of the new ARIA attributes, see the constants in the attrs subpackage.
Added Various Attributes
Support for step
and minlength
has been added to our attributes constants.You can access these from the attrs
subpackage as attrs.Step
and attrs.Minlength
.
⚠️ Deprecations
Standardization of Constants in the attrs
Package
Several constants have been renamed to adhere to Go's naming conventions.
AllowFullScreen
→AllowFullscreen
ReferrerPolicy
→Referrerpolicy
NoValidate
→Novalidate
MaxLength
→Maxlength
DateTime
→Datetime
CrossOrigin
→Crossorigin
SrcDoc
→Srcdoc
IsMap
→Ismap
Users are advised to update their code to the new standards. The deprecated constants will remain available for a transition period, but will be removed in future releases.