-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUIDE.html
More file actions
798 lines (671 loc) · 24.2 KB
/
GUIDE.html
File metadata and controls
798 lines (671 loc) · 24.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>shinyModals Complete Guide</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
background: #f5f5f5;
padding: 20px;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
padding: 60px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #2c3e50;
font-size: 2.5em;
margin: 0.5em 0 0.3em 0;
border-bottom: 3px solid #3498db;
padding-bottom: 0.3em;
}
.subtitle {
color: #7f8c8d;
font-size: 1.2em;
font-weight: 300;
margin-bottom: 0.5em;
}
.metadata {
color: #95a5a6;
font-size: 0.95em;
margin-bottom: 2em;
padding-bottom: 1em;
border-bottom: 1px solid #ecf0f1;
}
h2 {
color: #34495e;
font-size: 1.8em;
margin: 1.5em 0 0.8em 0;
padding-top: 0.5em;
}
h3 {
color: #3498db;
font-size: 1.3em;
margin: 1.2em 0 0.5em 0;
}
h4 {
color: #555;
font-size: 1.1em;
margin: 1em 0 0.4em 0;
}
p {
margin: 0.8em 0;
}
code {
background: #f4f4f4;
padding: 2px 6px;
border-radius: 3px;
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
font-size: 0.9em;
color: #d63384;
}
pre {
background: #2c3e50;
color: #ecf0f1;
padding: 15px;
border-radius: 5px;
overflow-x: auto;
margin: 1em 0;
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
font-size: 0.9em;
line-height: 1.4;
border-left: 4px solid #3498db;
}
pre code {
background: none;
padding: 0;
color: inherit;
}
ul, ol {
margin: 0.8em 0 0.8em 2em;
}
li {
margin: 0.5em 0;
}
table {
border-collapse: collapse;
width: 100%;
margin: 1.5em 0;
font-size: 0.95em;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
table th {
background: #34495e;
color: white;
padding: 12px;
text-align: left;
font-weight: 600;
}
table td {
border-bottom: 1px solid #ecf0f1;
padding: 10px 12px;
}
table tr:nth-child(even) {
background: #f9f9f9;
}
table tr:hover {
background: #f0f7ff;
}
blockquote {
border-left: 4px solid #3498db;
padding-left: 1em;
margin: 1em 0;
color: #666;
font-style: italic;
}
a {
color: #3498db;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.toc {
background: #ecf0f1;
padding: 20px;
border-radius: 5px;
margin: 2em 0;
}
.toc h2 {
margin-top: 0;
font-size: 1.3em;
}
.toc ul {
margin: 0.5em 0 0 1.5em;
}
.toc li {
margin: 0.3em 0;
}
.toc a {
color: #2c3e50;
font-weight: 500;
}
hr {
border: none;
border-top: 2px solid #ecf0f1;
margin: 2em 0;
}
footer {
text-align: center;
color: #999;
margin-top: 3em;
padding-top: 2em;
border-top: 1px solid #ecf0f1;
font-size: 0.9em;
}
.section-nav {
background: #f9f9f9;
padding: 15px;
border-radius: 5px;
margin: 2em 0;
text-align: center;
}
.section-nav a {
margin: 0 10px;
padding: 8px 15px;
background: #3498db;
color: white;
border-radius: 3px;
display: inline-block;
font-size: 0.9em;
}
.section-nav a:hover {
background: #2980b9;
text-decoration: none;
}
.back-to-top {
text-align: right;
margin-top: 2em;
}
.back-to-top a {
padding: 5px 10px;
font-size: 0.9em;
}
@media print {
body {
background: white;
padding: 0;
}
.container {
box-shadow: none;
padding: 40px;
max-width: 100%;
}
a {
color: #0066cc;
}
.section-nav {
display: none;
}
.back-to-top {
display: none;
}
}
</style>
</head>
<body>
<div class="container">
<h1>shinyModals Complete Guide</h1>
<p class="subtitle">A comprehensive guide to using modern modal dialogs in Shiny</p>
<div class="metadata">
<strong>Version:</strong> 0.4.0 | <strong>Date:</strong> December 10, 2025
</div>
<div class="toc">
<h2>Table of Contents</h2>
<ul>
<li><a href="#getting-started">Getting Started</a></li>
<li><a href="#basic-usage">Basic Usage</a></li>
<li><a href="#modal-components">Modal Components</a></li>
<li><a href="#modal-features">Modal Features</a></li>
<li><a href="#themes">Themes</a></li>
<li><a href="#notifications">Notifications</a></li>
<li><a href="#advanced-examples">Advanced Examples</a></li>
<li><a href="#api-reference">API Reference</a></li>
</ul>
</div>
<hr>
<h2 id="getting-started">Getting Started</h2>
<h3>Installation</h3>
<pre><code># Install from local source
devtools::install_local("path/to/shinyModals")
# Or from GitHub (if published)
# devtools::install_github("username/shinyModals")</code></pre>
<h3>Setup in Your App</h3>
<p>Every Shiny app using shinyModals must call <code>use_shiny_modals()</code> once in the UI:</p>
<pre><code>library(shiny)
library(shinyModals)
ui <- fluidPage(
use_shiny_modals(), # Initialize modals
# Your app content here
actionButton("show_modal", "Open Modal")
)
server <- function(input, output, session) {
# Your server logic here
}
shinyApp(ui, server)</code></pre>
<h2 id="basic-usage">Basic Usage</h2>
<h3>Creating and Showing a Modal</h3>
<pre><code>ui <- fluidPage(
use_shiny_modals(),
actionButton("show_modal", "Show Modal"),
shiny_modal(
id = "my_modal",
header = modal_header("Welcome"),
body = modal_body(p("This is a simple modal")),
footer = modal_footer(
actionButton("close_btn", "Close", class = "btn-primary")
)
)
)
server <- function(input, output, session) {
observeEvent(input$show_modal, {
show_modal("my_modal")
})
observeEvent(input$close_btn, {
hide_modal("my_modal")
})
}</code></pre>
<h3>Modal Control Functions</h3>
<pre><code># Show a modal
show_modal("my_modal")
# Hide a modal
hide_modal("my_modal")
# Toggle a modal (show if hidden, hide if shown)
toggle_modal("my_modal")
# Hide all open modals
hide_all_modals()</code></pre>
<h2 id="modal-components">Modal Components</h2>
<h3>Header Component</h3>
<p>The header appears at the top of the modal. It typically contains a title and close button.</p>
<pre><code>modal_header(
title = "Modal Title",
icon = icon("star"), # Optional: add an icon
close_button = TRUE # Optional: show/hide close button (default: TRUE)
)</code></pre>
<p><strong>Parameters:</strong></p>
<ul>
<li><code>title</code> (character): The header text</li>
<li><code>icon</code> (shiny.tag, optional): An icon from Font Awesome using <code>icon()</code></li>
<li><code>close_button</code> (logical): Whether to show the × button (default: TRUE)</li>
</ul>
<p><strong>Examples:</strong></p>
<pre><code># Simple header
modal_header("Settings")
# Header with icon
modal_header("User Profile", icon = icon("user"))
# Header without close button
modal_header("Important", close_button = FALSE)</code></pre>
<h3>Body Component</h3>
<p>The body contains the main content of the modal. It can include any Shiny UI elements.</p>
<pre><code>modal_body(
h3("Content Title"),
p("This is the main content of the modal."),
textInput("name", "Enter your name"),
# Any Shiny UI elements
)</code></pre>
<p><strong>Features:</strong></p>
<ul>
<li>Overflow control (scrollable content)</li>
<li>Flexible sizing</li>
<li>Supports any Shiny input/output widgets</li>
</ul>
<h3>Footer Component</h3>
<p>The footer typically contains action buttons.</p>
<pre><code>modal_footer(
actionButton("confirm", "Confirm", class = "btn-primary"),
actionButton("cancel", "Cancel", class = "btn-secondary")
)</code></pre>
<p><strong>Tips:</strong></p>
<ul>
<li>Use <code>class = "btn-primary"</code> for primary actions (green)</li>
<li>Use <code>class = "btn-secondary"</code> for secondary actions (gray)</li>
<li>Use <code>class = "btn-danger"</code> for destructive actions (red)</li>
<li>Leave empty for no footer</li>
</ul>
<h2 id="modal-features">Modal Features</h2>
<h3>Size Control</h3>
<p>Control the width of your modal with preset sizes or custom values.</p>
<pre><code># Using preset sizes
shiny_modal(
id = "large_modal",
header = modal_header("Large Modal"),
body = modal_body("Content"),
size = "l" # Options: "xs", "s", "m", "l", "xl"
)
# Custom sizes
shiny_modal(
id = "custom_modal",
header = modal_header("Custom Size"),
body = modal_body("Content"),
size = "600px" # Any CSS width value: px, %, vw, etc.
)</code></pre>
<p><strong>Preset Sizes:</strong></p>
<ul>
<li><code>"xs"</code> - 300px (very small)</li>
<li><code>"s"</code> - 450px (small)</li>
<li><code>"m"</code> - 600px (medium, default)</li>
<li><code>"l"</code> - 800px (large)</li>
<li><code>"xl"</code> - 1000px (extra large)</li>
</ul>
<h3>Position Control</h3>
<p>Display modals from different positions on the screen.</p>
<pre><code>shiny_modal(
id = "positioned_modal",
header = modal_header("Title"),
body = modal_body("Content"),
position = "top" # Options: "center", "left", "right", "top", "bottom"
)</code></pre>
<p><strong>Positions:</strong></p>
<ul>
<li><code>"center"</code> - Center of screen (default)</li>
<li><code>"top"</code> - Top of screen</li>
<li><code>"bottom"</code> - Bottom of screen</li>
<li><code>"left"</code> - Left side of screen</li>
<li><code>"right"</code> - Right side of screen</li>
</ul>
<h3>Backdrop Effects</h3>
<p>Control the background appearance when a modal is open.</p>
<pre><code>shiny_modal(
id = "modal_with_backdrop",
header = modal_header("Title"),
body = modal_body("Content"),
backdrop_effect = "blur" # Options: "fade", "blur", "none"
)</code></pre>
<p><strong>Effects:</strong></p>
<ul>
<li><code>"fade"</code> - Darken the background (default)</li>
<li><code>"blur"</code> - Blur the background (modern look)</li>
<li><code>"none"</code> - No effect on background</li>
</ul>
<h3>Animations</h3>
<p>Choose how the modal appears.</p>
<pre><code>shiny_modal(
id = "animated_modal",
header = modal_header("Title"),
body = modal_body("Content"),
animation = "scale" # Options: "fade", "scale", "slide"
)</code></pre>
<p><strong>Animations:</strong></p>
<ul>
<li><code>"fade"</code> - Simple fade in</li>
<li><code>"scale"</code> - Grow from center</li>
<li><code>"slide"</code> - Slide up from bottom</li>
</ul>
<h3>Overflow Control</h3>
<p>Control how content behaves when it exceeds the modal height.</p>
<pre><code>shiny_modal(
id = "scrollable_modal",
header = modal_header("Title"),
body = modal_body(
# Long content here
p(paste(rep("Lorem ipsum dolor sit amet...", 50), collapse = "\n"))
),
overflow = "auto" # Options: "auto", "scroll", "hidden", "visible"
)</code></pre>
<p><strong>Options:</strong></p>
<ul>
<li><code>"auto"</code> - Scrollbar appears only when needed (default)</li>
<li><code>"scroll"</code> - Always show scrollbar</li>
<li><code>"hidden"</code> - No scrollbar, content clips</li>
<li><code>"visible"</code> - Content can overflow modal bounds</li>
</ul>
<h3>Draggable Modals</h3>
<p>Allow users to drag the modal around the screen.</p>
<pre><code>shiny_modal(
id = "draggable_modal",
header = modal_header("Drag me!"),
body = modal_body("Click the header and drag"),
draggable = TRUE
)</code></pre>
<p><strong>Features:</strong></p>
<ul>
<li>Click and hold the header to drag</li>
<li>Position resets when modal reopens</li>
<li>Works with all other features</li>
</ul>
<h2 id="themes">Themes</h2>
<h3>Preset Themes</h3>
<p>Choose from 12 beautiful pre-designed themes:</p>
<pre><code>shiny_modal(
id = "themed_modal",
header = modal_header("Themed Modal"),
body = modal_body("This modal uses a preset theme"),
theme = modal_theme_preset("ocean")
)</code></pre>
<p><strong>Available Themes:</strong></p>
<ol>
<li><strong>default</strong> - Clean, minimal design</li>
<li><strong>dark</strong> - Dark background with light text</li>
<li><strong>ocean</strong> - Blue gradient, calm feel</li>
<li><strong>sunset</strong> - Orange/red gradient, warm</li>
<li><strong>forest</strong> - Green tones, natural look</li>
<li><strong>minimal</strong> - Ultra-clean, white on white</li>
<li><strong>neon</strong> - Bright colors, modern</li>
<li><strong>corporate</strong> - Professional blue, business</li>
<li><strong>warm</strong> - Amber/orange tones, inviting</li>
<li><strong>cool</strong> - Cyan/blue tones, fresh</li>
<li><strong>rose</strong> - Pink/rose tones, elegant</li>
<li><strong>glass</strong> - Glassmorphism effect, transparent</li>
</ol>
<h3>Custom Themes</h3>
<p>Create your own theme using CSS variables:</p>
<pre><code>custom_theme <- modal_theme(
header_bg = "#2c3e50", # Header background color
header_text = "white", # Header text color
body_bg = "#ecf0f1", # Body background color
body_text = "#2c3e50", # Body text color
border_color = "#34495e", # Border color
border_radius = "8px", # Corner rounding
shadow = "0 10px 30px rgba(0,0,0,0.3)" # Box shadow
)
shiny_modal(
id = "custom_modal",
header = modal_header("Custom Theme"),
body = modal_body("Your content"),
theme = custom_theme
)</code></pre>
<h2 id="notifications">Notifications</h2>
<p>Notifications are pre-styled modals for common user messages.</p>
<h3>Success Notification</h3>
<pre><code>notification_success(
id = "success_notif",
title = "Success!",
message = "Your changes have been saved.",
button_text = "OK",
glow = FALSE
)</code></pre>
<h3>Error Notification</h3>
<pre><code>notification_error(
id = "error_notif",
title = "Error",
message = "Something went wrong. Please try again.",
button_text = "Dismiss",
glow = TRUE
)</code></pre>
<h3>Warning Notification</h3>
<pre><code>notification_warning(
id = "warning_notif",
title = "Warning",
message = "This action will delete 5 items. Continue?",
button_text = "I understand"
)</code></pre>
<h3>Info Notification</h3>
<pre><code>notification_info(
id = "info_notif",
title = "Information",
message = "New features are available. Update your app.",
button_text = "Learn More",
auto_dismiss = TRUE
)</code></pre>
<h3>Confirmation Notification</h3>
<pre><code>notification_confirm(
id = "confirm_notif",
title = "Delete Item?",
message = "Are you sure? This cannot be undone.",
confirm_text = "Yes, Delete",
cancel_text = "No, Cancel",
glow = TRUE
)
# In server:
observeEvent(input$confirm_notif_confirm, {
# Handle confirmation
showNotification("Item deleted!", type = "message")
hide_modal("confirm_notif")
})
observeEvent(input$confirm_notif_cancel, {
hide_modal("confirm_notif")
})</code></pre>
<h3>Custom Buttons</h3>
<pre><code>notification_success(
id = "custom_buttons_notif",
title = "Success!",
message = "What would you like to do next?",
buttons = list(
actionButton("btn_home", "Go Home", class = "btn-primary"),
actionButton("btn_edit", "Edit Item", class = "btn-info"),
actionButton("btn_close", "Close", class = "btn-secondary")
)
)
# In server:
observeEvent(input$btn_home, { hide_modal("custom_buttons_notif") })
observeEvent(input$btn_edit, { hide_modal("custom_buttons_notif") })</code></pre>
<h2 id="advanced-examples">Advanced Examples</h2>
<h3>Modal with Input Validation</h3>
<pre><code>ui <- fluidPage(
use_shiny_modals(),
actionButton("show_form", "Show Form"),
shiny_modal(
id = "form_modal",
header = modal_header("User Form"),
body = modal_body(
textInput("username", "Username"),
textInput("email", "Email"),
textOutput("validation_message")
),
footer = modal_footer(
actionButton("submit_form", "Submit", class = "btn-primary"),
actionButton("cancel_form", "Cancel", class = "btn-secondary")
),
theme = modal_theme_preset("ocean")
)
)
server <- function(input, output, session) {
observeEvent(input$show_form, {
show_modal("form_modal")
})
observeEvent(input$submit_form, {
if (input$username == "") {
output$validation_message <- renderText("Please enter username")
return()
}
if (!grepl("^[^@]+@[^@]+$", input$email)) {
output$validation_message <- renderText("Invalid email format")
return()
}
showNotification("Form submitted!", type = "message")
hide_modal("form_modal")
})
}</code></pre>
<h3>Nested Modals (Stacking)</h3>
<pre><code>ui <- fluidPage(
use_shiny_modals(),
actionButton("open_1", "Open Modal 1"),
shiny_modal(id = "modal_1", ...),
shiny_modal(id = "modal_2", ...),
shiny_modal(id = "modal_3", ...)
)
server <- function(input, output, session) {
observeEvent(input$open_1, { show_modal("modal_1") })
observeEvent(input$open_2, { show_modal("modal_2") })
observeEvent(input$open_3, { show_modal("modal_3") })
}</code></pre>
<h3>Confirmation Workflow</h3>
<pre><code>notification_confirm(
id = "delete_confirm",
title = "Delete Item?",
message = "This action cannot be undone.",
confirm_text = "Yes, Delete",
cancel_text = "No, Keep It",
glow = TRUE
)
# Server handlers:
observeEvent(input$delete_confirm_confirm, {
# Perform deletion
output$status <- renderText("Item deleted!")
hide_modal("delete_confirm")
})
observeEvent(input$delete_confirm_cancel, {
output$status <- renderText("Deletion cancelled")
hide_modal("delete_confirm")
})</code></pre>
<h2 id="api-reference">API Reference</h2>
<h3>Core Functions</h3>
<h4>use_shiny_modals()</h4>
<p>Initialize modal system (required once per app)</p>
<pre><code>use_shiny_modals()</code></pre>
<h4>shiny_modal()</h4>
<p>Create a custom modal</p>
<pre><code>shiny_modal(
id, # character, required
header = NULL, # modal_header()
body = NULL, # modal_body()
footer = NULL, # modal_footer()
size = "m", # "xs", "s", "m", "l", "xl", or custom CSS width
position = "center", # "center", "left", "right", "top", "bottom"
backdrop_effect = "fade", # "fade", "blur", "none"
animation = "fade", # "fade", "scale", "slide"
overflow = "auto", # "auto", "scroll", "hidden", "visible"
draggable = FALSE, # logical
close_on_backdrop_click = TRUE, # logical
theme = NULL # modal_theme() or modal_theme_preset()
)</code></pre>
<h4>Modal Control</h4>
<pre><code>show_modal(id) # Display a modal
hide_modal(id) # Hide a modal
toggle_modal(id) # Toggle modal visibility
hide_all_modals() # Hide all open modals</code></pre>
<h3>Notification Functions</h3>
<pre><code>notification_success(id, title, message, button_text="OK", auto_dismiss=FALSE, position="center", glow=FALSE, buttons=NULL)
notification_error(id, title, message, button_text="OK", auto_dismiss=FALSE, position="center", glow=FALSE, buttons=NULL)
notification_warning(id, title, message, button_text="OK", auto_dismiss=FALSE, position="center", glow=FALSE, buttons=NULL)
notification_info(id, title, message, button_text="OK", auto_dismiss=FALSE, position="center", glow=FALSE, buttons=NULL)
notification_confirm(id, title, message, confirm_text="Confirm", cancel_text="Cancel", position="center", glow=FALSE, buttons=NULL)</code></pre>
<h3>Theme Functions</h3>
<pre><code>modal_theme(header_bg=NULL, header_text=NULL, body_bg=NULL, body_text=NULL, border_color=NULL, border_radius=NULL, shadow=NULL)
modal_theme_preset(name) # one of 12 theme names</code></pre>
<hr>
<h2>Tips & Best Practices</h2>
<ul>
<li><strong>Always Initialize:</strong> Call <code>use_shiny_modals()</code> once in your UI</li>
<li><strong>Unique IDs:</strong> Each modal must have a unique <code>id</code></li>
<li><strong>Button Classes:</strong> Use <code>.btn-primary</code>, <code>.btn-secondary</code>, <code>.btn-danger</code></li>
<li><strong>Auto-dismiss:</strong> Use for non-critical information only</li>
<li><strong>Glow Effect:</strong> Reserve for important alerts and confirmations</li>
<li><strong>Preset Themes:</strong> Start with presets, customize with <code>modal_theme()</code></li>
<li><strong>Nested Modals:</strong> Z-index managed automatically</li>
<li><strong>Accessibility:</strong> All modals close with ESC key</li>
<li><strong>Responsive:</strong> Works on desktop and mobile</li>
</ul>
<h2>Demo Application</h2>
<p>Run the demo to see all features in action:</p>
<pre><code>source(system.file("examples", "demo_app.R", package = "shinyModals"))</code></pre>
<footer>
<p><strong>shinyModals v0.4.0</strong> | Generated December 10, 2025</p>
<p>A modern modal dialog system for Shiny applications</p>
</footer>
</div>
</body>
</html>