You are here

pg-button.html.twig in Paragraphs grid 8

pg--mdc-fab.html.twig

Display a material fab https://material.io/develop/web/components/buttons/floating-action-buttons/.

Available variables:

  • attributes: HTML attributes for the containing element.
  • label: The label for the field.
  • icon: The icon string for material icons.
  • items: List of all the field items. Each item contains:

File

templates/pg-button.html.twig
View source
  1. {#
  2. /**
  3. * @file pg--mdc-fab.html.twig
  4. *
  5. * Display a material fab https://material.io/develop/web/components/buttons/floating-action-buttons/.
  6. *
  7. * Available variables:
  8. * - attributes: HTML attributes for the containing element.
  9. * - label: The label for the field.
  10. * - icon: The icon string for material icons.
  11. * - items: List of all the field items. Each item contains:
  12. *
  13. */
  14. #}
  15. {{ attach_library('paragraphs_grid/paragraphs_grid.grid_widget') }}
  16. {%
  17. set classes = [
  18. 'mdc-fab',
  19. label ? 'mdc-fab--extended'
  20. ]
  21. %}
  22. <button{{ attributes.addClass(classes) }}>
  23. <span class="mdc-fab__icon material-icons" data-key="{{ icon }}"></span>
  24. {%- if label %}
  25. <span class="mdc-fab__label">{{ label }}</span>
  26. {% endif -%}
  27. </button>