Current section
Files
Jump to
Current section
Files
src/glaze@basecoat@badge.erl
-module(glaze@basecoat@badge).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/glaze/basecoat/badge.gleam").
-export([badge/2, secondary/2, outline/2, destructive/2, link/2, link_secondary/2, link_outline/2, link_destructive/2, with_icon/3]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Basecoat documentation: <https://basecoatui.com/components/badge/>\n"
"\n"
" The [`badge`](#badge) element, sometimes called a \"tag\", is used to attach\n"
" short contextual information to nearby content.\n"
"\n"
" Common examples include labels like \"New\", \"Beta\", \"Paid\", or status chips\n"
" in lists and cards.\n"
"\n"
" ## Variants\n"
"\n"
" - [`secondary`](#secondary)\n"
" - [`outline`](#outline)\n"
" - [`destructive`](#destructive)\n"
"\n"
" ## Recipe\n"
"\n"
" ```gleam\n"
" import glaze/basecoat/badge\n"
" import lustre/element/html\n"
"\n"
" fn status() {\n"
" badge.badge([], [html.text(\"New\")])\n"
" }\n"
" ```\n"
"\n"
).
-file("src/glaze/basecoat/badge.gleam", 31).
-spec badge(
list(lustre@vdom@vattr:attribute(QBA)),
list(lustre@vdom@vnode:element(QBA))
) -> lustre@vdom@vnode:element(QBA).
badge(Attrs, Children) ->
lustre@element@html:span(
[lustre@attribute:class(<<"badge"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 38).
-spec secondary(
list(lustre@vdom@vattr:attribute(QBG)),
list(lustre@vdom@vnode:element(QBG))
) -> lustre@vdom@vnode:element(QBG).
secondary(Attrs, Children) ->
lustre@element@html:span(
[lustre@attribute:class(<<"badge-secondary"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 45).
-spec outline(
list(lustre@vdom@vattr:attribute(QBM)),
list(lustre@vdom@vnode:element(QBM))
) -> lustre@vdom@vnode:element(QBM).
outline(Attrs, Children) ->
lustre@element@html:span(
[lustre@attribute:class(<<"badge-outline"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 52).
-spec destructive(
list(lustre@vdom@vattr:attribute(QBS)),
list(lustre@vdom@vnode:element(QBS))
) -> lustre@vdom@vnode:element(QBS).
destructive(Attrs, Children) ->
lustre@element@html:span(
[lustre@attribute:class(<<"badge-destructive"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 59).
-spec link(
list(lustre@vdom@vattr:attribute(QBY)),
list(lustre@vdom@vnode:element(QBY))
) -> lustre@vdom@vnode:element(QBY).
link(Attrs, Children) ->
lustre@element@html:a(
[lustre@attribute:class(<<"badge"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 66).
-spec link_secondary(
list(lustre@vdom@vattr:attribute(QCE)),
list(lustre@vdom@vnode:element(QCE))
) -> lustre@vdom@vnode:element(QCE).
link_secondary(Attrs, Children) ->
lustre@element@html:a(
[lustre@attribute:class(<<"badge-secondary"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 73).
-spec link_outline(
list(lustre@vdom@vattr:attribute(QCK)),
list(lustre@vdom@vnode:element(QCK))
) -> lustre@vdom@vnode:element(QCK).
link_outline(Attrs, Children) ->
lustre@element@html:a(
[lustre@attribute:class(<<"badge-outline"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 80).
-spec link_destructive(
list(lustre@vdom@vattr:attribute(QCQ)),
list(lustre@vdom@vnode:element(QCQ))
) -> lustre@vdom@vnode:element(QCQ).
link_destructive(Attrs, Children) ->
lustre@element@html:a(
[lustre@attribute:class(<<"badge-destructive"/utf8>>) | Attrs],
Children
).
-file("src/glaze/basecoat/badge.gleam", 87).
-spec with_icon(
lustre@vdom@vnode:element(QCW),
list(lustre@vdom@vattr:attribute(QCW)),
list(lustre@vdom@vnode:element(QCW))
) -> lustre@vdom@vnode:element(QCW).
with_icon(Icon, Attrs, Children) ->
lustre@element@html:span(
[lustre@attribute:class(<<"badge"/utf8>>) | Attrs],
[Icon | Children]
).