Socket
Socket
Sign inDemoInstall

carbon-icons-svelte

Package Overview
Dependencies
0
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    carbon-icons-svelte

Carbon Design System SVG icons as Svelte components


Version published
Weekly downloads
12K
increased by24.85%
Maintainers
2
Install size
2.47 MB
Created
Weekly downloads
 

Changelog

Source

12.6.0 - 2024-03-11

Features

  • upgrade @carbon/icons to v11.37.0 (net +4 icons)

Readme

Source

carbon-icons-svelte

NPM GitHub npm downloads to date

Carbon Design System SVG icons as Svelte components.

This zero dependency icon library builds Carbon Design System icons as Svelte components. Although best paired with carbon-components-svelte, these icons can be consumed standalone.

Try it in the Svelte REPL.

Preview · Icon Index

Installation

Install carbon-icons-svelte as a development dependency.

# Yarn
yarn add -D carbon-icons-svelte

# npm
npm i -D carbon-icons-svelte

# pnpm
pnpm i -D carbon-icons-svelte

Usage

Basic

Import the icon from the carbon-icons-svelte/lib folder. See the Icon Index for a list of supported icons.

<script>
  import Add from "carbon-icons-svelte/lib/Add.svelte";
</script>

<Add />

Custom size

Use the size prop to specify the icon size.

Supported icon sizes include 16, 20, 24, and 32.

The default size is 16.

<Add size={16} />
<Add size={20} />
<Add size={24} />
<Add size={32} />

Custom props

$$restProps are forwarded to the svg element.

You can use fill to customize the color or pass any other valid svg attribute to the component.

<Add fill="red" class="icon" />

Labelled

<Add aria-label="Add" />

Labelled icon that is focusable

<Add aria-label="Add" tabindex="0" />

Labelled by

<label id="add-file">Add file</label>

<Add aria-labelledby="add-file" />

API

Props

All props are optional.

NameTypeDefault value
size16 | 20 | 24 | 3216
titlestringundefined

Changelog

Contributing

License

Apache 2.0

Keywords

FAQs

Last updated on 12 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc