flowbite-mcp 1.1.2 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -74
- package/build/index.js +20 -36
- package/data/components/accordion.md +39 -53
- package/data/components/alerts.md +27 -44
- package/data/components/avatar.md +20 -33
- package/data/components/badge.md +34 -47
- package/data/components/banner.md +10 -29
- package/data/components/bottom-navigation.md +16 -29
- package/data/components/breadcrumb.md +12 -25
- package/data/components/button-group.md +26 -39
- package/data/components/buttons.md +41 -67
- package/data/components/card.md +34 -47
- package/data/components/carousel.md +25 -39
- package/data/components/chat-bubble.md +36 -50
- package/data/components/clipboard.md +256 -252
- package/data/components/datepicker.md +56 -70
- package/data/components/device-mockups.md +16 -29
- package/data/components/drawer.md +42 -56
- package/data/components/dropdowns.md +66 -80
- package/data/components/footer.md +16 -29
- package/data/components/forms.md +32 -50
- package/data/components/gallery.md +16 -33
- package/data/components/indicators.md +18 -31
- package/data/components/jumbotron.md +12 -25
- package/data/components/kbd.md +14 -27
- package/data/components/list-group.md +14 -27
- package/data/components/mega-menu.md +10 -24
- package/data/components/modal.md +37 -51
- package/data/components/navbar.md +41 -55
- package/data/components/pagination.md +22 -35
- package/data/components/popover.md +36 -51
- package/data/components/progress.md +10 -23
- package/data/components/qr-code.md +41 -133
- package/data/components/rating.md +16 -29
- package/data/components/sidebar.md +15 -30
- package/data/components/skeleton.md +16 -29
- package/data/components/speed-dial.md +40 -55
- package/data/components/spinner.md +14 -27
- package/data/components/stepper.md +14 -27
- package/data/components/tables.md +45 -64
- package/data/components/tabs.md +30 -45
- package/data/components/timeline.md +10 -23
- package/data/components/toast.md +25 -39
- package/data/components/tooltips.md +24 -39
- package/data/components/typography.md +22 -35
- package/data/components/video.md +14 -27
- package/data/forms/checkbox.md +27 -43
- package/data/forms/file-input.md +12 -26
- package/data/forms/floating-label.md +12 -25
- package/data/forms/input-field.md +17 -32
- package/data/forms/number-input.md +83 -93
- package/data/forms/phone-input.md +42 -54
- package/data/forms/radio.md +23 -39
- package/data/forms/range.md +12 -26
- package/data/forms/search-input.md +14 -31
- package/data/forms/select.md +15 -30
- package/data/forms/textarea.md +8 -21
- package/data/forms/timepicker.md +30 -42
- package/data/forms/toggle.md +18 -31
- package/data/plugins/charts.md +542 -526
- package/data/plugins/datatables.md +285 -286
- package/data/plugins/wysiwyg.md +658 -650
- package/data/quickstart.md +24 -24
- package/data/typography/blockquote.md +24 -37
- package/data/typography/headings.md +30 -43
- package/data/typography/hr.md +10 -23
- package/data/typography/images.md +32 -45
- package/data/typography/links.md +16 -29
- package/data/typography/lists.md +22 -35
- package/data/typography/paragraphs.md +30 -43
- package/data/typography/text.md +42 -55
- package/package.json +1 -1
package/data/forms/timepicker.md
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Timepicker - Flowbite
|
|
4
|
-
description: Use the timepicker component from Flowbite to select the time of the day in terms of hours, minutes and even seconds using an input selector based on Tailwind CSS
|
|
5
|
-
group: forms
|
|
6
|
-
toc: true
|
|
7
|
-
requires_js: true
|
|
8
|
-
|
|
9
|
-
previous: Textarea
|
|
10
|
-
previousLink: forms/textarea/
|
|
11
|
-
next: Toggle
|
|
12
|
-
nextLink: forms/toggle/
|
|
13
|
-
---
|
|
14
|
-
|
|
15
1
|
The timepicker component from Flowbite can be used to choose the hours and minutes of a given day through the usage of input fields such as the native HTML time field or even checkbox fields with predefined time interval which are popularly used for calendar event creation.
|
|
16
2
|
|
|
17
3
|
The examples on this page are all built with Tailwind CSS and some of the examples require you to install the Flowbite JavaScript dependency to make the interactive UI components functional such as the datepicker, dropdowns, modals and the drawers.
|
|
@@ -22,7 +8,7 @@ The timepicker component is often used together with a datepicker so the more ad
|
|
|
22
8
|
|
|
23
9
|
Use this example to show a simple input field with the native browser timepicker.
|
|
24
10
|
|
|
25
|
-
|
|
11
|
+
```html
|
|
26
12
|
<form class="max-w-[8rem] mx-auto">
|
|
27
13
|
<label for="time" class="block mb-2 text-sm font-medium text-heading">Select time:</label>
|
|
28
14
|
<div class="relative">
|
|
@@ -32,13 +18,13 @@ Use this example to show a simple input field with the native browser timepicker
|
|
|
32
18
|
<input type="time" id="time" class="block w-full p-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand shadow-xs placeholder:text-body" min="09:00" max="18:00" value="00:00" required />
|
|
33
19
|
</div>
|
|
34
20
|
</form>
|
|
35
|
-
|
|
21
|
+
```
|
|
36
22
|
|
|
37
23
|
## Timepicker with icon
|
|
38
24
|
|
|
39
25
|
This example can be used to select a time via an input field where you can add an icon to the input group.
|
|
40
26
|
|
|
41
|
-
|
|
27
|
+
```html
|
|
42
28
|
<form class="max-w-[8.5rem] mx-auto">
|
|
43
29
|
<label for="time" class="block mb-2 text-sm font-medium text-heading">Select time:</label>
|
|
44
30
|
<div class="flex">
|
|
@@ -48,13 +34,13 @@ This example can be used to select a time via an input field where you can add a
|
|
|
48
34
|
</span>
|
|
49
35
|
</div>
|
|
50
36
|
</form>
|
|
51
|
-
|
|
37
|
+
```
|
|
52
38
|
|
|
53
39
|
## Timepicker with dropdown
|
|
54
40
|
|
|
55
41
|
Use this example to show a timepicker together with a dropdown menu where you can add options such as selecting the timezone or the duration of an event in minutes or hours.
|
|
56
42
|
|
|
57
|
-
|
|
43
|
+
```html
|
|
58
44
|
<form class="max-w-[13rem] mx-auto">
|
|
59
45
|
<label for="time" class="block mb-2 text-sm font-medium text-heading">Select time:</label>
|
|
60
46
|
<div class="flex">
|
|
@@ -84,13 +70,13 @@ Use this example to show a timepicker together with a dropdown menu where you ca
|
|
|
84
70
|
</div>
|
|
85
71
|
</div>
|
|
86
72
|
</form>
|
|
87
|
-
|
|
73
|
+
```
|
|
88
74
|
|
|
89
75
|
## Timepicker with select
|
|
90
76
|
|
|
91
77
|
Use this example to show a select input next to the timepicker to select an option like a timezone.
|
|
92
78
|
|
|
93
|
-
|
|
79
|
+
```html
|
|
94
80
|
<form>
|
|
95
81
|
<label for="time" class="block mb-2 text-sm font-medium text-heading">Select time:</label>
|
|
96
82
|
<div class="flex">
|
|
@@ -111,13 +97,13 @@ Use this example to show a select input next to the timepicker to select an opti
|
|
|
111
97
|
</select>
|
|
112
98
|
</div>
|
|
113
99
|
</form>
|
|
114
|
-
|
|
100
|
+
```
|
|
115
101
|
|
|
116
102
|
## Timepicker range selector
|
|
117
103
|
|
|
118
104
|
Use this example to select a time interval using two input field often used for the duration of an event.
|
|
119
105
|
|
|
120
|
-
|
|
106
|
+
```html
|
|
121
107
|
<form class="max-w-[16rem] mx-auto grid grid-cols-2 gap-4">
|
|
122
108
|
<div>
|
|
123
109
|
<label for="start-time" class="block mb-2 text-sm font-medium text-heading">Start time:</label>
|
|
@@ -138,21 +124,13 @@ Use this example to select a time interval using two input field often used for
|
|
|
138
124
|
</div>
|
|
139
125
|
</div>
|
|
140
126
|
</form>
|
|
141
|
-
|
|
127
|
+
```
|
|
142
128
|
|
|
143
129
|
## Timerange with dropdown
|
|
144
130
|
|
|
145
131
|
This example can be used to show the timerange picker inside a dropdown only when clicking on a button.
|
|
146
132
|
|
|
147
|
-
|
|
148
|
-
const dropdown = FlowbiteInstances.getInstance('Dropdown', 'dropdownTimepicker');
|
|
149
|
-
const $saveTimeButton = document.getElementById('saveTimeButton');
|
|
150
|
-
|
|
151
|
-
$saveTimeButton.addEventListener('click', function() {
|
|
152
|
-
// save time code and then hide the dropdown
|
|
153
|
-
dropdown.hide();
|
|
154
|
-
});
|
|
155
|
-
` >}}
|
|
133
|
+
```html
|
|
156
134
|
<button id="dropdownTimepickerButton" data-dropdown-toggle="dropdownTimepicker" class="inline-flex items-center text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none" type="button">
|
|
157
135
|
Choose time
|
|
158
136
|
<svg class="w-4 h-4 ms-1.5 -me-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
@@ -185,13 +163,23 @@ Choose time
|
|
|
185
163
|
</div>
|
|
186
164
|
<button id="saveTimeButton" type="button" class="text-fg-brand text-sm hover:underline p-0">Save time</button>
|
|
187
165
|
</div>
|
|
188
|
-
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```javascript
|
|
169
|
+
const dropdown = FlowbiteInstances.getInstance('Dropdown', 'dropdownTimepicker');
|
|
170
|
+
const $saveTimeButton = document.getElementById('saveTimeButton');
|
|
171
|
+
|
|
172
|
+
$saveTimeButton.addEventListener('click', function() {
|
|
173
|
+
// save time code and then hide the dropdown
|
|
174
|
+
dropdown.hide();
|
|
175
|
+
});
|
|
176
|
+
```
|
|
189
177
|
|
|
190
178
|
## Timerange picker with toggle
|
|
191
179
|
|
|
192
180
|
Use this example to show or hide the timepicker when clicking on an trigger element.
|
|
193
181
|
|
|
194
|
-
|
|
182
|
+
```html
|
|
195
183
|
<div class="w-[16rem]">
|
|
196
184
|
<button id="selectTimeToggle" data-collapse-toggle="time-range-container" type="button" class="text-fg-brand text-base font-medium hover:underline p-0 inline-flex items-center mb-2">Select time
|
|
197
185
|
<svg class="w-5 h-5 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
@@ -219,13 +207,13 @@ Use this example to show or hide the timepicker when clicking on an trigger elem
|
|
|
219
207
|
</div>
|
|
220
208
|
</div>
|
|
221
209
|
</div>
|
|
222
|
-
|
|
210
|
+
```
|
|
223
211
|
|
|
224
212
|
## Inline timepicker buttons
|
|
225
213
|
|
|
226
214
|
This is an advanced example that you can use to show the details of an event and select a date of the event based on the [Flowbite Datepicker](https://flowbite.com/docs/components/datepicker/) and select the time using a predefined set of time intervals based on checkbox elements.
|
|
227
215
|
|
|
228
|
-
|
|
216
|
+
```html
|
|
229
217
|
<h2 class="text-xl text-heading font-semibold mb-2">Digital Transformation</h2>
|
|
230
218
|
<div class="flex items-center space-x-4 rtl:space-x-reverse mb-3">
|
|
231
219
|
<div class="flex items-center">
|
|
@@ -357,13 +345,13 @@ This is an advanced example that you can use to show the details of an event and
|
|
|
357
345
|
</ul>
|
|
358
346
|
</div>
|
|
359
347
|
</div>
|
|
360
|
-
|
|
348
|
+
```
|
|
361
349
|
|
|
362
350
|
## Modal with timepicker
|
|
363
351
|
|
|
364
352
|
Use this example to select a date and time inside of a modal component based on the [Flowbite Datepicker](https://flowbite.com/docs/components/datepicker/) and select a time interval using checkbox elements with predefined time values for event time scheduling.
|
|
365
353
|
|
|
366
|
-
|
|
354
|
+
```html
|
|
367
355
|
<button type="button" data-modal-target="timepicker-modal" data-modal-toggle="timepicker-modal" class="inline-flex items-center justify-center text-body bg-neutral-secondary-medium box-border border border-default-medium hover:bg-neutral-tertiary-medium hover:text-heading focus:ring-4 focus:ring-neutral-tertiary shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">
|
|
368
356
|
<svg class="w-4 h-4 me-1.5 -ms-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
|
|
369
357
|
Schedule appointment
|
|
@@ -484,13 +472,13 @@ Use this example to select a date and time inside of a modal component based on
|
|
|
484
472
|
</div>
|
|
485
473
|
</div>
|
|
486
474
|
</div>
|
|
487
|
-
|
|
475
|
+
```
|
|
488
476
|
|
|
489
477
|
## Drawer with timepicker
|
|
490
478
|
|
|
491
479
|
Use this example to show multiple time interval selections inside of a drawer component to schedule time based on multiple entries (ie. days of the week) using the native browser time selection input element.
|
|
492
480
|
|
|
493
|
-
|
|
481
|
+
```html
|
|
494
482
|
<!-- drawer init and show -->
|
|
495
483
|
<div class="text-center">
|
|
496
484
|
<button class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none" type="button" data-drawer-target="drawer-timepicker" data-drawer-show="drawer-timepicker" aria-controls="drawer-timepicker">
|
|
@@ -729,4 +717,4 @@ Use this example to show multiple time interval selections inside of a drawer co
|
|
|
729
717
|
</div>
|
|
730
718
|
</form>
|
|
731
719
|
</div>
|
|
732
|
-
|
|
720
|
+
```
|
package/data/forms/toggle.md
CHANGED
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Toggle - Flowbite
|
|
4
|
-
description: Use the toggle component to switch between a binary state of true or false using a single click available in multiple sizes, variants, and colors
|
|
5
|
-
group: forms
|
|
6
|
-
toc: true
|
|
7
|
-
|
|
8
|
-
previous: Timepicker
|
|
9
|
-
previousLink: forms/timepicker/
|
|
10
|
-
next: Range Slider
|
|
11
|
-
nextLink: forms/range/
|
|
12
|
-
---
|
|
13
|
-
|
|
14
1
|
The toggle component can be used to receive a simple "yes" or "no" type of answer from the user by choosing a single option from two options available in multiple sizes, styles, and colors coded with the utility classes from Tailwind CSS and with dark mode support.
|
|
15
2
|
|
|
16
3
|
## Toggle example
|
|
17
4
|
|
|
18
5
|
Get started with the default toggle component example as a checkbox element to receive a true or false selection from the user.
|
|
19
6
|
|
|
20
|
-
|
|
7
|
+
```html
|
|
21
8
|
<label class="inline-flex items-center cursor-pointer">
|
|
22
9
|
<input type="checkbox" value="" class="sr-only peer">
|
|
23
10
|
<div class="relative w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
24
11
|
<span class="select-none ms-3 text-sm font-medium text-heading">Toggle me</span>
|
|
25
12
|
</label>
|
|
26
|
-
|
|
13
|
+
```
|
|
27
14
|
|
|
28
15
|
## Checked state
|
|
29
16
|
|
|
30
17
|
Apply the `checked` attribute to the toggle component to activate the selection by default.
|
|
31
18
|
|
|
32
|
-
|
|
19
|
+
```html
|
|
33
20
|
<label class="inline-flex items-center cursor-pointer">
|
|
34
21
|
<input type="checkbox" value="" class="sr-only peer" checked>
|
|
35
22
|
<div class="relative w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
36
23
|
<span class="select-none ms-3 text-sm font-medium text-heading">Checked toggle</span>
|
|
37
24
|
</label>
|
|
38
|
-
|
|
25
|
+
```
|
|
39
26
|
|
|
40
27
|
## Disabled state
|
|
41
28
|
|
|
42
29
|
Apply the `disabled` attribute to disallow the users from making any further selections.
|
|
43
30
|
|
|
44
|
-
|
|
31
|
+
```html
|
|
45
32
|
<label class="inline-flex items-center mb-5 cursor-pointer">
|
|
46
33
|
<input type="checkbox" value="" class="sr-only peer" disabled>
|
|
47
34
|
<div class="relative w-9 h-5 bg-neutral-tertiary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
@@ -53,39 +40,39 @@ Apply the `disabled` attribute to disallow the users from making any further sel
|
|
|
53
40
|
<div class="relative w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
54
41
|
<span class="select-none ms-3 text-sm font-medium text-fg-disabled">Disabled checked</span>
|
|
55
42
|
</label>
|
|
56
|
-
|
|
43
|
+
```
|
|
57
44
|
|
|
58
45
|
## Double labels
|
|
59
46
|
|
|
60
47
|
Use this example to show labels on the left and right of the toggle component.
|
|
61
48
|
|
|
62
|
-
|
|
49
|
+
```html
|
|
63
50
|
<label class="inline-flex items-center cursor-pointer">
|
|
64
51
|
<span class="select-none text-sm font-medium text-heading">Monthly</span>
|
|
65
52
|
<input type="checkbox" value="" class="sr-only peer">
|
|
66
53
|
<div class="relative mx-3 w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
67
54
|
<span class="select-none text-sm font-medium text-heading">Yearly</span>
|
|
68
55
|
</label>
|
|
69
|
-
|
|
56
|
+
```
|
|
70
57
|
|
|
71
58
|
## Toggle with icons
|
|
72
59
|
|
|
73
60
|
This example can be used to show [SVG icons](https://flowbite.com/icons/) on either side of the toggle component.
|
|
74
61
|
|
|
75
|
-
|
|
62
|
+
```html
|
|
76
63
|
<label class="inline-flex items-center cursor-pointer">
|
|
77
64
|
<svg class="w-5 h-5 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.5 8.43A4.985 4.985 0 0 1 19 12a4.984 4.984 0 0 1-1.43 3.5M14 6.135v11.73a1 1 0 0 1-1.64.768L8 15H6a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h2l4.36-3.633a1 1 0 0 1 1.64.768Z"/></svg>
|
|
78
65
|
<input type="checkbox" value="" class="sr-only peer">
|
|
79
66
|
<div class="relative mx-3 w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
80
67
|
<svg class="w-5 h-5 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.5 8.43A4.985 4.985 0 0 1 17 12a4.984 4.984 0 0 1-1.43 3.5m2.794 2.864A8.972 8.972 0 0 0 21 12a8.972 8.972 0 0 0-2.636-6.364M12 6.135v11.73a1 1 0 0 1-1.64.768L6 15H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h2l4.36-3.633a1 1 0 0 1 1.64.768Z"/></svg>
|
|
81
68
|
</label>
|
|
82
|
-
|
|
69
|
+
```
|
|
83
70
|
|
|
84
71
|
## Toggle card
|
|
85
72
|
|
|
86
73
|
This example can be used to add a toggle input field inside a card element with a description.
|
|
87
74
|
|
|
88
|
-
|
|
75
|
+
```html
|
|
89
76
|
<label class="w-80 inline-flex cursor-pointer p-4 bg-neutral-primary-soft border border-default rounded-base shadow-xs">
|
|
90
77
|
<input type="checkbox" value="" class="sr-only peer">
|
|
91
78
|
<div class="shrink-0 relative w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
@@ -94,13 +81,13 @@ This example can be used to add a toggle input field inside a card element with
|
|
|
94
81
|
<p class="text-sm font-normal text-body">Save my credentials for easier sign-in in the future.</p>
|
|
95
82
|
</div>
|
|
96
83
|
</label>
|
|
97
|
-
|
|
84
|
+
```
|
|
98
85
|
|
|
99
86
|
## Toggle card with icon
|
|
100
87
|
|
|
101
88
|
This example can be used to add a toggle input field inside a card element with an icon.
|
|
102
89
|
|
|
103
|
-
|
|
90
|
+
```html
|
|
104
91
|
<label class="w-112 inline-flex cursor-pointer p-4 bg-neutral-primary-soft border border-default rounded-base shadow-xs">
|
|
105
92
|
<div class="me-2.5">
|
|
106
93
|
<svg class="h-8 mb-2 text-heading" viewBox="0 0 90 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -112,13 +99,13 @@ This example can be used to add a toggle input field inside a card element with
|
|
|
112
99
|
<input type="checkbox" value="" class="sr-only peer">
|
|
113
100
|
<div class="shrink-0 relative w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
114
101
|
</label>
|
|
115
|
-
|
|
102
|
+
```
|
|
116
103
|
|
|
117
104
|
## Colors
|
|
118
105
|
|
|
119
106
|
Change the color of the toggle component by updating the color classes of `peer-focus` and `peer-checked`.
|
|
120
107
|
|
|
121
|
-
|
|
108
|
+
```html
|
|
122
109
|
<label class="inline-flex items-center me-5 cursor-pointer">
|
|
123
110
|
<input type="checkbox" value="" class="sr-only peer" checked>
|
|
124
111
|
<div class="relative w-9 h-5 bg-neutral-quaternary rounded-full peer peer-focus:ring-4 peer-focus:ring-red-300 dark:peer-focus:ring-red-800 dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-red-600 dark:peer-checked:bg-red-600"></div>
|
|
@@ -154,13 +141,13 @@ Change the color of the toggle component by updating the color classes of `peer-
|
|
|
154
141
|
<div class="relative w-9 h-5 bg-neutral-quaternary rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all dark:border-gray-600 peer-checked:bg-orange-500 dark:peer-checked:bg-orange-500"></div>
|
|
155
142
|
<span class="select-none ms-3 text-sm font-medium text-heading">Orange</span>
|
|
156
143
|
</label>
|
|
157
|
-
|
|
144
|
+
```
|
|
158
145
|
|
|
159
146
|
## Sizes
|
|
160
147
|
|
|
161
148
|
Get started with small, default, or large sizes of the toggle component based on your needs.
|
|
162
149
|
|
|
163
|
-
|
|
150
|
+
```html
|
|
164
151
|
<label class="inline-flex items-center mb-5 cursor-pointer">
|
|
165
152
|
<input type="checkbox" value="" class="sr-only peer">
|
|
166
153
|
<div class="relative w-9 h-5 bg-neutral-quaternary peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-soft dark:peer-focus:ring-brand-soft rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-brand"></div>
|
|
@@ -173,4 +160,4 @@ Get started with small, default, or large sizes of the toggle component based on
|
|
|
173
160
|
<span class="select-none ms-3 text-sm font-medium text-heading">Large toggle</span>
|
|
174
161
|
</label>
|
|
175
162
|
|
|
176
|
-
|
|
163
|
+
```
|