العنوان العائم Floating Label
عنوان الحقل يكون داخله، وعندما تبدأ الكتابة يرتفع إلى الأعلى ويصغر.
:placeholder-shown + CSS transformمتى تستخدمه
لنماذج بتصميم Material ومساحة ضيقة.
خطأ شائع
لا تصغّره إلى درجة يتعذّر معها قراءته.
إمكانية الوصول
The label must stay visible after typing, never disappear.
اسمه في الكود
| HTML/CSS | :placeholder-shown + CSS transform |
|---|---|
| React | <TextField label> — MUI |
| Jetpack Compose | OutlinedTextField(label = { }) |
| SwiftUI | Custom (ZStack + animation) |
برومبت جاهز لوكيل البرمجة
Add a Floating Label to this screen.
What it is: The label sits inside the field, then shrinks and floats up when you start typing.
Implement with: :placeholder-shown + CSS transform (HTML/CSS).
Accessibility: The label must stay visible after typing, never disappear.
When to use it: For Material-style forms where space is tight.
Avoid: Don’t shrink it until it’s unreadable.
Reuse the project's existing design tokens, spacing and component conventions.
أو ركّب صفحة كاملة من هذا العنصر وغيره →
البرومبت بالإنجليزية لأنها الأدق مع Claude Code وأمثاله.