@iconify-prerendered/vue-cif
TypeScript icon, indicating that this package has built-in type declarations

0.23.1702311711 • Public • Published

CoreUI Flags components for Vue

Designed for ease of use and high performance. Each icon in set is standalone component.

Features

  • Easy to use
    • No plugins required! Compatible with any build tools.
    • Designed for best compatibility with IDE auto-completion (Demo).
    • Zero dependencies.
    • SSR / SSG friendly.
    • TypeScript support.
  • High performance
    • Does not require any external resources like fonts, css, images.
    • The icon code is embedded in your bundle.
    • Supports tree shaking, so only those icons that you have used will be included in the bundle.
    • Works offline.
  • Powered by iconify.

Usage

<script setup>
// Import components as usual
import {
	IconEe,
	IconCa,
	IconSk,
} from '@iconify-prerendered/vue-cif'
</script>

<template>
	<!-- And just use it in template -->
  	<IconEe/>
	<IconCa/>
	<IconSk/>
</template>

Only these three icons will be included in your bundle. All other icons may be tree-shaken by your bundler.

That's all you need. No plugins, extra configs, IDE extensions or something else.

Customizing icon default attributes

By default, all icons have only two attributes: role="img" and aria-hidden="true". While you are free to redefine these attributes or add new ones for each individual icon, you might want to apply certain attributes, such as class or style, to all icons within a set.

To achieve this, you can re-export icons through a new Proxy and include default attributes

import * as defaultIcons from '@iconify-prerendered/vue-cif';

// accessing to icon through this Proxy will add additional attributes
export const themedIcons = new Proxy({}, {
  get(_, iconKey) {
    return () =>
      defaultIcons[iconKey]({
        class: 'pre-defined-class',
        // ... any other attributes
      });
  },
});

See full docs or other available icons sets.

Package Sidebar

Install

npm i @iconify-prerendered/vue-cif

Weekly Downloads

6

Version

0.23.1702311711

License

CC-BY-4.0

Unpacked Size

3.65 MB

Total Files

4

Last publish

Collaborators

  • kozack