← Back to Plugin Architecture

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:

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.