x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<div class="p-8 space-y-8"> <div> <h3 class="text-lg font-semibold mb-4">Loading States - All Styles</h3> <div class="flex flex-wrap gap-3"> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Saving </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary-500 bg-transparent border-2 border-secondary-600 hover:border-secondary-700 hover:bg-secondary-50 text-secondary-600 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Loading </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-success-500 bg-transparent hover:bg-success-50 active:bg-success-100 text-success-600 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Processing </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-info-500 bg-info-100 hover:bg-info-200 active:bg-info-300 text-info-700 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Updating </span> </button> </div> </div> <div> <h3 class="text-lg font-semibold mb-4">Loading States - All Sizes</h3> <div class="flex items-center flex-wrap gap-3"> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-2 py-1 text-xs gap-1 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-3 h-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-1"> Loading XS </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-3 py-1.5 text-sm gap-1.5 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-4 h-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-1.5"> Loading SM </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Loading MD </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-5 py-2.5 text-lg gap-2.5 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2.5"> Loading LG </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-6 py-3 text-xl gap-3 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-7 h-7" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-3"> Loading XL </span> </button> </div> </div> <div> <h3 class="text-lg font-semibold mb-4">Loading States - All Variants</h3> <div class="flex flex-wrap gap-3"> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Primary </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary-500 bg-secondary-600 hover:bg-secondary-700 active:bg-secondary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Secondary </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-accent-500 bg-accent-600 hover:bg-accent-700 active:bg-accent-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Accent </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-success-500 bg-success-600 hover:bg-success-700 active:bg-success-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Success </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-danger-500 bg-danger-600 hover:bg-danger-700 active:bg-danger-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Danger </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-warning-500 bg-warning-600 hover:bg-warning-700 active:bg-warning-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Warning </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-info-500 bg-info-600 hover:bg-info-700 active:bg-info-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Info </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-grayscale-400 bg-grayscale-100 hover:bg-grayscale-200 active:bg-grayscale-300 text-grayscale-900 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Light </span> </button> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-grayscale-600 bg-grayscale-900 hover:bg-grayscale-800 active:bg-grayscale-700 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Dark </span> </button> </div> </div> <div> <h3 class="text-lg font-semibold mb-4">Loading vs Normal States Comparison</h3> <div class="grid grid-cols-2 gap-4"> <div> <p class="text-sm text-gray-600 mb-2">Normal State</p> <button type="submit" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" data-better-ui--button-show-loader-on-click-value="true" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-pointer"> <span data-better-ui--button-target="spinner" class="hidden"> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class=" inline-flex items-center gap-2"> Submit Form </span> </button> </div> <div> <p class="text-sm text-gray-600 mb-2">Loading State</p> <button type="button" disabled="disabled" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-wait"> <span data-better-ui--button-target="spinner" class=""> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class="hidden inline-flex items-center gap-2"> Submit Form </span> </button> </div> </div> </div></div>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<div class="p-8 space-y-8"> <div> <h3 class="text-lg font-semibold mb-4">Loading States - All Styles</h3> <div class="flex flex-wrap gap-3"> <%= render BetterUi::ButtonComponent.new(variant: :primary, style: :solid, show_loader: true) do %> Saving <% end %> <%= render BetterUi::ButtonComponent.new(variant: :secondary, style: :outline, show_loader: true) do %> Loading <% end %> <%= render BetterUi::ButtonComponent.new(variant: :success, style: :ghost, show_loader: true) do %> Processing <% end %> <%= render BetterUi::ButtonComponent.new(variant: :info, style: :soft, show_loader: true) do %> Updating <% end %> </div> </div> <div> <h3 class="text-lg font-semibold mb-4">Loading States - All Sizes</h3> <div class="flex items-center flex-wrap gap-3"> <% (@sizes || [:xs, :sm, :md, :lg, :xl]).each do |size| %> <%= render BetterUi::ButtonComponent.new(variant: :primary, size: size, show_loader: true) do %> Loading <%= size.to_s.upcase %> <% end %> <% end %> </div> </div> <div> <h3 class="text-lg font-semibold mb-4">Loading States - All Variants</h3> <div class="flex flex-wrap gap-3"> <% (@variants || BetterUi::ApplicationComponent::VARIANTS.keys).each do |variant| %> <%= render BetterUi::ButtonComponent.new(variant: variant, show_loader: true) do %> <%= variant.to_s.capitalize %> <% end %> <% end %> </div> </div> <div> <h3 class="text-lg font-semibold mb-4">Loading vs Normal States Comparison</h3> <div class="grid grid-cols-2 gap-4"> <div> <p class="text-sm text-gray-600 mb-2">Normal State</p> <%= render BetterUi::ButtonComponent.new(variant: :primary, show_loader_on_click: true, type: :submit) do %> Submit Form <% end %> </div> <div> <p class="text-sm text-gray-600 mb-2">Loading State</p> <%= render BetterUi::ButtonComponent.new(variant: :primary, show_loader: true) do %> Submit Form <% end %> </div> </div> </div></div>No notes provided.
No params configured.