How to use Icon package

Overview and usage guide for the Icon package

Getting started

Struct provides a flexible icon package that can be used across different setups and frameworks. To get started, start with installing the icon package in your project:

npm install @structdk/struct-icon

The package provides multiple ways to use icon, including framework components, Tailwind utilities, SVG sprites, and icon fonts.

Framework examples

The icon package supports different integration approaches depending on your setup. Below are some coding examples mentioned in the npm package documentation.

React

Use icons as React components for seamless integration into your JSX:

import Calendar24 from '@structdk/struct-icon/react/24/calendar';

<Calendar24 className="w-6 h-6 text-foreground" aria-label="Calendar" />;

Vue

Import icons as Vue components and use them directly in your templates:

<script setup>
import Calendar24 from '@structdk/struct-icon/vue/24/calendar.vue';
</script>

<template>
  <Calendar24 class="w-6 h-6 text-foreground" aria-label="Calendar" />
</template>

Svelte

Use icons as Svelte components with standard props and styling:

Angular

Use either per-icon components or a generic icon component:

Per-icon component:

Generic component:

Package

More info and the package can be found here:

https://www.npmjs.com/package/@structdk/struct-icon

Last updated