Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bytesize-icon-elements

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytesize-icon-elements

custom elements for bytesize icons

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

Custom Elements for Bytesize Icons

This package provides icons from bytesize-icons as a CustomElement. The bytesize-icons package contains a lightweight, reasonable set of nice icons in the SVG format.

Installation

$ npm install --save bytesize-icon-elements

Usage

<html>
  <body>
    This is search icon: <bytesize-icon name="search"></bytesize-icon>

    And this is a thin book icon: <bytesize-icon name="book" weight="thin"></bytesize-icon>

    And this is a gear icon with sharp edges: <bytesize-icon name="settings" style="miter"></bytesize-icon>

    Icon size is variable because it's SVG.

    This is a big flag icon: <bytesize-icon name="flag" size="64"></bytesize-icon>

    <script src="/path/to/bytesize-icon-elements/index.js"></script>
  </body>
</html>

Loading bytesize-icon-elements/index.js registers the <bytesize-icon> element. You can use it in your HTML directly. If you want to use this package with older browsers, you may need webcomponents.js as polyfill.

The following attributes are supported. The name attribute is mandatory, the others are optional.

NameDescriptionDefault
nameSee the complete list below. It determines the id of the icon symbol.
weightOne of ultra-light, thin, light, regular, medium, bold and heavy. It determines stroke-width of the icon.regular
styleOne of round, bevel and miter. It determines stroke-linejoin and stroke-linecap of the icon.round
sizeSize (width and height) of the icon (in pixels).32

Default attribute values can be changed by placing the <bytesize-icon-defaults> element before any <bytesize-icon> occurs on the page:

<bytesize-icon-defaults size="64" style="miter" weight="bold"></bytesize-icon-defaults>

Default attribute values can be changed programmatically as well:

BytesizeIcon.setDefaultAttributes({
  size: 64,
  style: 'miter',
  weight: 'bold'
});

Development

$ npm ci
$ npm run gen
$ npm test

All Icons

You can inspect all icons on the bytesize-icons repository page. The following icon names are supported: "activity", "alert", "archive", "arrow-bottom", "arrow-left", "arrow-right", "arrow-top", "backwards", "bag", "ban", "bell", "book", "bookmark", "calendar", "camera", "caret-bottom", "caret-left", "caret-right", "caret-top", "cart", "checkmark", "chevron-bottom", "chevron-left", "chevron-right", "chevron-top", "clipboard", "clock", "close", "code", "compose", "creditcard", "desktop", "download", "edit", "eject", "ellipsis-horizontal", "ellipsis-vertical", "end", "export", "external", "eye", "file", "fire", "flag", "folder", "folder-open", "forwards", "gift", "github", "heart", "home", "import", "inbox", "info", "lightning", "link", "location", "lock", "mail", "menu", "message", "microphone", "minus", "mobile", "move", "music", "mute", "options", "paperclip", "pause", "photo", "play", "plus", "portfolio", "print", "reload", "reply", "search", "send", "settings", "sign-in", "sign-out", "star", "start", "tag", "telephone", "trash", "twitter", "unlock", "upload", "user", "video", "volume", "work".

Keywords

FAQs

Package last updated on 21 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc