star_half_filled¶
The star_half_filled macro is used to render a half filled star icon.
Definition¶
Input parameters¶
options¶
object represents an object of star half filled options
| Option key | Type | Default | Required | Description |
|---|---|---|---|---|
| options.size | string |
l |
no | The size of the star, allowed values are l, xl, xxl |
| options.isHoverable | boolean |
false | no | If set to true add appropriate styling class making the star hoverable |
Example¶
In this example we render a basic half filled star.
Example¶
In this example we render a hoverable half filled star with a different size.
{% from "@macros/star_half_filled.twig" import star_half_filled %}
{{ star_half_filled({ size: 'xl', isHoverable: true }) }}
Macro source code¶
{% macro star_half_filled(options = {size: 'l', isHoverable: false}) %}
<h-icon
icon-name="icon-half-filled"
css-classes="star-icon_filled icon_{{ options.size }} icon_no-stroke {% if options.isHoverable %} star-icon_hoverable{% endif %}"
aria-hidden="true"
></h-icon>
{% endmacro %}