@@ -11,7 +11,7 @@ defmodule DaisyUi.Component do
11
11
## Examples
12
12
13
13
<.alert>
14
- <p> This is an alert!</p>
14
+ This is an alert!
15
15
</.alert>
16
16
17
17
## Reference
@@ -24,8 +24,8 @@ defmodule DaisyUi.Component do
24
24
doc: "The kind of alert to show"
25
25
26
26
slot :inner_block , required: true , doc: "Alert Text/Content"
27
- slot :prefix , optional: true , doc: "Rendered before the main text, usually an icon"
28
- slot :suffix , optional: true , doc: "Rendered after the main text, usually used for buttons"
27
+ slot :prefix , doc: "Rendered before the main text, usually an icon"
28
+ slot :suffix , doc: "Rendered after the main text, usually used for buttons"
29
29
30
30
def alert ( assigns ) do
31
31
~H"""
@@ -36,13 +36,33 @@ defmodule DaisyUi.Component do
36
36
@ kind && "alert-#{ @ kind } "
37
37
] }
38
38
>
39
- <%= render_slot ( @ prefix ) %>
40
- < div > <%= render_slot ( @ inner_block ) %> </ div >
41
- <%= render_slot ( @ prefix ) %>
39
+ { render_slot ( @ prefix ) }
40
+ < div > { render_slot ( @ inner_block ) } </ div >
41
+ { render_slot ( @ prefix ) }
42
42
</ div >
43
43
"""
44
44
end
45
45
46
+ @ doc section: :action
47
+ @ doc ~S"""
48
+ A button component.
49
+
50
+ ## Examples
51
+
52
+ <.button>Click Me</.button>
53
+
54
+ ## Reference
55
+
56
+ [DaisyUI Button](https://daisyui.com/components/button/)
57
+ """
58
+ slot :inner_block , required: true , doc: "Button Text/Content"
59
+
60
+ def button ( assigns ) do
61
+ ~H"""
62
+ < button class = "btn btn-primary " > { render_slot ( @ inner_block ) } </ button >
63
+ """
64
+ end
65
+
46
66
@ doc section: :data_input
47
67
@ doc ~S"""
48
68
A label component.
@@ -62,7 +82,7 @@ defmodule DaisyUi.Component do
62
82
def label ( assigns ) do
63
83
~H"""
64
84
< div class = "label " >
65
- < span class = "label-text " > <%= render_slot ( @ inner_block ) %> </ span >
85
+ < span class = "label-text " > { render_slot ( @ inner_block ) } </ span >
66
86
</ div >
67
87
"""
68
88
end
0 commit comments