Skip to content

Commit f50b9e5

Browse files
committed
boxicons-svelte
0 parents  commit f50b9e5

12 files changed

Lines changed: 2135 additions & 0 deletions

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
.svelte-kit/
7+
8+
# Source SVG (if present)
9+
svg/
10+
11+
# Generated source files
12+
src/icons/
13+
14+
# OS files
15+
.DS_Store
16+
Thumbs.db
17+
18+
# IDE
19+
.idea/
20+
.vscode/
21+
*.swp
22+
*.swo
23+
24+
# Logs
25+
*.log
26+
npm-debug.log*
27+
28+
# Environment
29+
.env
30+
.env.local

.npmignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Source files (dist is published)
2+
src/
3+
scripts/
4+
5+
# Exclude SVG source folder from npm package
6+
svg/
7+
.svelte-kit/
8+
9+
# Config files
10+
tsconfig*.json
11+
.gitignore
12+
svelte.config.js
13+
14+
# Development
15+
node_modules/
16+
.DS_Store
17+
*.log

README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# @boxicons/svelte
2+
3+
Svelte icon library built from Boxicons SVG files with full tree-shaking support.
4+
5+
## Installation
6+
7+
```bash
8+
npm install @boxicons/svelte
9+
# or
10+
yarn add @boxicons/svelte
11+
# or
12+
pnpm add @boxicons/svelte
13+
```
14+
15+
## Usage
16+
17+
### Basic Usage
18+
19+
```svelte
20+
<script>
21+
import { Alarm, Twitter, Home } from '@boxicons/svelte';
22+
</script>
23+
24+
<Alarm />
25+
<Twitter />
26+
<Home />
27+
```
28+
29+
### Icon Packs
30+
31+
- **basic** - Outline/regular style icons (default)
32+
- **filled** - Solid/filled style icons
33+
- **brands** - Brand/logo icons
34+
35+
```svelte
36+
<Alarm />
37+
<Alarm pack="filled" />
38+
```
39+
40+
### Sizing
41+
42+
#### Size Presets
43+
44+
```svelte
45+
<Alarm size="xs" /> <!-- 16px -->
46+
<Alarm size="sm" /> <!-- 20px -->
47+
<Alarm size="base" /> <!-- 24px (default) -->
48+
<Alarm size="md" /> <!-- 36px -->
49+
<Alarm size="lg" /> <!-- 48px -->
50+
<Alarm size="xl" /> <!-- 64px -->
51+
<Alarm size="2xl" /> <!-- 96px -->
52+
<Alarm size="3xl" /> <!-- 128px -->
53+
<Alarm size="4xl" /> <!-- 256px -->
54+
<Alarm size="5xl" /> <!-- 512px -->
55+
```
56+
57+
#### Custom Sizing
58+
59+
```svelte
60+
<Alarm width={32} height={32} />
61+
<Alarm width="2rem" height="2rem" />
62+
```
63+
64+
### Colors
65+
66+
```svelte
67+
<Alarm fill="#ff0000" />
68+
<Alarm fill="currentColor" />
69+
```
70+
71+
### Opacity
72+
73+
```svelte
74+
<Alarm opacity={0.5} />
75+
```
76+
77+
### Flip
78+
79+
```svelte
80+
<Alarm flip="horizontal" />
81+
<Alarm flip="vertical" />
82+
```
83+
84+
### Rotate
85+
86+
```svelte
87+
<Alarm rotate={45} />
88+
<Alarm rotate="90deg" />
89+
```
90+
91+
### Remove Padding
92+
93+
```svelte
94+
<Alarm removePadding />
95+
```
96+
97+
### Combining Props
98+
99+
```svelte
100+
<Alarm
101+
pack="filled"
102+
fill="#ffffff"
103+
opacity={0.8}
104+
size="lg"
105+
flip="horizontal"
106+
rotate={45}
107+
class="my-icon"
108+
/>
109+
```
110+
111+
## Tree Shaking
112+
113+
Only imported icons are bundled:
114+
115+
```js
116+
// ✅ Only Alarm is bundled
117+
import { Alarm } from '@boxicons/svelte';
118+
```
119+
120+
## Available Icons
121+
122+
- **1884** basic (outline) icons
123+
- **1884** filled icons
124+
- **295** brand icons
125+
126+
## TypeScript
127+
128+
```ts
129+
import type { BoxIconProps, IconPack, IconSize, FlipDirection } from '@boxicons/svelte';
130+
```
131+
132+
## License
133+
134+
MIT

0 commit comments

Comments
 (0)