2.2.0 • Published 5 months ago

@coopdigital/shared-component--icon v2.2.0

Weekly downloads
102
License
MIT
Repository
github
Last release
5 months ago

shared-component--icon

A macro to return an SVG icon based on a value passed in.

Installation

Install with NPM:

$ npm install @coopdigital/shared-component--icon --save

Usage

Once installed, you can import icon.html from the shared components directory like you might do for squircles or editorial cards:

{% import '/shared-component--icon/src/icon.html' as icon %}

It can then be used from within your template as follows:

{%- set iconName = content.fields.icon | lower | replace(" ","_") -%}
{%- set iconClass = "coop-c-signpost__icon__svg" -%}

{{ icon.render(iconName, iconClass) }}

Development

For information on how to develop this package see the developing foundations and components for the design system documentation.

License

Copyright (c) 2021 Co-operative Group Limited. Licensed MIT.

2.2.0

5 months ago

2.1.2

2 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago