5.5 Bootstrap Plugin
The local Bootstrap plugin supplies KMP-specific CakePHP view helpers, widgets, and string-template utilities on top of Bootstrap 5 and BootstrapUI. It is a rendering library, not a business-domain plugin.
Components
| Area | Classes |
|---|---|
| Helpers | CardHelper, HtmlHelper, ModalHelper, NavbarHelper |
| Form widgets | ColumnSelectBoxWidget, FancyFileWidget, InlineRadioWidget, LabelLegendWidget |
| Templates | EnhancedStringTemplate, FlexibleStringTemplate, FlexibleStringTemplateTrait |
| Utilities | Matching, StackedStates, class/icon/URL traits |
Use these abstractions where the project already does so markup, template configuration, and accessibility fixes remain centralized. Do not add domain queries or authorization decisions to them.
Frontend ownership
Bootstrap JavaScript/CSS is part of the Vite build. Helpers generate markup; Bootstrap and Stimulus own client behavior. Do not inline duplicate Bootstrap bundles or initialize components globally from templates.
Accessibility contract
Helper output must preserve semantic element choice, accessible names, keyboard operation, focus behavior, and required Bootstrap ARIA relationships. In particular:
- icon-only links/buttons need an accessible name;
- modal trigger, dialog label, focus restoration, and dismissal must stay connected;
- radios need a
fieldset/legendwhen they form a question; - custom file/select widgets need the same label, help, required, invalid, and disabled state as their native controls;
- alerts and progress indicators need appropriate text/state announcements.
When a helper cannot express the needed semantics, improve the helper or use clear semantic markup—do not patch the result with fragile JavaScript.
Verification
Add helper/widget tests for exact semantic output and escaping. For interactive changes, run JavaScript tests and verify keyboard/focus/screen-reader state in a representative page. Run npm run dev when asset imports change.