Basic Input
A labelled text input with helper text wired to it via aria-describedby.
6 फ्रेमवर्कशुरुआती
A label that sits inside the field and floats above the value on focus or fill.
<!--
The trick that makes this work without a line of JavaScript: the input carries
placeholder=" " - a single space, never empty. :placeholder-shown then means
exactly "the user has typed nothing", and the label parks itself over the box
in that state and floats up otherwise.
This is still a real <label for>, not a placeholder cosplaying as one. It is
in the accessibility tree the whole time; it only moves.
-->
<div class="float-field">
<input
class="float-field__input"
id="float-field-name"
name="fullName"
type="text"
placeholder=" "
autocomplete="name"
/>
<label class="float-field__label" for="float-field-name">Full name</label>
</div>| Prop | टाइप | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
labelआवश्यक | string | - | लोड होते समय पढ़ा जाने वाला एक्सेसिबल लेबल। |
value | string | - | मेट्रिक की मौजूदा वैल्यू, पहले से फ़ॉर्मैट की हुई। |
disabled | boolean | false | इंटरैक्शन रोकता है और कंट्रोल को धुँधला कर देता है। |
className | string | - | रूट एलिमेंट पर मर्ज होने वाली अतिरिक्त क्लासेज़। |
`placeholder=" "` - a single space, never empty - is load-bearing. It makes `:placeholder-shown` mean exactly "the user has typed nothing", which is what drives the float, and it is why the TypeScript variant omits `placeholder` from the inherited attributes: a caller-supplied one would silently pin the label in its floated position forever. This is still a real `<label for>` that lives in the accessibility tree the whole time; it only moves. `pointer-events-none` lets clicks pass through to the input underneath, and the asymmetric `pt-5` reserves the strip the label lands in so the value never shares a row with it.