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:
1 theme call to pg-button.html.twig
- GridWidget::formElement in src/
Plugin/ Field/ FieldWidget/ GridWidget.php - Returns the form for a single field widget.
File
templates/pg-button.html.twigView source
- {#
- /**
- * @file 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:
- *
- */
- #}
- {{ attach_library('paragraphs_grid/paragraphs_grid.grid_widget') }}
- {%
- set classes = [
- 'mdc-fab',
- label ? 'mdc-fab--extended'
- ]
- %}
- <button{{ attributes.addClass(classes) }}>
- <span class="mdc-fab__icon material-icons" data-key="{{ icon }}"></span>
- {%- if label %}
- <span class="mdc-fab__label">{{ label }}</span>
- {% endif -%}
- </button>