Skip to content

Commit b32f808

Browse files
committed
add role attr with default to badge
1 parent 0a691c0 commit b32f808

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/petal_components/badge.ex

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ defmodule PetalComponents.Badge do
99
values: ["primary", "secondary", "info", "success", "warning", "danger", "gray"]
1010
)
1111

12+
attr(:role, :string, default: "note", values: ["note", "status"])
1213
attr(:with_icon, :boolean, default: false, doc: "adds some icon base classes")
1314
attr(:class, :string, default: "", doc: "CSS class for parent div")
1415
attr(:label, :string, default: nil, doc: "label your badge")
@@ -19,6 +20,7 @@ defmodule PetalComponents.Badge do
1920
~H"""
2021
<badge
2122
{@rest}
23+
role={@role}
2224
class={[
2325
"pc-badge",
2426
"pc-badge--#{@size}",

0 commit comments

Comments
 (0)