Skip to content
COMPONENT / OVERLAYS

Dropdown Menu.

Kelompokkan tautan dalam disclosure.

PHP + native HTML/CSSNo build

Preview

Try this component

Usage

Kelompokkan tautan dalam disclosure. Gunakan href untuk navigasi; mutasi tetap memakai form POST terpisah.

  1. Gunakan layout DL yang sudah memuat CSS dan dl.js.
  2. Letakkan kode berikut di view PHP Anda.
  3. Ganti data contoh dengan nilai aplikasi. Teks di-escape otomatis.
PHP view
<?= component('dropdown-menu', ['label' => 'Try this component', 'items' => [['label' => 'Overview', 'href' => '/'], ['label' => 'Components', 'href' => '/components'], ['label' => 'Icons', 'href' => '/icons']]]) ?>

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.

Dropdown Menu props
PropType / valuesPanduan
labelstringTeks label, pemicu, atau nama aksesibel komponen.
itemsarray<{label:string,href?:string,current?:bool}>Urutan item; struktur lengkap ditunjukkan pada tipe dan contoh.

Behavior & accessibility

Tab menjangkau tautan; enhancement menambah panah dan Escape. Struktur native details menjadi fallback.

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/dropdown-menu.php. Edit template ini jika membutuhkan perilaku tambahan. API PHP DL berbeda dari API React sumber rujukan.

Terminal
php dl component dropdown-menu

Component guide · JavaScript & events · Styling

Icons: Solar by 480 Design (CC BY 4.0) & Iconsax (MIT). PHP UI adapted from Coordiation. Logo: DesignLof.