Menubar.
menus berisi label dan items tautan.
Preview
<?= component('menubar', ['label' => 'Try this component', 'menus' => [['label' => 'Explore', 'items' => [['label' => 'Overview', 'href' => '/'], ['label' => 'Components', 'href' => '/components'], ['label' => 'Icons', 'href' => '/icons']]], ['label' => 'Resources', 'items' => [['label' => 'Playground', 'href' => '/playground']]]]]) ?>Usage
menus berisi label dan items tautan. Tiap grup memakai dropdown-menu.
- 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('menubar', ['label' => 'Try this component', 'menus' => [['label' => 'Explore', 'items' => [['label' => 'Overview', 'href' => '/'], ['label' => 'Components', 'href' => '/components'], ['label' => 'Icons', 'href' => '/icons']]], ['label' => 'Resources', 'items' => [['label' => 'Playground', 'href' => '/playground']]]]]) ?>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 |
|---|---|---|
label | string | Teks label, pemicu, atau nama aksesibel komponen. |
menus | array<{label:string,items:array<{label:string,href:string}>}> | Daftar objek; isi field setiap objek mengikuti struktur tipe. |
Behavior & accessibility
Navigasi native, bukan implementasi lengkap pola ARIA desktop menubar. Label menjelaskan konteks menu.
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/menubar.php. Edit template ini jika membutuhkan perilaku tambahan. API PHP DL berbeda dari API React sumber rujukan.
php dl component menubar