Packages

A set of simple Surface components based on ant-design.

Current section

Files

Jump to
live_antd lib components tag.ex
Raw

lib/components/tag.ex

defmodule LiveAntd.Components.Tag do
@moduledoc """
Tag for categorizing or markup.
"""
use Surface.Component
prop(class, :string)
prop(style, :string)
# prop(color, :string, values: ~w(red green cyan purple))
prop(color, :string)
def render(assigns) do
~H"""
<span
class={{
"ant-tag",
@class,
"ant-tag-#{@color}": @color
}}
style="{{ @style }}"
>
<slot />
</span>
"""
end
end