@dreamworld/dw-icon

4.1.3 • Public • Published

dw-icon

An element, used to show an icon in Dreamworld Apps.

Usage

npm install --save @dreamworld/dw-icon
<dw-icon name="action_alarm"></dw-icon>

It internally uses @material/mwc-icon to render material icons. But, User is allowed to override any of the material icon (if necessary). And can add any application specific icons as well.

Why did we create separate element than mwc-icon?

In mwc-icon we can't override any icon OR can't add application specific icons. So, When mwc-icon is used by the inter-app re-usable web-component, application has no way to customize it's icon.

Properties

  • name (String)
  • size (Number)
  • disabled (Boolean), disabled has higher priority, so, when active and disabled both are specified. It will be effectively disabled.
  • active (Boolean)
  • iconFont (String (ENUM)), possible values: FILLED and OUTLINED. Default is FILLED

Custom CSS Properties

--dw-icon-color-active
--dw-icon-color
--dw-icon-color-disabled

Size

By default icon is rendered in 24px size. You can render it in different size when needed.

<dw-icon name="action_alarm" size="16"></dw-icon>

If application specific icon

Add application icons

DwIcon.addIcons({
    {icon_name}: {svgIcon}
});

e.g.

DwIcon.addIcons({
    kerika_chat: svg``
});

icon_name is used to set different sized icons. e.g.

DwIcon.addIcons({
    kerika_chat: {svgIcon},
    kerika_chat_16: {svgIcon}
});

kerika_chat is default sized (24px) icon. While kerika_chat_16 is of 16px size.

Icon must be added before it's usage. So, add application specific icons from app-shell only.

Override material icons

This could be done in the same way as Add application icons. Just use material icon's name as name.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.1.3-event-listen-add-passive-true.10event-listen-add-passive-true
4.1.2-stop-propagation-touchstart-mousedown.10stop-propagation-touchstart-mousedown
4.1.1-ssr.10ssr
4.1.0-material-symbols.10material-symbols
2.2.0-upgrade-version.10upgrade-version
2.1.1-fix-add-icons.10fix-add-icons
1.4.2-update-mwc.10update-mwc
1.4.1-update-config.10update-config
1.4.0-use-our-lit-element-instead-of-lit-element-base-class.10use-our-lit-element-instead-of-lit-element-base-class
1.2.1-set-pointer-event-none.10set-pointer-event-none
1.2.0-icon-width-height.10icon-width-height
1.1.1-use-styleMap-for-icon-size.10use-styleMap-for-icon-size
1.1.0-support-backward-compatible-get-icon.10support-backward-compatible-get-icon
4.1.326latest
2.2.3-development.21development

Version History

VersionDownloads (Last 7 Days)Published
4.1.326
4.1.3-event-listen-add-passive-true.10
4.1.20
4.1.2-stop-propagation-touchstart-mousedown.10
4.1.19
4.1.1-ssr.10
4.1.02
4.1.0-material-symbols.10
4.0.00
3.0.00
2.3.10
2.3.01
2.2.3-development.21
2.2.3-development.12
2.2.20
2.2.10
2.2.01
2.2.0-development.11
2.2.0-upgrade-version.10
2.1.11
2.1.1-fix-add-icons.10
2.1.00
1.4.2-update-mwc.10
1.4.10
1.4.1-update-config.10
1.4.00
1.4.0-use-our-lit-element-instead-of-lit-element-base-class.10
1.3.00
1.2.1-set-pointer-event-none.10
1.2.00
1.2.0-icon-width-height.10
1.1.10
1.1.1-use-styleMap-for-icon-size.10
1.1.00
1.1.0-support-backward-compatible-get-icon.10
1.0.3-use-styleMap-for-icon-size.10
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @dreamworld/dw-icon

Weekly Downloads

44

Version

4.1.3

License

ISC

Unpacked Size

12.9 kB

Total Files

7

Last publish

Collaborators

  • chiragmoradiya
  • chetang7
  • ajay-dhameliya
  • dw-devops