Popover.
Panel nonmodal menggunakan Popover API browser.
Preview
Small, understandable components. Native PHP, ready for the browser.
<?= component('popover', ['title' => 'Made for your next idea', 'text' => 'Small, understandable components. Native PHP, ready for the browser.', 'label' => 'Try this component']) ?>Usage
Panel nonmodal menggunakan Popover API browser. Klik pemicu, klik di luar atau Escape untuk menutup.
- 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('popover', ['title' => 'Made for your next idea', 'text' => 'Small, understandable components. Native PHP, ready for the browser.', 'label' => 'Try this component']) ?>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 |
|---|---|---|
title | string | Judul konten yang ditampilkan. |
text | string | Isi teks biasa; HTML di-escape. |
label | string | Teks label, pemicu, atau nama aksesibel komponen. |
id | string | ID unik DOM. Jika tidak diberikan, template memakai ID otomatis atau nama field. |
Behavior & accessibility
Tidak mengunci fokus seperti dialog. Memerlukan browser yang mendukung Popover API.
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/popover.php. Edit template ini jika membutuhkan perilaku tambahan. API PHP DL berbeda dari API React sumber rujukan.
php dl component popover