Class: Tag


A custom element for a Tag. Invoke with <dlx-tag>.

new Tag()

Create a new Tag element by using document.createElement('dlx-tag'). Do not use new Tag;

Name Type Description
data-category String

The category of the tag to display

data-color String

The color of this tag, as a Hex color value

data-type String

The type of value (string, boolean, number)

data-value String

The value of the tag to display

editable Boolean

If set to true, will display the X delete icon inside the tag


  • HTMLElement



Sets the background and text colors according to the value of the data-color attribute


Sets the text content of the tag to the category and value of the tag, using the data-category and data-value attributes