@@ -212,6 +212,82 @@ function(string $option) {
212212 FlyUI::end (); // end section
213213});
214214
215+ /**
216+ * Demo: Components - Checkboxes
217+ *
218+ * ----------------------------------------------------------------------------
219+ */
220+ UIDemo ("Components - Checkboxes " , function (RenderContext $ context , RenderTarget $ target , FlyUiDemoState $ state ) : void
221+ {
222+ static $ enableNotifications = true ;
223+ static $ darkMode = false ;
224+ static $ autoSave = true ;
225+ static $ showGrid = false ;
226+ static $ enableSounds = true ;
227+
228+ FlyUI::beginSection ('Basic Checkboxes ' );
229+ FlyUI::beginLayout ()
230+ ->flow (FUILayoutFlow::vertical)
231+ ->spacing (5 );
232+
233+ FlyUI::checkbox ('Enable Notifications ' , $ enableNotifications , function (bool $ checked ) {
234+ echo "Notifications " . ($ checked ? "enabled " : "disabled " ) . "\n" ;
235+ });
236+
237+ FlyUI::checkbox ('Dark Mode ' , $ darkMode , function (bool $ checked ) {
238+ echo "Dark mode " . ($ checked ? "enabled " : "disabled " ) . "\n" ;
239+ });
240+
241+ FlyUI::checkbox ('Auto Save ' , $ autoSave , function (bool $ checked ) {
242+ echo "Auto save " . ($ checked ? "enabled " : "disabled " ) . "\n" ;
243+ });
244+
245+ FlyUI::end (); // end layout
246+ FlyUI::end (); // end section
247+
248+ FlyUI::spaceY (20 );
249+
250+ FlyUI::beginSection ('Settings Panel ' );
251+ FlyUI::beginLayout ()
252+ ->flow (FUILayoutFlow::vertical)
253+ ->spacing (5 );
254+
255+ FlyUI::text ('Display Options: ' , VGColor::rgb (0.3 , 0.3 , 0.3 ))->fontSize (14 );
256+ FlyUI::spaceY (5 );
257+
258+ FlyUI::checkbox ('Show Grid ' , $ showGrid , function (bool $ checked ) {
259+ echo "Grid display " . ($ checked ? "enabled " : "disabled " ) . "\n" ;
260+ });
261+
262+ FlyUI::spaceY (10 );
263+
264+ FlyUI::text ('Audio Options: ' , VGColor::rgb (0.3 , 0.3 , 0.3 ))->fontSize (14 );
265+ FlyUI::spaceY (5 );
266+
267+ FlyUI::checkbox ('Enable Sounds ' , $ enableSounds , function (bool $ checked ) {
268+ echo "Sounds " . ($ checked ? "enabled " : "disabled " ) . "\n" ;
269+ });
270+
271+ FlyUI::end (); // end layout
272+ FlyUI::end (); // end section
273+
274+ FlyUI::spaceY (20 );
275+
276+ FlyUI::beginSection ('Current State ' );
277+ FlyUI::beginLayout ()
278+ ->flow (FUILayoutFlow::vertical)
279+ ->spacing (3 );
280+
281+ FlyUI::text ("Notifications: " . ($ enableNotifications ? "ON " : "OFF " ));
282+ FlyUI::text ("Dark Mode: " . ($ darkMode ? "ON " : "OFF " ));
283+ FlyUI::text ("Auto Save: " . ($ autoSave ? "ON " : "OFF " ));
284+ FlyUI::text ("Show Grid: " . ($ showGrid ? "ON " : "OFF " ));
285+ FlyUI::text ("Enable Sounds: " . ($ enableSounds ? "ON " : "OFF " ));
286+
287+ FlyUI::end (); // end layout
288+ FlyUI::end (); // end section
289+ });
290+
215291/**
216292 * Main Entry Point
217293 *
0 commit comments