Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

1.7 KB
Raw Blame

@openremote/or-icon <or-icon>

NPM Version

Web Component for displaying an icon from a loaded iconset.

Install

npm i @openremote/or-icon
yarn add @openremote/or-icon

Usage

For a full list of properties, methods and options refer to the TypeDoc generated documentation.

Icons are defined in iconsets, there are two iconsets provided by default and new ones can be created as required (see demo-core), The mdi iconset is quite large and it is possible to prevent loading of this when initialising the OpenRemote Manager via the ManagerConfig:

The default iconset is mdi but this can be changed by setting OrIcon.DEFAULT_ICONSET, to load an icon use the following HTML:

<or-icon icon="mdi:access-point" />

If using the default iconset then the iconset prefix can be omitted:

<or-icon icon="access-point" />

Styling is done through CSS, the following CSS variables can be used:

--or-icon-fill (default: currentcolor)
--or-icon-stroke (default: none)
--or-icon-height (default: 24px)
--or-icon-width (default: 24px)
--or-icon-pointer-events (default: none)

When an iconset is added then any or-icon components in the DOM will be notified and refresh as required.

Supported Browsers

The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.

License

GNU AGPL