flowbite-mcp 1.0.0
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/LICENSE.md +21 -0
- package/README.md +324 -0
- package/build/index.js +975 -0
- package/build/server-runner.js +228 -0
- package/data/components/accordion.md +860 -0
- package/data/components/alerts.md +739 -0
- package/data/components/avatar.md +178 -0
- package/data/components/badge.md +420 -0
- package/data/components/banner.md +145 -0
- package/data/components/bottom-navigation.md +513 -0
- package/data/components/breadcrumb.md +273 -0
- package/data/components/button-group.md +410 -0
- package/data/components/buttons.md +405 -0
- package/data/components/card.md +711 -0
- package/data/components/carousel.md +858 -0
- package/data/components/chat-bubble.md +1063 -0
- package/data/components/clipboard.md +1029 -0
- package/data/components/datepicker.md +673 -0
- package/data/components/device-mockups.md +152 -0
- package/data/components/drawer.md +1353 -0
- package/data/components/dropdowns.md +1925 -0
- package/data/components/footer.md +299 -0
- package/data/components/forms.md +371 -0
- package/data/components/gallery.md +322 -0
- package/data/components/indicators.md +262 -0
- package/data/components/jumbotron.md +213 -0
- package/data/components/kbd.md +217 -0
- package/data/components/list-group.md +365 -0
- package/data/components/mega-menu.md +558 -0
- package/data/components/modal.md +1309 -0
- package/data/components/navbar.md +1053 -0
- package/data/components/pagination.md +472 -0
- package/data/components/popover.md +826 -0
- package/data/components/progress.md +95 -0
- package/data/components/qr-code.md +280 -0
- package/data/components/rating.md +323 -0
- package/data/components/sidebar.md +1067 -0
- package/data/components/skeleton.md +221 -0
- package/data/components/speed-dial.md +1270 -0
- package/data/components/spinner.md +222 -0
- package/data/components/stepper.md +271 -0
- package/data/components/tables.md +3127 -0
- package/data/components/tabs.md +808 -0
- package/data/components/timeline.md +304 -0
- package/data/components/toast.md +341 -0
- package/data/components/tooltips.md +524 -0
- package/data/components/typography.md +269 -0
- package/data/components/video.md +95 -0
- package/data/forms/checkbox.md +375 -0
- package/data/forms/file-input.md +98 -0
- package/data/forms/floating-label.md +185 -0
- package/data/forms/input-field.md +222 -0
- package/data/forms/number-input.md +1099 -0
- package/data/forms/phone-input.md +577 -0
- package/data/forms/radio.md +315 -0
- package/data/forms/range.md +83 -0
- package/data/forms/search-input.md +280 -0
- package/data/forms/select.md +259 -0
- package/data/forms/textarea.md +155 -0
- package/data/forms/timepicker.md +732 -0
- package/data/forms/toggle.md +176 -0
- package/data/plugins/charts.md +2683 -0
- package/data/plugins/datatables.md +1922 -0
- package/data/plugins/datepicker.md +5 -0
- package/data/plugins/wysiwyg.md +2377 -0
- package/data/quickstart.md +169 -0
- package/data/theme.md +231 -0
- package/data/toc.md +79 -0
- package/data/typography/blockquote.md +182 -0
- package/data/typography/headings.md +174 -0
- package/data/typography/hr.md +74 -0
- package/data/typography/images.md +168 -0
- package/data/typography/links.md +118 -0
- package/data/typography/lists.md +387 -0
- package/data/typography/paragraphs.md +186 -0
- package/data/typography/text.md +249 -0
- package/package.json +71 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Tailwind CSS Floating Label - Flowbite
|
|
4
|
+
description: Use the floating label style for the input field elements to replicate the Material UI design system from Google and choose from multiple styles and sizes
|
|
5
|
+
group: forms
|
|
6
|
+
toc: true
|
|
7
|
+
|
|
8
|
+
previous: Range Slider
|
|
9
|
+
previousLink: forms/range/
|
|
10
|
+
next: Headings
|
|
11
|
+
nextLink: typography/headings/
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
The floating label style was first pioneered by Google in its infamous Material UI design system and it's basically a label tag which floats just above the input field when it is being focused or already has content inside.
|
|
15
|
+
|
|
16
|
+
On this page you will find a three different input field styles including a standard, outlined, and filled style including validation styles and sizes coded with Tailwind CSS and supported for dark mode.
|
|
17
|
+
|
|
18
|
+
## Floating label example
|
|
19
|
+
|
|
20
|
+
Get started with the following three styles for the floating label component and use the `label` tag as a visual placeholder using the `peer-placeholder-shown` and `peer-focus` utility classes from Tailwind CSS.
|
|
21
|
+
|
|
22
|
+
{{< example class="grid items-end w-full gap-6 md:grid-cols-3" github="forms/floating-label.md" show_dark=true >}}
|
|
23
|
+
<div class="relative">
|
|
24
|
+
<input type="text" id="floating_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
25
|
+
<label for="floating_filled" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Floating filled</label>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="relative">
|
|
28
|
+
<input type="text" id="floating_outlined" class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-heading bg-transparent rounded-base border-1 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
29
|
+
<label for="floating_outlined" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto start-1">Floating outlined</label>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="relative z-0">
|
|
32
|
+
<input type="text" id="floating_standard" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
33
|
+
<label for="floating_standard" class="absolute text-sm text-body duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Floating standard</label>
|
|
34
|
+
</div>
|
|
35
|
+
{{< /example >}}
|
|
36
|
+
|
|
37
|
+
## Floating label with icons
|
|
38
|
+
|
|
39
|
+
Use these examples of floating label input fields with a descriptive [SVG icon](https://flowbite.com/icons/).
|
|
40
|
+
|
|
41
|
+
{{< example class="grid items-end w-full gap-6 md:grid-cols-3" github="forms/floating-label.md" show_dark=true >}}
|
|
42
|
+
<div class="relative">
|
|
43
|
+
<input type="text" id="floating_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
44
|
+
<label for="floating_filled" class="inline-flex items-center absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">
|
|
45
|
+
<svg class="w-4 h-4 me-1.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-width="2" d="m3.5 5.5 7.893 6.036a1 1 0 0 0 1.214 0L20.5 5.5M4 19h16a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Z"/></svg>
|
|
46
|
+
Floating filled
|
|
47
|
+
</label>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="relative">
|
|
50
|
+
<input type="text" id="floating_outlined" class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-heading bg-transparent rounded-base border-1 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
51
|
+
<label for="floating_outlined" class="inline-flex items-center absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto start-1">
|
|
52
|
+
<svg class="w-4 h-4 me-1.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-width="2" d="m3.5 5.5 7.893 6.036a1 1 0 0 0 1.214 0L20.5 5.5M4 19h16a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Z"/></svg>
|
|
53
|
+
Floating outlined
|
|
54
|
+
</label>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="relative z-0">
|
|
57
|
+
<input type="text" id="floating_standard" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
58
|
+
<label for="floating_standard" class="inline-flex items-center absolute text-sm text-body duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">
|
|
59
|
+
<svg class="w-4 h-4 me-1.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-width="2" d="m3.5 5.5 7.893 6.036a1 1 0 0 0 1.214 0L20.5 5.5M4 19h16a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Z"/></svg>
|
|
60
|
+
Floating standard
|
|
61
|
+
</label>
|
|
62
|
+
</div>
|
|
63
|
+
{{< /example >}}
|
|
64
|
+
|
|
65
|
+
## Disabled state
|
|
66
|
+
|
|
67
|
+
Apply the `disabled` attribute to the input fields to disallow the user from changing the content.
|
|
68
|
+
|
|
69
|
+
{{< example class="grid items-end gap-6 md:grid-cols-3" github="forms/floating-label.md" show_dark=true >}}
|
|
70
|
+
<div class="relative">
|
|
71
|
+
<input type="text" id="disabled_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " disabled />
|
|
72
|
+
<label for="disabled_filled" class="absolute text-sm text-fg-disabled duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Disabled filled</label>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="relative">
|
|
75
|
+
<input type="text" id="disabled_outlined" class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-heading bg-transparent rounded-base border-1 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " disabled />
|
|
76
|
+
<label for="disabled_outlined" class="absolute text-sm text-fg-disabled duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Disabled outlined</label>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="relative z-0">
|
|
79
|
+
<input type="text" id="disabled_standard" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " disabled />
|
|
80
|
+
<label for="disabled_standard" class="absolute text-sm text-fg-disabled duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Disabled standard</label>
|
|
81
|
+
</div>
|
|
82
|
+
{{< /example >}}
|
|
83
|
+
|
|
84
|
+
## Validation
|
|
85
|
+
|
|
86
|
+
Use the following examples of input validation for the success and error messages by applying the validation text below the input field and using the green or red color classes from Tailwind CSS.
|
|
87
|
+
|
|
88
|
+
{{< example github="forms/floating-label.md" show_dark=true >}}
|
|
89
|
+
<!-- Success messages -->
|
|
90
|
+
<div class="grid items-end gap-6 mb-6 md:grid-cols-3">
|
|
91
|
+
<div>
|
|
92
|
+
<div class="relative">
|
|
93
|
+
<input type="text" id="filled_success" aria-describedby="filled_success_help" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-success-soft border-0 border-b-2 border-success appearance-none focus:outline-none focus:ring-0 focus:border-success peer" placeholder=" " />
|
|
94
|
+
<label for="filled_success" class="absolute text-sm text-fg-success-strong duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Filled success</label>
|
|
95
|
+
</div>
|
|
96
|
+
<p id="filled_success_help" class="mt-2 text-xs text-fg-success-strong"><span class="font-medium">Well done!</span> Some success message.</p>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<div class="relative">
|
|
100
|
+
<input type="text" id="outlined_success" aria-describedby="outlined_success_help" class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-heading bg-transparent rounded-base border-1 border-success appearance-none focus:outline-none focus:ring-0 focus:border-success peer" placeholder=" " />
|
|
101
|
+
<label for="outlined_success" class="absolute text-sm text-fg-success-strong duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Outlined success</label>
|
|
102
|
+
</div>
|
|
103
|
+
<p id="outlined_success_help" class="mt-2 text-xs text-fg-success-strong"><span class="font-medium">Well done!</span> Some success message.</p>
|
|
104
|
+
</div>
|
|
105
|
+
<div>
|
|
106
|
+
<div class="relative z-0">
|
|
107
|
+
<input type="text" id="standard_success" aria-describedby="standard_success_help" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-success appearance-none focus:outline-none focus:ring-0 focus:border-success peer" placeholder=" " />
|
|
108
|
+
<label for="standard_success" class="absolute text-sm text-fg-success-strong duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Standard success</label>
|
|
109
|
+
</div>
|
|
110
|
+
<p id="standard_success_help" class="mt-2 text-xs text-fg-success-strong"><span class="font-medium">Well done!</span> Some success message.</p>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<!-- Error messages -->
|
|
115
|
+
<div class="grid items-end gap-6 md:grid-cols-3">
|
|
116
|
+
<div>
|
|
117
|
+
<div class="relative">
|
|
118
|
+
<input type="text" id="filled_error" aria-describedby="filled_error_help" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-danger-soft border-0 border-b-2 appearance-none focus:outline-none focus:ring-0 border-danger focus:border-danger peer" placeholder=" " />
|
|
119
|
+
<label for="filled_error" class="absolute text-sm duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 text-fg-danger-strong peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Filled error</label>
|
|
120
|
+
</div>
|
|
121
|
+
<p id="filled_error_help" class="mt-2 text-xs text-fg-danger-strong"><span class="font-medium">Oh, snapp!</span> Some error message.</p>
|
|
122
|
+
</div>
|
|
123
|
+
<div>
|
|
124
|
+
<div class="relative">
|
|
125
|
+
<input type="text" id="outlined_error" aria-describedby="outlined_error_help" class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-heading bg-transparent rounded-base border-1 appearance-none border-danger focus:outline-none focus:ring-0 focus:border-danger peer" placeholder=" " />
|
|
126
|
+
<label for="outlined_error" class="absolute text-sm text-fg-danger-strong duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Outlined error</label>
|
|
127
|
+
</div>
|
|
128
|
+
<p id="outlined_error_help" class="mt-2 text-xs text-fg-danger-strong"><span class="font-medium">Oh, snapp!</span> Some error message.</p>
|
|
129
|
+
</div>
|
|
130
|
+
<div>
|
|
131
|
+
<div class="relative z-0">
|
|
132
|
+
<input type="text" id="standard_error" aria-describedby="standard_error_help" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-danger appearance-none focus:outline-none focus:ring-0 focus:border-danger peer" placeholder=" " />
|
|
133
|
+
<label for="standard_error" class="absolute text-sm text-fg-danger-strong duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Standard error</label>
|
|
134
|
+
</div>
|
|
135
|
+
<p id="standard_error_help" class="mt-2 text-xs text-fg-danger-strong"><span class="font-medium">Oh, snapp!</span> Some error message.</p>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
{{< /example >}}
|
|
139
|
+
|
|
140
|
+
## Sizes
|
|
141
|
+
|
|
142
|
+
Use the small and default sizes of the floating label input fields from the following example.
|
|
143
|
+
|
|
144
|
+
{{< example github="forms/floating-label.md" show_dark=true >}}
|
|
145
|
+
<div class="grid items-end gap-6 mb-6 md:grid-cols-3">
|
|
146
|
+
<div class="relative">
|
|
147
|
+
<input type="text" id="small_filled" class="block rounded-t-base px-2.5 pb-1.5 pt-4 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
148
|
+
<label for="small_filled" class="absolute text-sm text-body duration-300 transform -translate-y-3 scale-75 top-3 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-3 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Small filled</label>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="relative">
|
|
151
|
+
<input type="text" id="small_outlined" class="block px-2.5 pb-1.5 pt-3 w-full text-sm text-heading bg-transparent rounded-base border-1 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
152
|
+
<label for="small_outlined" class="absolute text-sm text-body duration-300 transform -translate-y-3 scale-75 top-1 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-1 peer-focus:scale-75 peer-focus:-translate-y-3 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Small outlined</label>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="relative z-0">
|
|
155
|
+
<input type="text" id="small_standard" class="block w-full px-0 py-2 text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
156
|
+
<label for="small_standard" class="absolute text-sm text-body duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Small standard</label>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
<div class="grid items-end gap-6 md:grid-cols-3">
|
|
160
|
+
<div class="relative">
|
|
161
|
+
<input type="text" id="default_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
162
|
+
<label for="default_filled" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Default filled</label>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="relative">
|
|
165
|
+
<input type="text" id="default_outlined" class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-heading bg-transparent rounded-base border-1 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
166
|
+
<label for="default_outlined" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-neutral-primary px-2 peer-focus:px-2 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Default outlined</label>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="relative z-0">
|
|
169
|
+
<input type="text" id="default_standard" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
170
|
+
<label for="default_standard" class="absolute text-sm text-body duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Default standard</label>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
{{< /example >}}
|
|
174
|
+
|
|
175
|
+
## Helper text
|
|
176
|
+
|
|
177
|
+
Add a helper text in addition to the label if you want to show more information below the input field.
|
|
178
|
+
|
|
179
|
+
{{< example github="forms/floating-label.md" show_dark=true >}}
|
|
180
|
+
<div class="relative">
|
|
181
|
+
<input type="text" id="floating_helper" aria-describedby="floating_helper_text" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
|
|
182
|
+
<label for="floating_helper" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Floating helper</label>
|
|
183
|
+
</div>
|
|
184
|
+
<p id="floating_helper_text" class="mt-2.5 text-xs text-body">Remember, contributions to this topic should follow our <a href="#" class="text-fg-brand hover:underline">Community Guidelines</a>.</p>
|
|
185
|
+
{{< /example >}}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Tailwind CSS Input Field - Flowbite
|
|
4
|
+
description: Get started with a collection of input fields built with Tailwind CSS to start accepting data from the user based on multiple sizes, variants, and input types
|
|
5
|
+
group: forms
|
|
6
|
+
toc: true
|
|
7
|
+
|
|
8
|
+
previous: Video
|
|
9
|
+
previousLink: components/video/
|
|
10
|
+
next: File Input
|
|
11
|
+
nextLink: forms/file-input/
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
The input field is an important part of the form element that can be used to create interactive controls to accept data from the user based on multiple input types, such as text, email, number, password, URL, phone number, and more.
|
|
15
|
+
|
|
16
|
+
On this page you will find all of the input types based on multiple variants, styles, colors, and sizes built with the utility classes from Tailwind CSS and components from Flowbite.
|
|
17
|
+
|
|
18
|
+
## Input fields
|
|
19
|
+
|
|
20
|
+
Use this example as a generic form element which includes multiple input fields types such as text, email, password, number, URL, and phone number and use the grid layout to add multiple columns and rows.
|
|
21
|
+
|
|
22
|
+
{{< example github="forms/input-field.md" show_dark=true >}}
|
|
23
|
+
<form>
|
|
24
|
+
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
|
25
|
+
<div>
|
|
26
|
+
<label for="first_name" class="block mb-2.5 text-sm font-medium text-heading">First name</label>
|
|
27
|
+
<input type="text" id="first_name" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="John" required />
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<label for="last_name" class="block mb-2.5 text-sm font-medium text-heading">Last name</label>
|
|
31
|
+
<input type="text" id="last_name" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="Doe" required />
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<label for="company" class="block mb-2.5 text-sm font-medium text-heading">Company</label>
|
|
35
|
+
<input type="text" id="company" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="Flowbite" required />
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<label for="phone" class="block mb-2.5 text-sm font-medium text-heading">Phone number</label>
|
|
39
|
+
<input type="tel" id="phone" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="123-45-678" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}" required />
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
<label for="website" class="block mb-2.5 text-sm font-medium text-heading">Website URL</label>
|
|
43
|
+
<input type="url" id="website" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="flowbite.com" required />
|
|
44
|
+
</div>
|
|
45
|
+
<div>
|
|
46
|
+
<label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Unique visitors (per month)</label>
|
|
47
|
+
<input type="number" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="" required />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="mb-6">
|
|
51
|
+
<label for="email" class="block mb-2.5 text-sm font-medium text-heading">Email address</label>
|
|
52
|
+
<input type="email" id="email" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="john.doe@company.com" required />
|
|
53
|
+
</div>
|
|
54
|
+
<div class="mb-6">
|
|
55
|
+
<label for="password" class="block mb-2.5 text-sm font-medium text-heading">Password</label>
|
|
56
|
+
<input type="password" id="password" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="•••••••••" required />
|
|
57
|
+
</div>
|
|
58
|
+
<div class="mb-6">
|
|
59
|
+
<label for="confirm_password" class="block mb-2.5 text-sm font-medium text-heading">Confirm password</label>
|
|
60
|
+
<input type="password" id="confirm_password" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="•••••••••" required />
|
|
61
|
+
</div>
|
|
62
|
+
<div class="flex items-start mb-6">
|
|
63
|
+
<div class="flex items-center h-5">
|
|
64
|
+
<input id="remember" type="checkbox" value="" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft" required />
|
|
65
|
+
</div>
|
|
66
|
+
<label for="remember" class="ms-2 text-sm font-medium text-heading">I agree with the <a href="#" class="text-fg-brand hover:underline">terms and conditions</a>.</label>
|
|
67
|
+
</div>
|
|
68
|
+
<button type="submit" 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">Submit</button>
|
|
69
|
+
</form>
|
|
70
|
+
{{< /example >}}
|
|
71
|
+
|
|
72
|
+
## Input sizes
|
|
73
|
+
|
|
74
|
+
Use the following examples to apply a small, default or large size for the input fields.
|
|
75
|
+
|
|
76
|
+
{{< example class="space-y-6" github="forms/input-field.md" show_dark=true >}}
|
|
77
|
+
<div>
|
|
78
|
+
<label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Small Input</label>
|
|
79
|
+
<input type="text" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-2.5 py-2 shadow-xs placeholder:text-body" placeholder="" required />
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Base Input</label>
|
|
83
|
+
<input type="text" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="" required />
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Large Input</label>
|
|
87
|
+
<input type="text" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-base rounded-base focus:ring-brand focus:border-brand block w-full px-3.5 py-3 shadow-xs placeholder:text-body" placeholder="" required />
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Extra Large Input</label>
|
|
91
|
+
<input type="text" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-base rounded-base focus:ring-brand focus:border-brand block w-full px-4 py-3.5 shadow-xs placeholder:text-body" placeholder="" required />
|
|
92
|
+
</div>
|
|
93
|
+
{{< /example >}}
|
|
94
|
+
|
|
95
|
+
## Disabled state
|
|
96
|
+
|
|
97
|
+
Get started with this example if you want to apply the disabled state to an input field.
|
|
98
|
+
|
|
99
|
+
{{< example class="space-y-6" github="forms/input-field.md" show_dark=true >}}
|
|
100
|
+
<input type="text" id="disabled-input" aria-label="disabled input" class="bg-neutral-secondary-medium border border-default-medium text-fg-disabled text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" value="Disabled input" disabled>
|
|
101
|
+
<input type="text" id="disabled-input-2" aria-label="disabled input 2" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" value="Disabled readonly input" disabled readonly>
|
|
102
|
+
{{< /example >}}
|
|
103
|
+
|
|
104
|
+
## Validation
|
|
105
|
+
|
|
106
|
+
Use the following example to apply validation styles for success and error messages.
|
|
107
|
+
|
|
108
|
+
{{< example github="forms/input-field.md" show_dark=true >}}
|
|
109
|
+
<div class="mb-6">
|
|
110
|
+
<label for="success" class="block mb-2.5 text-sm font-medium text-fg-success-strong">Your name</label>
|
|
111
|
+
<input type="text" id="success" class="bg-success-soft border border-success-subtle text-fg-success-strong text-sm rounded-base focus:ring-success focus:border-success block w-full px-3 py-2.5 shadow-xs placeholder:text-fg-success-strong" placeholder="Success input">
|
|
112
|
+
<p class="mt-2.5 text-sm text-fg-success-strong"><span class="font-medium">Well done!</span> Some success message.</p>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="mb-6">
|
|
115
|
+
<label for="danger" class="block mb-2.5 text-sm font-medium text-fg-danger-strong">Your name</label>
|
|
116
|
+
<input type="text" id="danger" class="bg-danger-soft border border-danger-subtle text-fg-danger-strong text-sm rounded-base focus:ring-danger focus:border-danger block w-full px-3 py-2.5 shadow-xs placeholder:text-fg-danger-strong" placeholder="Error input">
|
|
117
|
+
<p class="mt-2.5 text-sm text-fg-danger-strong"><span class="font-medium">Oh, snapp!</span> Some error message.</p>
|
|
118
|
+
</div>
|
|
119
|
+
{{< /example >}}
|
|
120
|
+
|
|
121
|
+
## Input group
|
|
122
|
+
|
|
123
|
+
This example can be used to add a descriptive icon or additional text inside the input field.
|
|
124
|
+
|
|
125
|
+
{{< example class="space-y-6" github="forms/input-field.md" show_dark=true >}}
|
|
126
|
+
<label for="input-group-1" class="block mb-2.5 text-sm font-medium text-heading">Your Email</label>
|
|
127
|
+
<div class="relative">
|
|
128
|
+
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
|
129
|
+
<svg class="w-4 h-4 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-width="2" d="m3.5 5.5 7.893 6.036a1 1 0 0 0 1.214 0L20.5 5.5M4 19h16a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Z"/></svg>
|
|
130
|
+
</div>
|
|
131
|
+
<input type="text" id="input-group-1" class="block w-full ps-9 pe-3 py-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" placeholder="name@flowbite.com">
|
|
132
|
+
</div>
|
|
133
|
+
<label for="website-admin" class="block mb-2.5 text-sm font-medium text-heading">Username</label>
|
|
134
|
+
<div class="flex shadow-xs rounded-base">
|
|
135
|
+
<span class="inline-flex items-center px-3 text-sm text-body bg-neutral-tertiary border rounded-e-0 border-default-medium border-e-0 rounded-s-base">
|
|
136
|
+
<svg class="w-4 h-4 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="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0 0a8.949 8.949 0 0 0 4.951-1.488A3.987 3.987 0 0 0 13 16h-2a3.987 3.987 0 0 0-3.951 3.512A8.948 8.948 0 0 0 12 21Zm3-11a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
|
|
137
|
+
</span>
|
|
138
|
+
<input type="text" id="website-admin" class="rounded-none rounded-e-base block w-full px-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand placeholder:text-body" placeholder="elonmusk">
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<label for="website" class="block mb-2.5 text-sm font-medium text-heading">Website</label>
|
|
142
|
+
<div class="flex shadow-xs rounded-base">
|
|
143
|
+
<span class="inline-flex items-center px-3 text-sm text-body bg-neutral-tertiary border rounded-e-0 border-default-medium border-e-0 rounded-s-base">
|
|
144
|
+
https://
|
|
145
|
+
</span>
|
|
146
|
+
<input type="text" id="website" class="rounded-none rounded-e-base block w-full px-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand placeholder:text-body" placeholder="flowbite.com">
|
|
147
|
+
</div>
|
|
148
|
+
{{< /example >}}
|
|
149
|
+
|
|
150
|
+
## Helper text
|
|
151
|
+
|
|
152
|
+
Use this example to show a helper text below the input field for additional explanation and links.
|
|
153
|
+
|
|
154
|
+
{{< example github="forms/input-field.md" show_dark=true >}}
|
|
155
|
+
<label for="input-group-1" class="block mb-2.5 text-sm font-medium text-heading">Your Email</label>
|
|
156
|
+
<div class="relative">
|
|
157
|
+
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
|
158
|
+
<svg class="w-4 h-4 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-width="2" d="m3.5 5.5 7.893 6.036a1 1 0 0 0 1.214 0L20.5 5.5M4 19h16a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Z"/></svg>
|
|
159
|
+
</div>
|
|
160
|
+
<input type="text" id="input-group-1" class="block w-full ps-9 pe-3 py-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" placeholder="name@flowbite.com">
|
|
161
|
+
</div>
|
|
162
|
+
<p id="helper-text-explanation" class="mt-2.5 text-sm text-body">We’ll never share your details. Read our <a href="#" class="font-medium text-fg-brand hover:underline">Privacy Policy</a>.</p>
|
|
163
|
+
{{< /example >}}
|
|
164
|
+
|
|
165
|
+
## Search input
|
|
166
|
+
|
|
167
|
+
Get started with this example where the submit button is positioned inside the input field.
|
|
168
|
+
|
|
169
|
+
{{< example github="forms/input-field.md" show_dark=true >}}
|
|
170
|
+
<form>
|
|
171
|
+
<label for="search" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Search</label>
|
|
172
|
+
<div class="relative">
|
|
173
|
+
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
|
174
|
+
<svg class="w-4 h-4 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-width="2" d="m21 21-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"/></svg>
|
|
175
|
+
</div>
|
|
176
|
+
<input type="search" id="search" class="block w-full p-3 ps-9 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" placeholder="Search" required />
|
|
177
|
+
<button type="button" class="absolute end-1.5 bottom-1.5 text-white bg-brand hover:bg-brand-strong box-border border border-transparent focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded text-xs px-3 py-1.5 focus:outline-none">Search</button>
|
|
178
|
+
</div>
|
|
179
|
+
</form>
|
|
180
|
+
{{< /example >}}
|
|
181
|
+
|
|
182
|
+
<div class="mt-8 -mb-5">
|
|
183
|
+
{{< requires_js >}}
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
## Dropdown input
|
|
187
|
+
|
|
188
|
+
Use this example to show a dropdown menu right next to the input field.
|
|
189
|
+
|
|
190
|
+
{{< example github="forms/input-field.md" show_dark=true iframeHeight="290" >}}
|
|
191
|
+
<form>
|
|
192
|
+
<div class="flex shadow-xs rounded-base -space-x-0.5">
|
|
193
|
+
<label for="search-dropdown" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Your Email</label>
|
|
194
|
+
<button id="dropdown-button" data-dropdown-toggle="dropdown" type="button" class="inline-flex items-center shrink-0 z-10 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 font-medium leading-5 rounded-s-base text-sm px-4 py-2.5 focus:outline-none">
|
|
195
|
+
<svg class="w-4 h-4 me-1.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="M9.143 4H4.857A.857.857 0 0 0 4 4.857v4.286c0 .473.384.857.857.857h4.286A.857.857 0 0 0 10 9.143V4.857A.857.857 0 0 0 9.143 4Zm10 0h-4.286a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286A.857.857 0 0 0 20 9.143V4.857A.857.857 0 0 0 19.143 4Zm-10 10H4.857a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286a.857.857 0 0 0 .857-.857v-4.286A.857.857 0 0 0 9.143 14Zm10 0h-4.286a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286a.857.857 0 0 0 .857-.857v-4.286a.857.857 0 0 0-.857-.857Z"/></svg>
|
|
196
|
+
All categories
|
|
197
|
+
<svg class="w-4 h-4 ms-1.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="m19 9-7 7-7-7"/></svg>
|
|
198
|
+
</button>
|
|
199
|
+
<div id="dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
|
|
200
|
+
<ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdown-button">
|
|
201
|
+
<li>
|
|
202
|
+
<a href="#" class="block p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded-md">Shopping</a>
|
|
203
|
+
</li>
|
|
204
|
+
<li>
|
|
205
|
+
<a href="#" class="block p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded-md">Images</a>
|
|
206
|
+
</li>
|
|
207
|
+
<li>
|
|
208
|
+
<a href="#" class="block p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded-md">News</a>
|
|
209
|
+
</li>
|
|
210
|
+
<li>
|
|
211
|
+
<a href="#" class="block p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded-md">Finance</a>
|
|
212
|
+
</li>
|
|
213
|
+
</ul>
|
|
214
|
+
</div>
|
|
215
|
+
<input type="search" id="search-dropdown" id="input-group-1" class="px-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm focus:ring-brand focus:border-brand block w-full placeholder:text-body" placeholder="Search for products" required>
|
|
216
|
+
<button type="button" class="inline-flex items-center text-white bg-brand hover:bg-brand-strong box-border border border-transparent focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-e-base text-sm px-4 py-2.5 focus:outline-none">
|
|
217
|
+
<svg class="w-4 h-4 me-1.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-width="2" d="m21 21-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"/></svg>
|
|
218
|
+
Search
|
|
219
|
+
</button>
|
|
220
|
+
</div>
|
|
221
|
+
</form>
|
|
222
|
+
{{< /example >}}
|