Skip to content

Twig API ​

Parameters ​

label ​

  • Type: string

The button's label.

tag ​

  • Type: string

The button's tag. The default value is inferred from the other parameters. The <a> tag is used when the href parameter is defined or when the attr parameter is defined with an href property, otherwise the <button> tag is used.

href ​

  • Type: string

The link of the button. Using this parameter will set the default value for the tag parameter to a.

attr ​

  • Type: array

Custom attributes for the root element. Using this parameter with an href property will set the default value for the tag parameter to a.

icon ​

  • Type: string

Name of an icon to use in the button.

icon_attr ​

  • Type: array

Custom attributes for the icon component.

icon_classes ​

  • Type: string

Customizes classes for the icon element. Defaults to mr-3 when the icon_position parameter is set to start and to ml-3 when set to end. (Can be overridden by the icon_attr classes.)

icon_position ​

  • Type: 'start' | 'end'
  • Default: 'start'

icon_only ​

  • Type: boolean
  • Default: false

Blocks ​

content ​

Customizes the content of the root element. Using this block will override the other blocks as they are nested in this one.

label ​

Customizes the label content. Defaults to the label parameter.

icon ​

Customizes the icon content. Defaults to the Icon component with the icon parameter as its name.