شجرة العناصر Tree View
قائمة متدرّجة، يتوسّع كل عنصر فيها ليُظهر ما بداخله، مثل مجلدات الملفات.
role="tree" + role="treeitem"متى تستخدمه
لهياكل متداخلة: الملفات، أو الأقسام، أو بنود BOQ.
خطأ شائع
عند تجاوز ٤ مستويات تصبح صعبة؛ بسّطها.
إمكانية الوصول
Arrow keys expand, collapse and move; follow the ARIA tree pattern.
اسمه في الكود
| HTML/CSS | role="tree" + role="treeitem" |
|---|---|
| React | <TreeView> |
| Jetpack Compose | LazyColumn + indentation (custom) |
| SwiftUI | OutlineGroup / List(children:) |
برومبت جاهز لوكيل البرمجة
Add a Tree View to this screen.
What it is: An indented list where items expand to reveal their children, like file folders.
Implement with: role="tree" + role="treeitem" (HTML/CSS).
Accessibility: Arrow keys expand, collapse and move; follow the ARIA tree pattern.
When to use it: For nested structures: files, departments, BOQ items.
Avoid: Past four levels it gets hard; simplify.
Reuse the project's existing design tokens, spacing and component conventions.
أو ركّب صفحة كاملة من هذا العنصر وغيره →
البرومبت بالإنجليزية لأنها الأدق مع Claude Code وأمثاله.