Nitroux.Utils (nitroux v0.4.2)

Summary

Functions

Generates dynamic open and closing tags around content iex> Nitroux.Utils.tag("div", []) "<div></div>"

Types

@type tag() :: String.t()

Functions

Link to this function

tag(name, attrs, container \\ true)

@spec tag(any(), map() | [tag()] | tag(), boolean()) :: tag()

Generates dynamic open and closing tags around content iex> Nitroux.Utils.tag("div", []) "<div></div>"

iex> Nitroux.Utils.tag("div", ["hello world"]) "<div>hello world</div>"

iex> Nitroux.Utils.tag("div", ["hello", " ", "world"]) "<div>hello world</div>"

Link to this function

typed_tag(name, attrs, content, container \\ true)

@spec typed_tag(
  String.t(),
  Nitroux.Types.GlobalAttributes.t(),
  [tag()] | tag(),
  boolean()
) :: tag()