Previews

No matching results.

x
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
<div class="tw:p-6 tw:max-w-7xl tw:mx-auto tw:space-y-8">
<!-- Introductory callout -->
<div class="callout">
<p class="tw:mb-1 tw:text-sm tw:font-mono">
<strong>POPUP:</strong> Modal dialog for essential information or actions<br>
<strong>TYPES:</strong> Rich Content (default) | Informative (.popup-seamless) | Minimal (.popup-minimal)<br>
<strong>ALIGNMENT:</strong> Left (default) | Center (.popup-center)<br>
<strong>SIZES:</strong> Small (.popup-sm) | Default | Large (.popup-lg) | Extra Large (.popup-xl)
</p>
<p class="tw:mb-0 tw:text-sm">
Popups block user interaction until dismissed. Use for confirmations, settings panels,
and informational dialogs. Supports layered stacking with dimming and configurable dismiss modes.
</p>
</div>
<!-- ============================================
Type: Rich Content (Default)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Type: Rich Content (Default)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Rich Content:</strong> Header has a visible bottom border separating it from the body.
Body scrolls when content exceeds viewport. Footer stays fixed at the bottom with no top border.
Best for settings panels, table configurations, and form inputs.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Rich Content Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="rich-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="rich-title">Table View Settings</h2>
<p class="popup-header-subtitle">Configure visible columns and their order</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p class="tw:mb-3">Select which columns to display in the saved providers view. Drag to reorder.</p>
<div class="tw:space-y-2">
<label class="form-check">
<input type="checkbox" class="form-check-input" checked>
<span class="form-check-label">Provider Name</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input" checked>
<span class="form-check-label">Application Date</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input" checked>
<span class="form-check-label">Status</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input">
<span class="form-check-label">Year Group</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input">
<span class="form-check-label">Contact Email</span>
</label>
</div>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Apply Settings</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel" role="dialog" aria-modal="true"></code><br>
<code>  <div class="popup-header">...</div></code><br>
<code>  <div class="popup-body">...</div></code><br>
<code>  <div class="popup-footer">...</div></code><br>
<code></div></code>
</div>
</div>
<!-- ============================================
Type: Informative (Seamless)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Type: Informative (.popup-seamless)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Informative:</strong> Header flows seamlessly into the body with no border.
Best for confirmation dialogs with explanatory text and information popups.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Informative Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="info-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="info-title">How does the Sorting Hat really sort?</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p class="tw:mb-3">
The course eligibility algorithm takes multiple factors into account when
matching you to sixth form and college courses. Understanding these factors
helps you put forward the strongest possible application.
</p>
<p class="tw:mb-3">
<strong>Academic Performance</strong> — Your current school reports and predicted
grades are weighted based on each provider's entry requirements. For Year 12 entry,
GCSE results carry the highest weight.
</p>
<p class="tw:mb-3">
<strong>Interview Performance</strong> — If shortlisted, your interview score
is factored into the match. Providers normalise scores to ensure fair comparison
across all applicants.
</p>
<p>
<strong>Special Considerations</strong> — Sibling at provider, bursary eligibility,
and catchment area are noted separately rather than modifying your base
score, ensuring transparency in the final outcome.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Got it</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-seamless</strong>">...</div></code>
</div>
</div>
<!-- ============================================
Type: Minimal
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Type: Minimal (.popup-minimal)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Minimal:</strong> No header at all — body content starts immediately with extra top padding.
Best for simple confirmations with an icon, success messages, and yes/no prompts.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-success" type="button" data-action="click->popup#show">
Open Minimal Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-minimal popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-label="Action completed">
<div class="popup-body">
<div class="tw:text-green-500 tw:mx-auto tw:mb-4 tw:text-5xl tw:text-center">
<i class="fa-solid fa-circle-check"></i>
</div>
<p class="h3 tw:mb-2">Application Submitted!</p>
<p class="text-muted">Your Year 12 application has been successfully submitted. You will receive a confirmation email shortly.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Done</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-minimal popup-center popup-sm</strong>">...</div></code>
</div>
</div>
<!-- ============================================
Center Alignment
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Center Alignment (.popup-center)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Center:</strong> Centers text in header, body, and footer. Combine with any type.
Best for confirmation dialogs and simple prompts.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-danger" type="button" data-action="click->popup#show">
Open Centered Confirmation
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="center-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="center-title">Delete Application?</h2>
</div>
</div>
<div class="popup-body">
<p class="text-muted">
Are you sure you want to permanently delete the application for
<strong>James Thompson</strong>? This action cannot be undone and all
associated documents will be removed.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-danger" type="button" data-action="click->popup#close">Delete Application</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-center</strong>">...</div></code>
</div>
</div>
<!-- ============================================
Size Variants
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Size Variants</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Sizes:</strong> <code>.popup-sm</code> (400px) |
Default (520px) |
<code>.popup-lg</code> (680px) |
<code>.popup-xl</code> (860px).
All sizes are responsive and shrink gracefully on mobile.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<!-- Small -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Small (400px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-sm-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-sm-title">Small Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 400px wide. Ideal for simple confirmations and quick prompts.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- Default -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Default (520px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-md-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-md-title">Default Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 520px wide. The standard size for most use cases including forms and settings.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- Large -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Large (680px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-lg" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-lg-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-lg-title">Large Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 680px wide. Good for rich content, multi-column forms, and detailed settings.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- Extra Large -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Extra Large (860px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-xl" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-xl-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-xl-title">Extra Large Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 860px wide. Suitable for complex settings panels, large data tables, and multi-step flows.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-sm</strong>"></code> |
<code><div class="popup-panel"></code> |
<code><div class="popup-panel <strong>popup-lg</strong>"></code> |
<code><div class="popup-panel <strong>popup-xl</strong>"></code>
</div>
</div>
<!-- ============================================
Scrollable Body
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Scrollable Body</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Scrollable:</strong> When body content exceeds the viewport, only the body scrolls.
Header and footer remain fixed in place.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Scrollable Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="scroll-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="scroll-title">Terms and Conditions</h2>
<p class="popup-header-subtitle">Please read carefully before proceeding</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body" tabindex="0" role="region" aria-label="Terms and conditions (scrollable)">
<h3 class="h4 tw:mb-3">1. Data Protection</h3>
<p class="tw:mb-4">All personal data collected through the application process is handled in accordance with the Data Protection Act 2018 and UK GDPR. The provider acts as a data controller and processes applicant information solely for the purpose of managing application decisions.</p>
<h3 class="h4 tw:mb-3">2. Application Process</h3>
<p class="tw:mb-4">Applications must be submitted by the published deadline. Late applications may be considered at the provider's discretion but will not be given priority over timely submissions. All information provided must be accurate and complete.</p>
<h3 class="h4 tw:mb-3">3. Assessment and Selection</h3>
<p class="tw:mb-4">The provider reserves the right to assess applicants through interviews, entrance examinations, or portfolio reviews as appropriate. Selection criteria are published annually and applied consistently to all applicants.</p>
<h3 class="h4 tw:mb-3">4. Offer and Acceptance</h3>
<p class="tw:mb-4">Offers of places are conditional upon acceptance within the specified timeframe. Failure to respond by the deadline may result in the offer being withdrawn and the place offered to the next applicant on the waiting list.</p>
<h3 class="h4 tw:mb-3">5. Waiting Lists</h3>
<p class="tw:mb-4">Where the provider is oversubscribed, a waiting list will be maintained until the end of the autumn term. Position on the waiting list is determined by the application criteria and may change as new applications are received.</p>
<h3 class="h4 tw:mb-3">6. Appeals</h3>
<p class="tw:mb-4">Parents have the right to appeal against a decision to refuse admission. Appeals are heard by an independent panel and the provider will supply information about the appeals process with any refusal notification.</p>
<h3 class="h4 tw:mb-3">7. Fees and Deposits</h3>
<p>A non-refundable registration fee is required at the time of application. Upon acceptance of a place, a deposit is payable which will be credited against the first term's fees. Full fee schedules are available from the provider's admissions office.</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Decline</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Accept Terms</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Without Close Button
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Without Close Button</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>No Close Button:</strong> The close button (<code>.popup-close</code>) is optional.
Omit it when the user must make an explicit choice from the footer actions.
The popup can still be closed via overlay click or Escape key.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-warning" type="button" data-action="click->popup#show">
Open Without Close Button
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="noclose-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="noclose-title">Unsaved Changes</h2>
</div>
</div>
<div class="popup-body">
<p class="text-muted">
You have unsaved changes. Would you like to save before leaving this page?
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Discard</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Save Changes</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Layered Popups (Stacking)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Layered Popups (Stacking)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Stacking:</strong> When a second popup opens, the first popup is dimmed
(<code>.popup-dimmed</code>) and the new overlay is transparent to avoid double-darkening.
Closing the top popup un-dims the one underneath. Focus is trapped in the topmost popup.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open First Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="layer1-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="layer1-title">Notification Settings</h2>
<p class="popup-header-subtitle">Manage your application deadline and open day reminders</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p class="tw:mb-4">Manage your notification preferences for upcoming application deadlines and open days.</p>
<div data-controller="popup">
<button class="btn btn-secondary btn-sm" type="button" data-action="click->popup#show">
Open Confirmation (Second Popup)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="layer2-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="layer2-title">Confirm Reset?</h2>
</div>
</div>
<div class="popup-body">
<p class="text-muted">
This will reset all notification settings to their default values.
Are you sure you want to continue?
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-danger" type="button" data-action="click->popup#close">Reset Settings</button>
</div>
</div>
</div>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Save Settings</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Dismiss Modes
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Dismiss Modes</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Dismiss Mode:</strong> Controls what happens when the overlay is clicked or Escape is pressed.<br>
<code>data-popup-dismiss-mode-value="single"</code> (default) — Closes only the topmost popup.<br>
<code>data-popup-dismiss-mode-value="all"</code> — Closes all open popups at once.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<!-- Single dismiss mode -->
<div data-controller="popup" data-popup-dismiss-mode-value="single">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Single Dismiss (default)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="dismiss-single-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="dismiss-single-title">Single Dismiss</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>Click the overlay or press Escape to close only this popup. This is the default behavior.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- All dismiss mode -->
<div data-controller="popup" data-popup-dismiss-mode-value="all">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Dismiss All
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="dismiss-all-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="dismiss-all-title">Dismiss All</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>With <code>data-popup-dismiss-mode-value="all"</code>, clicking the overlay or pressing Escape closes all open popups at once.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Static Backdrop
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Static Backdrop</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-1 tw:text-sm">
<strong>Static backdrop:</strong> <code>data-popup-static-backdrop-value="true"</code> makes a
backdrop click a no-op, so a stray click beside the panel cannot throw away entered data or
silently answer a question. Opt-in — omit it and the popup keeps the default dismiss-on-backdrop behaviour.
</p>
<p class="tw:mb-0 tw:text-sm">
Escape still closes. That pairing is deliberate: WAI-ARIA APG expects a dialog to support Escape,
and Escape is a keyboard user's only always-available exit. A static backdrop removes the
<em>accidental</em> dismissal, not the intentional one.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup" data-popup-static-backdrop-value="true">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Static-Backdrop Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="static-backdrop-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="static-backdrop-title">Add a sibling</h2>
<p class="popup-header-subtitle">Sibling details help us apply the sibling priority rule.</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<div class="tw:mb-3">
<label for="static-sibling-name" class="form-label form-label-required">Sibling's full name</label>
<input type="text" id="static-sibling-name" class="form-control" aria-required="true">
</div>
<div class="tw:mb-3">
<label for="static-sibling-year" class="form-label">Current year group</label>
<input type="text" id="static-sibling-year" class="form-control" value="Year 9">
</div>
<p class="text-muted tw:text-sm tw:mb-0">
Try clicking the dark area outside this panel — nothing happens. Press Escape, or use Cancel, to leave.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Save sibling</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div data-controller="popup" data-popup-static-backdrop-value="true"></code>
</div>
</div>
<!-- ============================================
Destructive Confirm (alertdialog recipe)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Destructive Confirm (alertdialog recipe)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-1 tw:text-sm">
<strong>Recipe, not a component:</strong> there is no <code>.popup-confirm</code> class. A destructive
confirm is the existing <code>.popup-sm</code> panel plus five markup decisions —
<code>role="alertdialog"</code>, the consequence sentence wired via <code>aria-describedby</code>,
initial focus on the <strong>safe</strong> action, <code>.btn-danger</code> on the destructive one,
and a static backdrop.
</p>
<p class="tw:mb-0 tw:text-sm">
Focus starts on Cancel, never on Delete — the same C05 error-prevention posture as the
<code>.field-group-repeat</code> dirty-remove confirm row, so an accidental extra Enter or Space
cannot complete a destructive action.
</p>
<p class="tw:mb-0 tw:text-sm">
<strong>Trigger vs. action:</strong> the page-level trigger below is <code>.btn-danger-soft</code>
(the <code>.offer-summary</code> Decline precedent) — solid <code>.btn-danger</code> is reserved for
the confirmed action inside the dialog, where the choice is actually being made.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup" data-popup-static-backdrop-value="true">
<button class="btn btn-danger-soft" type="button" data-action="click->popup#show">
Withdraw application
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel"
role="alertdialog" aria-modal="true"
aria-labelledby="withdraw-confirm-title"
aria-describedby="withdraw-confirm-desc">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="withdraw-confirm-title">Withdraw this application?</h2>
</div>
</div>
<div class="popup-body">
<p id="withdraw-confirm-desc" class="tw:mb-0">
Amelia Okonkwo's application to Northgate Academy will be withdrawn and her Year 7 place offer
released. This cannot be undone — a new application would start from the beginning.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button"
data-popup-target="autofocus"
data-action="click->popup#close">Keep application</button>
<button class="btn btn-danger" type="button" data-action="click->popup#close">Withdraw application</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel popup-sm" role="alertdialog" aria-modal="true" aria-labelledby="…" aria-describedby="…"></code><br>
<code><button class="btn btn-secondary" data-popup-target="autofocus">Keep application</button></code><br>
<code><button class="btn btn-danger">Withdraw application</button></code>
</div>
</div>
<!-- ============================================
Keyboard & Accessibility
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Keyboard & Accessibility</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Accessibility:</strong> Popups use <code>role="dialog"</code> with <code>aria-modal="true"</code>.
Focus is trapped inside the popup — Tab cycles through focusable elements and wraps at boundaries.
Escape closes the popup. Focus returns to the trigger element on close.
Use <code>aria-labelledby</code> to link to the title, or <code>aria-label</code> for minimal popups without a visible title.
</p>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<table class="table table-sm">
<thead>
<tr>
<th>Key</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Escape</code></td>
<td>Closes the topmost popup (or all, based on dismiss mode)</td>
</tr>
<tr>
<td><code>Tab</code></td>
<td>Cycles forward through focusable elements within the popup</td>
</tr>
<tr>
<td><code>Shift + Tab</code></td>
<td>Cycles backward through focusable elements within the popup</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
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
<div class="tw:p-6 tw:max-w-7xl tw:mx-auto tw:space-y-8">
<!-- Introductory callout -->
<div class="callout">
<p class="tw:mb-1 tw:text-sm tw:font-mono">
<strong>POPUP:</strong> Modal dialog for essential information or actions<br>
<strong>TYPES:</strong> Rich Content (default) | Informative (.popup-seamless) | Minimal (.popup-minimal)<br>
<strong>ALIGNMENT:</strong> Left (default) | Center (.popup-center)<br>
<strong>SIZES:</strong> Small (.popup-sm) | Default | Large (.popup-lg) | Extra Large (.popup-xl)
</p>
<p class="tw:mb-0 tw:text-sm">
Popups block user interaction until dismissed. Use for confirmations, settings panels,
and informational dialogs. Supports layered stacking with dimming and configurable dismiss modes.
</p>
</div>
<!-- ============================================
Type: Rich Content (Default)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Type: Rich Content (Default)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Rich Content:</strong> Header has a visible bottom border separating it from the body.
Body scrolls when content exceeds viewport. Footer stays fixed at the bottom with no top border.
Best for settings panels, table configurations, and form inputs.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Rich Content Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="rich-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="rich-title">Table View Settings</h2>
<p class="popup-header-subtitle">Configure visible columns and their order</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p class="tw:mb-3">Select which columns to display in the saved providers view. Drag to reorder.</p>
<div class="tw:space-y-2">
<label class="form-check">
<input type="checkbox" class="form-check-input" checked>
<span class="form-check-label">Provider Name</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input" checked>
<span class="form-check-label">Application Date</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input" checked>
<span class="form-check-label">Status</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input">
<span class="form-check-label">Year Group</span>
</label>
<label class="form-check">
<input type="checkbox" class="form-check-input">
<span class="form-check-label">Contact Email</span>
</label>
</div>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Apply Settings</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel" role="dialog" aria-modal="true"></code><br>
<code>  <div class="popup-header">...</div></code><br>
<code>  <div class="popup-body">...</div></code><br>
<code>  <div class="popup-footer">...</div></code><br>
<code></div></code>
</div>
</div>
<!-- ============================================
Type: Informative (Seamless)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Type: Informative (.popup-seamless)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Informative:</strong> Header flows seamlessly into the body with no border.
Best for confirmation dialogs with explanatory text and information popups.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Informative Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="info-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="info-title">How does the Sorting Hat really sort?</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p class="tw:mb-3">
The course eligibility algorithm takes multiple factors into account when
matching you to sixth form and college courses. Understanding these factors
helps you put forward the strongest possible application.
</p>
<p class="tw:mb-3">
<strong>Academic Performance</strong> — Your current school reports and predicted
grades are weighted based on each provider's entry requirements. For Year 12 entry,
GCSE results carry the highest weight.
</p>
<p class="tw:mb-3">
<strong>Interview Performance</strong> — If shortlisted, your interview score
is factored into the match. Providers normalise scores to ensure fair comparison
across all applicants.
</p>
<p>
<strong>Special Considerations</strong> — Sibling at provider, bursary eligibility,
and catchment area are noted separately rather than modifying your base
score, ensuring transparency in the final outcome.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Got it</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-seamless</strong>">...</div></code>
</div>
</div>
<!-- ============================================
Type: Minimal
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Type: Minimal (.popup-minimal)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Minimal:</strong> No header at all — body content starts immediately with extra top padding.
Best for simple confirmations with an icon, success messages, and yes/no prompts.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-success" type="button" data-action="click->popup#show">
Open Minimal Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-minimal popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-label="Action completed">
<div class="popup-body">
<div class="tw:text-green-500 tw:mx-auto tw:mb-4 tw:text-5xl tw:text-center">
<i class="fa-solid fa-circle-check"></i>
</div>
<p class="h3 tw:mb-2">Application Submitted!</p>
<p class="text-muted">Your Year 12 application has been successfully submitted. You will receive a confirmation email shortly.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Done</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-minimal popup-center popup-sm</strong>">...</div></code>
</div>
</div>
<!-- ============================================
Center Alignment
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Center Alignment (.popup-center)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Center:</strong> Centers text in header, body, and footer. Combine with any type.
Best for confirmation dialogs and simple prompts.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-danger" type="button" data-action="click->popup#show">
Open Centered Confirmation
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="center-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="center-title">Delete Application?</h2>
</div>
</div>
<div class="popup-body">
<p class="text-muted">
Are you sure you want to permanently delete the application for
<strong>James Thompson</strong>? This action cannot be undone and all
associated documents will be removed.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-danger" type="button" data-action="click->popup#close">Delete Application</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-center</strong>">...</div></code>
</div>
</div>
<!-- ============================================
Size Variants
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Size Variants</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Sizes:</strong> <code>.popup-sm</code> (400px) |
Default (520px) |
<code>.popup-lg</code> (680px) |
<code>.popup-xl</code> (860px).
All sizes are responsive and shrink gracefully on mobile.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<!-- Small -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Small (400px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-sm-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-sm-title">Small Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 400px wide. Ideal for simple confirmations and quick prompts.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- Default -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Default (520px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-md-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-md-title">Default Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 520px wide. The standard size for most use cases including forms and settings.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- Large -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Large (680px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-lg" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-lg-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-lg-title">Large Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 680px wide. Good for rich content, multi-column forms, and detailed settings.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- Extra Large -->
<div data-controller="popup">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Extra Large (860px)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-xl" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="size-xl-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="size-xl-title">Extra Large Popup</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>This popup is 860px wide. Suitable for complex settings panels, large data tables, and multi-step flows.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel <strong>popup-sm</strong>"></code> |
<code><div class="popup-panel"></code> |
<code><div class="popup-panel <strong>popup-lg</strong>"></code> |
<code><div class="popup-panel <strong>popup-xl</strong>"></code>
</div>
</div>
<!-- ============================================
Scrollable Body
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Scrollable Body</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Scrollable:</strong> When body content exceeds the viewport, only the body scrolls.
Header and footer remain fixed in place.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Scrollable Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="scroll-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="scroll-title">Terms and Conditions</h2>
<p class="popup-header-subtitle">Please read carefully before proceeding</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body" tabindex="0" role="region" aria-label="Terms and conditions (scrollable)">
<h3 class="h4 tw:mb-3">1. Data Protection</h3>
<p class="tw:mb-4">All personal data collected through the application process is handled in accordance with the Data Protection Act 2018 and UK GDPR. The provider acts as a data controller and processes applicant information solely for the purpose of managing application decisions.</p>
<h3 class="h4 tw:mb-3">2. Application Process</h3>
<p class="tw:mb-4">Applications must be submitted by the published deadline. Late applications may be considered at the provider's discretion but will not be given priority over timely submissions. All information provided must be accurate and complete.</p>
<h3 class="h4 tw:mb-3">3. Assessment and Selection</h3>
<p class="tw:mb-4">The provider reserves the right to assess applicants through interviews, entrance examinations, or portfolio reviews as appropriate. Selection criteria are published annually and applied consistently to all applicants.</p>
<h3 class="h4 tw:mb-3">4. Offer and Acceptance</h3>
<p class="tw:mb-4">Offers of places are conditional upon acceptance within the specified timeframe. Failure to respond by the deadline may result in the offer being withdrawn and the place offered to the next applicant on the waiting list.</p>
<h3 class="h4 tw:mb-3">5. Waiting Lists</h3>
<p class="tw:mb-4">Where the provider is oversubscribed, a waiting list will be maintained until the end of the autumn term. Position on the waiting list is determined by the application criteria and may change as new applications are received.</p>
<h3 class="h4 tw:mb-3">6. Appeals</h3>
<p class="tw:mb-4">Parents have the right to appeal against a decision to refuse admission. Appeals are heard by an independent panel and the provider will supply information about the appeals process with any refusal notification.</p>
<h3 class="h4 tw:mb-3">7. Fees and Deposits</h3>
<p>A non-refundable registration fee is required at the time of application. Upon acceptance of a place, a deposit is payable which will be credited against the first term's fees. Full fee schedules are available from the provider's admissions office.</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Decline</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Accept Terms</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Without Close Button
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Without Close Button</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>No Close Button:</strong> The close button (<code>.popup-close</code>) is optional.
Omit it when the user must make an explicit choice from the footer actions.
The popup can still be closed via overlay click or Escape key.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-warning" type="button" data-action="click->popup#show">
Open Without Close Button
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="noclose-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="noclose-title">Unsaved Changes</h2>
</div>
</div>
<div class="popup-body">
<p class="text-muted">
You have unsaved changes. Would you like to save before leaving this page?
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Discard</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Save Changes</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Layered Popups (Stacking)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Layered Popups (Stacking)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Stacking:</strong> When a second popup opens, the first popup is dimmed
(<code>.popup-dimmed</code>) and the new overlay is transparent to avoid double-darkening.
Closing the top popup un-dims the one underneath. Focus is trapped in the topmost popup.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open First Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="layer1-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="layer1-title">Notification Settings</h2>
<p class="popup-header-subtitle">Manage your application deadline and open day reminders</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p class="tw:mb-4">Manage your notification preferences for upcoming application deadlines and open days.</p>
<div data-controller="popup">
<button class="btn btn-secondary btn-sm" type="button" data-action="click->popup#show">
Open Confirmation (Second Popup)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-seamless popup-center popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="layer2-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="layer2-title">Confirm Reset?</h2>
</div>
</div>
<div class="popup-body">
<p class="text-muted">
This will reset all notification settings to their default values.
Are you sure you want to continue?
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-danger" type="button" data-action="click->popup#close">Reset Settings</button>
</div>
</div>
</div>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Save Settings</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Dismiss Modes
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Dismiss Modes</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Dismiss Mode:</strong> Controls what happens when the overlay is clicked or Escape is pressed.<br>
<code>data-popup-dismiss-mode-value="single"</code> (default) — Closes only the topmost popup.<br>
<code>data-popup-dismiss-mode-value="all"</code> — Closes all open popups at once.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<!-- Single dismiss mode -->
<div data-controller="popup" data-popup-dismiss-mode-value="single">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Single Dismiss (default)
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="dismiss-single-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="dismiss-single-title">Single Dismiss</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>Click the overlay or press Escape to close only this popup. This is the default behavior.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
<!-- All dismiss mode -->
<div data-controller="popup" data-popup-dismiss-mode-value="all">
<button class="btn btn-outline-primary btn-sm" type="button" data-action="click->popup#show">
Dismiss All
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="dismiss-all-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="dismiss-all-title">Dismiss All</h2>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<p>With <code>data-popup-dismiss-mode-value="all"</code>, clicking the overlay or pressing Escape closes all open popups at once.</p>
</div>
<div class="popup-footer">
<button class="btn btn-primary" type="button" data-action="click->popup#close">Close</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================
Static Backdrop
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Static Backdrop</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-1 tw:text-sm">
<strong>Static backdrop:</strong> <code>data-popup-static-backdrop-value="true"</code> makes a
backdrop click a no-op, so a stray click beside the panel cannot throw away entered data or
silently answer a question. Opt-in — omit it and the popup keeps the default dismiss-on-backdrop behaviour.
</p>
<p class="tw:mb-0 tw:text-sm">
Escape still closes. That pairing is deliberate: WAI-ARIA APG expects a dialog to support Escape,
and Escape is a keyboard user's only always-available exit. A static backdrop removes the
<em>accidental</em> dismissal, not the intentional one.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup" data-popup-static-backdrop-value="true">
<button class="btn btn-primary" type="button" data-action="click->popup#show">
Open Static-Backdrop Popup
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel" data-popup-target="panel" role="dialog" aria-modal="true" aria-labelledby="static-backdrop-title">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="static-backdrop-title">Add a sibling</h2>
<p class="popup-header-subtitle">Sibling details help us apply the sibling priority rule.</p>
</div>
<button class="popup-close" type="button" aria-label="Close" data-action="click->popup#close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="popup-body">
<div class="tw:mb-3">
<label for="static-sibling-name" class="form-label form-label-required">Sibling's full name</label>
<input type="text" id="static-sibling-name" class="form-control" aria-required="true">
</div>
<div class="tw:mb-3">
<label for="static-sibling-year" class="form-label">Current year group</label>
<input type="text" id="static-sibling-year" class="form-control" value="Year 9">
</div>
<p class="text-muted tw:text-sm tw:mb-0">
Try clicking the dark area outside this panel — nothing happens. Press Escape, or use Cancel, to leave.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button" data-action="click->popup#close">Cancel</button>
<button class="btn btn-primary" type="button" data-action="click->popup#close">Save sibling</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div data-controller="popup" data-popup-static-backdrop-value="true"></code>
</div>
</div>
<!-- ============================================
Destructive Confirm (alertdialog recipe)
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Destructive Confirm (alertdialog recipe)</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-1 tw:text-sm">
<strong>Recipe, not a component:</strong> there is no <code>.popup-confirm</code> class. A destructive
confirm is the existing <code>.popup-sm</code> panel plus five markup decisions —
<code>role="alertdialog"</code>, the consequence sentence wired via <code>aria-describedby</code>,
initial focus on the <strong>safe</strong> action, <code>.btn-danger</code> on the destructive one,
and a static backdrop.
</p>
<p class="tw:mb-0 tw:text-sm">
Focus starts on Cancel, never on Delete — the same C05 error-prevention posture as the
<code>.field-group-repeat</code> dirty-remove confirm row, so an accidental extra Enter or Space
cannot complete a destructive action.
</p>
<p class="tw:mb-0 tw:text-sm">
<strong>Trigger vs. action:</strong> the page-level trigger below is <code>.btn-danger-soft</code>
(the <code>.offer-summary</code> Decline precedent) — solid <code>.btn-danger</code> is reserved for
the confirmed action inside the dialog, where the choice is actually being made.
</p>
</div>
<div class="tw:flex tw:flex-wrap tw:gap-3">
<div data-controller="popup" data-popup-static-backdrop-value="true">
<button class="btn btn-danger-soft" type="button" data-action="click->popup#show">
Withdraw application
</button>
<div class="popup-overlay" data-popup-target="overlay" data-action="click->popup#handleOverlayClick"></div>
<div class="popup-panel popup-sm" data-popup-target="panel"
role="alertdialog" aria-modal="true"
aria-labelledby="withdraw-confirm-title"
aria-describedby="withdraw-confirm-desc">
<div class="popup-header">
<div>
<h2 class="popup-header-title" id="withdraw-confirm-title">Withdraw this application?</h2>
</div>
</div>
<div class="popup-body">
<p id="withdraw-confirm-desc" class="tw:mb-0">
Amelia Okonkwo's application to Northgate Academy will be withdrawn and her Year 7 place offer
released. This cannot be undone — a new application would start from the beginning.
</p>
</div>
<div class="popup-footer">
<button class="btn btn-secondary" type="button"
data-popup-target="autofocus"
data-action="click->popup#close">Keep application</button>
<button class="btn btn-danger" type="button" data-action="click->popup#close">Withdraw application</button>
</div>
</div>
</div>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<code><div class="popup-panel popup-sm" role="alertdialog" aria-modal="true" aria-labelledby="…" aria-describedby="…"></code><br>
<code><button class="btn btn-secondary" data-popup-target="autofocus">Keep application</button></code><br>
<code><button class="btn btn-danger">Withdraw application</button></code>
</div>
</div>
<!-- ============================================
Keyboard & Accessibility
============================================ -->
<div class="tw:border-t tw:pt-6">
<h2 class="h4 tw:mb-4">Keyboard & Accessibility</h2>
<div class="callout tw:mb-4">
<p class="tw:mb-0 tw:text-sm">
<strong>Accessibility:</strong> Popups use <code>role="dialog"</code> with <code>aria-modal="true"</code>.
Focus is trapped inside the popup — Tab cycles through focusable elements and wraps at boundaries.
Escape closes the popup. Focus returns to the trigger element on close.
Use <code>aria-labelledby</code> to link to the title, or <code>aria-label</code> for minimal popups without a visible title.
</p>
</div>
<div class="tw:mt-4 tw:text-sm tw:text-gray-600">
<table class="table table-sm">
<thead>
<tr>
<th>Key</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Escape</code></td>
<td>Closes the topmost popup (or all, based on dismiss mode)</td>
</tr>
<tr>
<td><code>Tab</code></td>
<td>Cycles forward through focusable elements within the popup</td>
</tr>
<tr>
<td><code>Shift + Tab</code></td>
<td>Cycles backward through focusable elements within the popup</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>