npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@conectate/ct-icon

v4.5.6

Published

HTML Material Design icon made with Web Components and Lit

Readme

A versatile icon component system for displaying Material Icons and custom SVGs in web applications, with support for various styles and customization options.

IMPORTANT: Check https://fonts.google.com/icons for the list of available icons, fonts and styles.

Table of Contents

Installation

Install via npm, yarn, or pnpm:

# npm
npm i @conectate/ct-icon

# yarn
yarn add @conectate/ct-icon

# pnpm
pnpm i @conectate/ct-icon

Components

This package includes the following components:

| Component | Description | | ---------------- | ---------------------------------------------------------------- | | ct-icon | Base icon component for displaying Material Icons or custom SVGs | | ct-icon-button | Icon wrapped in a circular button with hover and active states |

Basic Usage

Material Icons

<!-- Basic icon usage -->
<ct-icon icon="settings"></ct-icon>

<!-- Changing icon style -->
<ct-icon icon="favorite" fontstyle="Fill"></ct-icon>

<!-- Icon with custom size -->
<ct-icon icon="home" style="--ct-icon-size: 36px;"></ct-icon>

Icon Button

<!-- Basic icon button -->
<ct-icon-button icon="search"></ct-icon-button>

<!-- Disabled icon button -->
<ct-icon-button icon="close" disabled></ct-icon-button>

<!-- Icon button with accessibility label -->
<ct-icon-button icon="menu" aria-label="Open menu"></ct-icon-button>

Custom SVG Icons

<!-- Using custom SVG content -->
<ct-icon svg="<svg viewBox='0 0 24 24'><path d='M12 2L2 7l10 5 10-5-10-5z'/></svg>"></ct-icon>

<!-- SVG in icon button -->
<ct-icon-button svg="<svg viewBox='0 0 24 24'><path d='M12 2L2 7l10 5 10-5-10-5z'/></svg>"></ct-icon-button>

Using ES Modules

import { CtIcon } from "@conectate/ct-icon";
import "@conectate/ct-icon";
import "@conectate/ct-icon-button";

// Set global icon font style
CtIcon.FontStyle = "Outlined";
CtIcon.Font = "Symbols";

// Dynamically create an icon
const myIcon = document.createElement("ct-icon");
myIcon.icon = "delete";
document.body.appendChild(myIcon);

Component API

ct-icon

The base icon component that displays Material Icons or custom SVGs.

Properties

| Property | Type | Default | Description | | ----------- | --------------------------------------------------------------------------------- | ----------- | ----------------------------------------------------------------- | | icon | string | - | Name of the Material Icon to display | | svg | string | - | Custom SVG content if the icon is not available in Material Icons | | font | "Icons" | "Symbols" | "Symbols" | Which icon font family to use | | fontstyle | "Outlined" | "Fill" | "Sharp" | "Two Tone" | "Round" | "Rounded" | "Rounded" | Style variant of the icon | | ready | boolean | false | Whether the font has been loaded (read-only) |

Static Properties

| Property | Type | Default | Description | | ----------- | --------------------------------------------------------------------------------- | ----------- | -------------------------- | | Font | "Icons" | "Symbols" | "Symbols" | Global font family setting | | FontStyle | "Outlined" | "Fill" | "Sharp" | "Two Tone" | "Round" | "Rounded" | "Rounded" | Global font style setting |

Static Methods

| Method | Description | Parameters | Returns | | ------------- | ------------------------------- | ------------------------------------- | ------------------------------ | | loadFonts() | Loads the specified font styles | FontStyle?: string, Font?: string | HTMLLinkElement \| undefined |

ct-icon-button

A button component that displays an icon.

Properties

| Property | Type | Default | Description | | ----------- | --------- | ------- | ------------------------------------------------------------------------- | | icon | string | - | Name of the Material Icon to display | | svg | string | - | Custom SVG content for the button | | disabled | boolean | false | Whether the button is disabled | | ariaLabel | string | "" | Accessible label for the button (falls back to icon name if not provided) |

Icon Styles

The ct-icon component supports different styles from the Material Icons library:

| Style | Description | | ---------- | ----------------------------------- | | Outlined | Icons with an outlined appearance | | Fill | Solid, filled icons | | Sharp | Icons with sharp, straight edges | | Two Tone | Two-tone icons with varying opacity | | Round | Icons with rounded corners | | Rounded | Rounded icon style (default) |

You can set styles globally or per component:

// Global setting
import { CtIcon } from "@conectate/ct-icon";
CtIcon.FontStyle = "Outlined";

// Per component
<ct-icon icon="favorite" fontstyle="Fill"></ct-icon>

Styling

You can customize the components using CSS variables:

ct-icon {
	--ct-icon-size: 24px; /* Icon size (default: 24px) */
}

ct-icon-button {
	/* Inherits --ct-icon-size from ct-icon */
	color: blue; /* Icon color */
}

Icon List

The component provides access to all Material Icons available in the Google Fonts library. You can browse the available icons at:

https://fonts.google.com/icons

When using TypeScript, the package provides type definitions for all available icons, giving you autocomplete support in compatible editors.

TypeScript Support

The package includes full TypeScript definitions and provides autocompletion for icon names:

import { CtIcon } from "@conectate/ct-icon";

// Icon names are typed
const icon = document.createElement("ct-icon");
icon.icon = "settings"; // Autocomplete works here

Accessibility

To ensure your icons are accessible, consider the following best practices:

  • Use aria-label for icon buttons to provide a text alternative
  • Add title attributes to icons that convey information
  • Avoid using icons alone for critical navigation or actions unless properly labeled
<ct-icon-button icon="menu" aria-label="Open navigation menu"></ct-icon-button>

Follow Me

Herberth Obregón

https://x.com/herberthobregon

https://dev.to/herberthobregon

Contributing

  1. Fork the repo
  2. Create a new branch: git checkout -b feature-branch
  3. Commit your changes: git commit -m 'Add new feature'
  4. Push to your branch: git push origin feature-branch
  5. Open a pull request!

License

See LICENSE