Tabs.
Kelompokkan konten teks terkait melalui items.
Preview
PHP components, ready to use.
No runtime compilation.
Upload the public assets to cPanel.
<?= component('tabs', ['label' => 'Try this component', 'items' => [['title' => 'Overview', 'text' => 'PHP components, ready to use.'], ['title' => 'Details', 'text' => 'No runtime compilation.'], ['title' => 'Deploy', 'text' => 'Upload the public assets to cPanel.']]]) ?>Usage
Kelompokkan konten teks terkait melalui items. Tab pertama menjadi aktif setelah enhancement.
- Gunakan layout DL yang sudah memuat CSS dan dl.js.
- Letakkan kode berikut di view PHP Anda.
- Ganti data contoh dengan nilai aplikasi. Teks di-escape otomatis.
<?= component('tabs', ['label' => 'Try this component', 'items' => [['title' => 'Overview', 'text' => 'PHP components, ready to use.'], ['title' => 'Details', 'text' => 'No runtime compilation.'], ['title' => 'Deploy', 'text' => 'Upload the public assets to cPanel.']]]) ?>API reference
Props PHP yang didukung implementasi DL. Field di dalam array mengikuti bentuk pada kolom Type. Props yang tidak dicantumkan tidak menjadi bagian API komponen.
| Prop | Type / values | Panduan |
|---|---|---|
items | array<{title:string,text:string}> | Urutan item; struktur lengkap ditunjukkan pada tipe dan contoh. |
id | string | ID unik DOM. Jika tidak diberikan, template memakai ID otomatis atau nama field. |
label | string | Teks label, pemicu, atau nama aksesibel komponen. |
Behavior & accessibility
Tombol panah berpindah tab; Home dan End memilih batas. Tanpa JavaScript semua panel tetap terbaca.
Uji keyboard, fokus, dan pembaca layar pada halaman aplikasi Anda. Contoh ini tidak menggantikan audit aksesibilitas aplikasi secara menyeluruh.
Source & agent context
Source tersedia di views/components/tabs.php. Edit template ini jika membutuhkan perilaku tambahan. API PHP DL berbeda dari API React sumber rujukan.
php dl component tabs