Noora.Tag (noora v0.4.0)

A tag component.

It can optionally be rendered with an icon and a button to dismiss it.

Example

<.tag label="Active" />
<.tag label="User" icon="user" />
<.tag label="Beta" dismissible={true} on_dismiss="remove_tag" dismiss_value="beta" />

Summary

Functions

input_tag(assigns)

Attributes

  • label (:string) (required) - The label of the tag.
  • dismissible (:boolean) - Whether the tag can be dismissed. Defaults to false.
  • on_dismiss (:string) - The event to trigger when the tag is dismissed. Defaults to nil.
  • dismiss_value (:string) - Value to pass to the dismiss event. Defaults to nil.
  • disabled (:boolean) - Whether the tag is disabled. Defaults to false.
  • Global attributes are accepted.

tag(assigns)

Attributes

  • label (:string) (required) - The label of the tag.
  • dismissible (:boolean) - Whether the tag can be dismissed. Defaults to false.
  • on_dismiss (:string) - The event to trigger when the tag is dismissed. Defaults to nil.
  • dismiss_value (:string) - Value to pass to the dismiss event. Defaults to nil.
  • icon (:string) - An icon to render in front of the label. Defaults to nil.
  • disabled (:boolean) - Whether the tag is disabled. Defaults to false.
  • Global attributes are accepted.