@@ -8,24 +8,24 @@ Demo - https://unlight.github.io/tailwind-float-label
88
991 . ` npm install --save-dev tailwind-float-label `
10102 . Add ` @import 'tailwind-float-label' ` to your main css file
11- 3 . Plugin provides classes which must be set for label and input to make label floats.
11+ 3 . Configure css variable ` --float-label-background-color ` for background of
12+ float label
13+ 4 . Plugin provides classes which must be set for label and input to make label floats.
1214 - ` .float-container ` Container which holds input control and label
1315 - ` .float-input ` Form input control
1416 - ` .float-always ` Use with ` .float-container ` to make label always visible (sticky)
1517
1618``` html
1719<form class =" max-w-xs mx-auto p-5 space-y-4" >
18- <h2 class =" text-2xl font-bold text-center" >Example</h2 >
1920 <div class =" float-container" >
20- <label for =" name " class =" float-label px-2 bg-white text-gray-500 "
21- >Name</label
21+ <label for =" fullname " class =" float-label px-2 text-gray-600 "
22+ >Full Name</label
2223 >
2324 <input
2425 type =" text"
25- id =" name"
26- autocomplete =" off"
27- placeholder =" Name"
28- class =" float-input outline-none focus:shadow-outline border w-full px-1"
26+ id =" fullname"
27+ class =" float-input w-full px-3 py-2 border border-gray-300"
28+ placeholder =" Full Name"
2929 />
3030 </div >
3131</form >
@@ -47,11 +47,3 @@ If you need animation, add to `.float-label` following classes: `transition-all
4747## License
4848
4949[ MIT License] ( https://opensource.org/licenses/MIT ) (c) 2025
50-
51- ## TODO
52-
53- - find information about plugins how to do it
54- - how to set variables
55- - update readme (no sticky, just remove input placeholder)
56- - block with multiple type of input (select, text area)
57- - block with size of inputs (lg, xs, sm)
0 commit comments