Widget Demos
UI Components
Marketing
Content Display
Navigation
Notifications
Visual Effects
Interactive
Layout
UI Components
Theme Widget
A flexible theme switcher widget supporting light, dark, and system-preference modes. Available in multiple display types: floating button, dropdown menu, toggle switch, and segmented control.
Floating Button (Default)
Fixed position floating button, typically in the corner of the screen.
Code
<?php echo ThemeWidget::widget(); ?>Live Demo
☀️
Light
🌙
Dark
💻
System
Dropdown Menu
Toggle Switch
Simple toggle between light and dark modes (no system option).
Code
<?php echo ThemeWidget::widget([
'type' => 'toggle',
'showLabels' => true,
]); ?>Live Demo
Segmented Control
iOS-style segmented control showing all three options.
Code
<?php echo ThemeWidget::widget([
'type' => 'segmented',
'showLabels' => true,
]); ?>Live Demo
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
type | string | floating | Display type: floating, dropdown, toggle, segmented |
position | string | bottom-right | Position for floating type: bottom-right, bottom-left, top-right, top-left |
size | string | medium | Size: small, medium, large |
shape | string | circle | Shape for floating: circle, square, rounded |
showLabels | bool | true | Show text labels alongside icons |
icons | array | ['light' => '☀️', ...] | Custom icons per theme |
labels | array | ['light' => 'Light', ...] | Custom labels per theme |