12.6.0 • Published 2 months ago

carbon-icons-svelte v12.6.0

Weekly downloads
2,756
License
Apache-2.0
Repository
github
Last release
2 months ago

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

12.6.0

2 months ago

12.5.0

2 months ago

12.4.1

4 months ago

12.4.2

4 months ago

12.4.0

5 months ago

12.0.0

10 months ago

12.2.0

8 months ago

12.3.0

8 months ago

12.3.1

6 months ago

12.1.0

9 months ago

11.4.0

2 years ago

11.3.0

2 years ago

11.2.0

2 years ago

11.1.0

2 years ago

10.45.1

2 years ago

10.45.0

2 years ago

11.0.0

2 years ago

11.0.1

2 years ago

10.44.4

2 years ago

10.44.3

2 years ago

10.44.0

2 years ago

10.44.2

2 years ago

10.44.1

2 years ago

10.37.0

3 years ago

10.38.0

3 years ago

10.36.0

3 years ago

10.35.0

3 years ago

10.33.0

3 years ago

10.28.0

3 years ago

10.27.0

3 years ago

10.23.0

3 years ago

10.21.0

3 years ago

10.17.0

4 years ago

10.15.0

4 years ago

10.14.1

4 years ago

10.14.0

4 years ago

10.13.0

4 years ago

10.12.0

4 years ago

10.10.2

4 years ago

10.10.1

4 years ago

10.10.0

4 years ago

10.9.3

4 years ago

10.9.2

4 years ago

10.9.2-rc.0

4 years ago

10.9.0-rc.0

4 years ago

10.8.4

4 years ago

10.8.3

4 years ago

10.8.2

4 years ago

10.8.1

4 years ago

10.8.0

4 years ago

1.0.1

4 years ago

10.8.0-rc.0

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago