codeschubser/bootstrap-twig-components-bundle

Bootstrap Twig Components bundle for Symfony

v0.8 2025-04-15 13:36 UTC

This package is auto-updated.

Last update: 2025-04-16 06:30:45 UTC


README

GitHub Actions Workflow Status GitHub Tag codecov GitHub License

Warning

This Bundle is experimental and subject to change in a future release.

A Symfony bundle for the Twig Components library.

This bundle allows you to create robust and reusable Twig components.

Requirements

  • PHP 8.2 or higher
  • Symfony 6.0 or higher

Features

All components are Bootstrap ready. Recommend version is v5.3 or higher. Some components can be extended with icons. Bootstrap Icons and Font Awesome were tested. But other icons are also possible.

Accessibility

  • Optional icons are hidden from the accessibility API.
  • Alerts are decorated with role="alert" to send accessible alert event to assistive technology products.
  • Dropdowns are decorated with aria-expanded and aria-current.
  • Icons in components are decorated with aria-hidden or aria-label.

Usage

  • Installation
  • Components
    • Alert Provide contextual feedback messages for typical user actions with a handful of available and flexible options.
    • Button Provide buttons with support for multiple variants, icon, states, and more.
    • Breadcrumbs Provide breadcrumb navigation with valid schema.org markup
    • Card Provide flexible content containers.
    • Dropdown Toggleable and contextual overlays.
    • Icon Reusable icon component
    • Modal TBD
    • Toast TBD

Development

During development, composer provides a large number of user-specific scripts that are intended to ensure code quality, among other things. A list and the corresponding description can be called up via composer list. These scripts are also used in the Github workflows.

Contributing

If you want to contribute to the project and make it better, your help is very welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

License

This bundle is licensed under the MIT License.