magic-glyphs 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +126 -89
  3. package/cli/index.js +32 -13
  4. package/cli/video.js +36 -0
  5. package/data/icons/apple.json +1 -0
  6. package/data/icons/arrow-down.json +1 -0
  7. package/data/icons/arrow-left.json +1 -0
  8. package/data/icons/arrow-right.json +1 -0
  9. package/data/icons/arrow-up.json +1 -0
  10. package/data/icons/bag.json +1 -0
  11. package/data/icons/battery.json +1 -0
  12. package/data/icons/bell.json +1 -0
  13. package/data/icons/bike.json +1 -0
  14. package/data/icons/bird.json +1 -0
  15. package/data/icons/bolt.json +1 -0
  16. package/data/icons/book.json +1 -0
  17. package/data/icons/bookmark.json +1 -0
  18. package/data/icons/briefcase.json +1 -0
  19. package/data/icons/bug.json +1 -0
  20. package/data/icons/bus.json +1 -0
  21. package/data/icons/cake.json +1 -0
  22. package/data/icons/calendar.json +1 -0
  23. package/data/icons/camera.json +1 -0
  24. package/data/icons/car.json +1 -0
  25. package/data/icons/card.json +1 -0
  26. package/data/icons/cart.json +1 -0
  27. package/data/icons/cat.json +1 -0
  28. package/data/icons/chat.json +1 -0
  29. package/data/icons/check.json +1 -0
  30. package/data/icons/chevron-down.json +1 -0
  31. package/data/icons/chevron-left.json +1 -0
  32. package/data/icons/chevron-right.json +1 -0
  33. package/data/icons/chevron-up.json +1 -0
  34. package/data/icons/circle-alert.json +1 -0
  35. package/data/icons/circle-check.json +1 -0
  36. package/data/icons/circle-minus.json +1 -0
  37. package/data/icons/circle-plus.json +1 -0
  38. package/data/icons/circle-x.json +1 -0
  39. package/data/icons/clipboard.json +1 -0
  40. package/data/icons/clock.json +1 -0
  41. package/data/icons/cloud.json +1 -0
  42. package/data/icons/code.json +1 -0
  43. package/data/icons/coffee.json +1 -0
  44. package/data/icons/coin.json +1 -0
  45. package/data/icons/copy.json +1 -0
  46. package/data/icons/database.json +1 -0
  47. package/data/icons/dog.json +1 -0
  48. package/data/icons/download.json +1 -0
  49. package/data/icons/drop.json +1 -0
  50. package/data/icons/edit.json +1 -0
  51. package/data/icons/external-link.json +1 -0
  52. package/data/icons/eye-off.json +1 -0
  53. package/data/icons/eye.json +1 -0
  54. package/data/icons/file.json +1 -0
  55. package/data/icons/filter.json +1 -0
  56. package/data/icons/fish.json +1 -0
  57. package/data/icons/flag.json +1 -0
  58. package/data/icons/flame.json +1 -0
  59. package/data/icons/folder.json +1 -0
  60. package/data/icons/frown.json +1 -0
  61. package/data/icons/gift.json +1 -0
  62. package/data/icons/globe.json +1 -0
  63. package/data/icons/hand.json +1 -0
  64. package/data/icons/heart.json +1 -0
  65. package/data/icons/help.json +1 -0
  66. package/data/icons/home.json +1 -0
  67. package/data/icons/image.json +1 -0
  68. package/data/icons/info.json +1 -0
  69. package/data/icons/key.json +1 -0
  70. package/data/icons/laptop.json +1 -0
  71. package/data/icons/laugh.json +1 -0
  72. package/data/icons/leaf.json +1 -0
  73. package/data/icons/link.json +1 -0
  74. package/data/icons/lock.json +1 -0
  75. package/data/icons/mail.json +1 -0
  76. package/data/icons/map.json +1 -0
  77. package/data/icons/menu.json +1 -0
  78. package/data/icons/mic.json +1 -0
  79. package/data/icons/minus.json +1 -0
  80. package/data/icons/monitor.json +1 -0
  81. package/data/icons/moon.json +1 -0
  82. package/data/icons/music.json +1 -0
  83. package/data/icons/package.json +1 -0
  84. package/data/icons/pause.json +1 -0
  85. package/data/icons/pencil.json +1 -0
  86. package/data/icons/phone.json +1 -0
  87. package/data/icons/pin.json +1 -0
  88. package/data/icons/pizza.json +1 -0
  89. package/data/icons/plane.json +1 -0
  90. package/data/icons/play.json +1 -0
  91. package/data/icons/plus.json +1 -0
  92. package/data/icons/printer.json +1 -0
  93. package/data/icons/receipt.json +1 -0
  94. package/data/icons/refresh.json +1 -0
  95. package/data/icons/rocket.json +1 -0
  96. package/data/icons/save.json +1 -0
  97. package/data/icons/search.json +1 -0
  98. package/data/icons/server.json +1 -0
  99. package/data/icons/settings.json +1 -0
  100. package/data/icons/share.json +1 -0
  101. package/data/icons/shield.json +1 -0
  102. package/data/icons/smile.json +1 -0
  103. package/data/icons/star.json +1 -0
  104. package/data/icons/stop.json +1 -0
  105. package/data/icons/store.json +1 -0
  106. package/data/icons/sun.json +1 -0
  107. package/data/icons/tablet.json +1 -0
  108. package/data/icons/tag.json +1 -0
  109. package/data/icons/terminal.json +1 -0
  110. package/data/icons/thumbs-down.json +1 -0
  111. package/data/icons/thumbs-up.json +1 -0
  112. package/data/icons/train.json +1 -0
  113. package/data/icons/trash.json +1 -0
  114. package/data/icons/tree.json +1 -0
  115. package/data/icons/truck.json +1 -0
  116. package/data/icons/upload.json +1 -0
  117. package/data/icons/user.json +1 -0
  118. package/data/icons/users.json +1 -0
  119. package/data/icons/video.json +1 -0
  120. package/data/icons/volume.json +1 -0
  121. package/data/icons/wallet.json +1 -0
  122. package/data/icons/wave.json +1 -0
  123. package/data/icons/wifi.json +1 -0
  124. package/data/icons/wink.json +1 -0
  125. package/data/index.json +1 -1
  126. package/docs/avalonia.md +15 -0
  127. package/docs/cli.md +1 -1
  128. package/docs/figma.md +12 -0
  129. package/docs/flutter.md +18 -0
  130. package/docs/godot.md +13 -0
  131. package/docs/images-video.md +42 -0
  132. package/docs/jetpack-compose.md +39 -0
  133. package/docs/maker.md +64 -0
  134. package/docs/maui.md +17 -0
  135. package/docs/more-frameworks.md +49 -0
  136. package/docs/native-lottie.md +5 -0
  137. package/docs/qt.md +26 -0
  138. package/docs/react-native.md +34 -0
  139. package/docs/react-vue.md +12 -1
  140. package/docs/rust.md +43 -0
  141. package/docs/site-builders.md +27 -0
  142. package/docs/sound.md +2 -2
  143. package/docs/swiftui.md +22 -0
  144. package/docs/tauri-rust.md +15 -0
  145. package/docs/unity.md +15 -0
  146. package/docs/windows.md +23 -0
  147. package/lib.js +9 -1
  148. package/mcp/server.js +1 -1
  149. package/package.json +48 -11
  150. package/shopify/magic-glyph.liquid +8 -6
  151. package/tools/apng.js +36 -0
  152. package/tools/baked.js +30 -0
  153. package/tools/gif.js +60 -0
  154. package/tools/motion.js +31 -0
  155. package/tools/native.js +208 -0
  156. package/tools/native2.js +432 -0
  157. package/tools/raster.js +139 -0
  158. package/web/magic-glyphs.all.js +4 -3
  159. package/web/runtime.js +4 -3
  160. package/wordpress/magic-glyphs/magic-glyphs.all.js +4 -3
  161. package/wordpress/magic-glyphs/magic-glyphs.php +19 -6
@@ -0,0 +1,15 @@
1
+ # Avalonia
2
+
3
+ Each icon becomes one C# control that draws the icon's own vectors and plays its spring motion. No packages needed.
4
+
5
+ ```bash
6
+ npx magic-glyphs add bell heart --format avalonia --out Glyphs
7
+ ```
8
+
9
+ ```csharp
10
+ var bell = new MagicGlyphs.BellGlyph(size: 32, color: "#2747f5");
11
+ panel.Children.Add(bell);
12
+ bell.Play(); // also plays on hover and click
13
+ ```
14
+
15
+ Styles: add `--style solid` or `--style duotone` (with `secondary:`). Sound: Avalonia has no built-in audio, so export the WAV (`--format wav`) and play it from the `Played` event with the audio library you use.
package/docs/cli.md CHANGED
@@ -57,7 +57,7 @@ Files for non-outline styles carry the style in the name, for example `heart.duo
57
57
 
58
58
  ```bash
59
59
  npx magic-glyphs login YOUR-LICENCE-KEY # the key from your Gumroad receipt (no < > around it); downloads the full library
60
- npx magic-glyphs buy # opens the page where you can buy a licence
60
+ npx magic-glyphs buy # shows the link where you can buy a licence
61
61
  npx magic-glyphs update # tells you if a newer version is out, then downloads new paid icons
62
62
  npx magic-glyphs build-key # a key for CI and build servers that does not use a device
63
63
  npx magic-glyphs shadcn --env # connect a shadcn project (see the shadcn guide)
package/docs/figma.md ADDED
@@ -0,0 +1,12 @@
1
+ # Figma
2
+
3
+ The Magic Glyphs plugin puts icons straight into your designs.
4
+
5
+ - **Search** every icon by name or tag.
6
+ - **Insert as a vector** in outline, solid or duotone, in any colour and size. It lands in the selected frame, ready to edit.
7
+ - **Insert as an animated GIF**, which plays in prototypes and presentations, so stakeholders see the motion.
8
+ - **Unlock the full library** with the licence key from your Gumroad receipt (the 120 free icons work without one).
9
+
10
+ Works in Figma Design, FigJam and Figma Slides.
11
+
12
+ Install it from the Figma Community (search for *Magic Glyphs*). Until it is listed there, a team can import it in the Figma desktop app: **Plugins → Development → Import plugin from manifest**, and choose `manifest.json` from the plugin folder we send you on request (support@magicglyphs.com).
@@ -0,0 +1,18 @@
1
+ # Flutter
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ flutter pub add lottie audioplayers
7
+ npx magic-glyphs add heart bell --format flutter --sound --out lib/icons
8
+ ```
9
+
10
+ Each icon is one `.dart` file with its animation built in. For sound, move the `.wav` files to `assets/` and list them in `pubspec.yaml`.
11
+
12
+ ## Use
13
+
14
+ ```dart
15
+ const HeartGlyph(size: 28, sound: true, label: 'Like')
16
+ ```
17
+
18
+ > Generated from the same Lottie export as the other platforms, which is checked against an independent Lottie renderer. These component files have not yet been run on real devices; please report anything that does not work.
package/docs/godot.md ADDED
@@ -0,0 +1,13 @@
1
+ # Godot
2
+
3
+ Each icon becomes one GDScript file for a `Control` node. It draws the icon's own vectors and plays its spring motion; nothing to install.
4
+
5
+ ```bash
6
+ npx magic-glyphs add bell heart --format godot --out glyphs
7
+ npx magic-glyphs add bell --format wav --out glyphs # optional sound
8
+ ```
9
+
10
+ 1. Add a **Control** node, set its size (for example 32 × 32), and attach `bell_glyph.gd`.
11
+ 2. In the Inspector, set **Color** (and **Secondary** for duotone), and **Sound Stream** to `bell.wav` if you want sound.
12
+
13
+ It plays on hover and click; call `play()` for anything else. For sprite-based games, `--format spritesheet` writes a PNG of every frame plus a JSON file with the timing.
@@ -0,0 +1,42 @@
1
+ # Animated images and video
2
+
3
+ Some places cannot run code: email, slide decks, Canva, Notion, chat emoji and social posts. For those, export a finished animation. Video formats carry the icon's sound.
4
+
5
+ | Format | Best for | Transparency | Sound |
6
+ | --- | --- | --- | --- |
7
+ | GIF | Email, Notion, Google Slides, Canva, anywhere | One-bit (soft edges blend into a colour you choose) | No |
8
+ | Animated PNG | Slack and Discord emoji, Keynote, browsers | Full | No |
9
+ | MP4 | PowerPoint, Keynote, social posts, Canva | No (uses a background colour) | Yes |
10
+ | WebM | Web pages, Discord, OBS overlays | Full | Yes |
11
+
12
+ ## From the icon maker
13
+
14
+ Open the [icon maker](https://magicglyphs.com/maker/), pick a library icon or bring your own, then choose a colour, a background (or transparent) and a size under **Animated image or video**. Everything is drawn in your browser.
15
+
16
+ ## From the command line
17
+
18
+ ```bash
19
+ npx magic-glyphs add rocket --format gif --color "#7c3aed"
20
+ npx magic-glyphs add bell heart --format apng --size 128 # Slack and Discord emoji
21
+ npx magic-glyphs add send --format mp4 --size 1080 --background "#0f0f12" --color "#ffffff"
22
+ npx magic-glyphs add star --format webm # transparent video with sound
23
+ ```
24
+
25
+ | Option | What it does |
26
+ | --- | --- |
27
+ | `--size <px>` | Width and height. Defaults: GIF 256, APNG 128, MP4 and WebM 512 |
28
+ | `--color`, `--secondary`, `--style` | As for every other format (glass needs a background in GIF) |
29
+ | `--background <hex>` | Solid background. Without it GIF, APNG and WebM are transparent |
30
+ | `--matte <hex>` | GIF without a background: the colour soft edges blend into (default white) |
31
+ | `--loop <n>` | GIF and APNG: plays (default 0, forever) |
32
+ | `--hold <s>` | Seconds to hold the final pose (default 0.6) |
33
+ | `--no-sound` | MP4 and WebM without sound |
34
+
35
+ GIF and animated PNG need nothing extra. MP4 and WebM use [ffmpeg](https://ffmpeg.org) if it is installed (`winget install ffmpeg`, `brew install ffmpeg`, `apt install ffmpeg`); otherwise make them in the icon maker.
36
+
37
+ ## Tips
38
+
39
+ - **Slack emoji:** APNG at 128 px, under 128 KB. Short motions (bell, heart, star) fit easily.
40
+ - **Email:** GIF with a background matching the email, so the edges are clean. Some Outlook versions show only the first frame; that frame is the icon at rest, so it still reads.
41
+ - **PowerPoint and Keynote:** MP4 with the slide's background colour, set to play automatically.
42
+ - **Canva:** upload the GIF, or the MP4 if you want the sound.
@@ -0,0 +1,39 @@
1
+ # Jetpack Compose
2
+
3
+ ## Install
4
+
5
+ ```kotlin
6
+ implementation("com.airbnb.android:lottie-compose:6.6.0")
7
+ ```
8
+
9
+ ```bash
10
+ npx magic-glyphs add heart bell --format compose --sound --out app/src/main/java/magicglyphs
11
+ ```
12
+
13
+ Each icon is one `.kt` file with its animation built in. For sound, move the `.wav` files to `res/raw` (dashes become underscores, so `heart.wav` stays `heart.wav`, `chat-reply.wav` becomes `chat_reply.wav`).
14
+
15
+ ## Use
16
+
17
+ ```kotlin
18
+ HeartGlyph(size = 28.dp, sound = true, label = "Like")
19
+ ```
20
+
21
+ > Generated from the same Lottie export as the other platforms, which is checked against an independent Lottie renderer. These component files have not yet been run on real devices; please report anything that does not work.
22
+
23
+ ## Compose Multiplatform
24
+
25
+ For Android, iOS, desktop and web from one Kotlin codebase, export with `--format compose-multiplatform`. The component uses [Compottie](https://github.com/alexzhirkevich/compottie), the multiplatform Lottie player:
26
+
27
+ ```kotlin
28
+ // build.gradle.kts (commonMain)
29
+ implementation("io.github.alexzhirkevich:compottie:2.0.0")
30
+ ```
31
+
32
+ ```bash
33
+ npx magic-glyphs add bell heart --format compose-multiplatform --out shared/src/commonMain/kotlin/glyphs
34
+ ```
35
+
36
+ ```kotlin
37
+ BellGlyph(size = 32.dp, onPlay = { /* play bell.wav with your platform's audio */ })
38
+ ```
39
+
package/docs/maker.md ADDED
@@ -0,0 +1,64 @@
1
+ # Icon maker guide
2
+
3
+ The icon maker turns your own artwork into an animated icon with motion and sound, in the same style as the library. It is included with every paid licence; you can try it with the sample before unlocking.
4
+
5
+ ## 1. Unlock
6
+
7
+ Paste the licence key from your Gumroad receipt at the top of the [icon maker](https://magicglyphs.com/maker/) and press **Unlock**. The browser remembers it. Use **Remove key from this browser** on the [icon browser](https://magicglyphs.com/icons/) when you are on a shared computer.
8
+
9
+ ## 2. Start from your artwork
10
+
11
+ - **Upload SVG or image:** an `.svg` file, or a PNG, JPG or WebP logo. Images are traced into shapes; this works best on simple, high-contrast artwork with a plain background.
12
+ - **Paste SVG code:** straight from Figma, Illustrator or any icon set you own.
13
+ - **Remix a library icon:** type its name, for example `rocket`, and press **Remix**. Its drawing, motion and sound are kept, ready for you to change.
14
+
15
+ The maker fits everything to the 24-pixel grid with a little padding, so it sits nicely next to library icons.
16
+
17
+ ## 3. Shape
18
+
19
+ - **Line icon or filled shape:** line icons are drawn with the library's stroke; filled shapes are solid.
20
+ - **Parts:** each separate shape becomes a part. Untick **Moves** to keep a part still. Tick **Detail** for small inner marks (an eye, a dot) so they stay lines in the solid style.
21
+
22
+ ## 4. Motion
23
+
24
+ Pick a motion: pop, bounce, drop in, wiggle, swing, spin, slide, shake, float, pulse, tilt or still. **Strength** sets how far it moves; **Snappy**, **Normal** and **Bouncy** set the feel.
25
+
26
+ **Give each part its own motion.** Select a part in the list: the motion buttons now apply to that part only. Choose a motion and use **Start after** to delay it, so parts move in sequence. For example, a box that pops while its lid spins in 200 ms later. **Same as all parts** returns a part to the shared motion; **Done with this part** goes back to editing all parts.
27
+
28
+ ## 5. Sound
29
+
30
+ Choose one of 39 sounds, then tune it:
31
+
32
+ | Slider | What it does |
33
+ |---|---|
34
+ | Volume | Louder or quieter than other icons |
35
+ | Pitch | Higher or lower, in semitones |
36
+ | Speed | Faster or slower |
37
+ | Tone | Softer (muffled) to brighter |
38
+ | Stereo | How far the sound follows the icon left and right on screen |
39
+ | Delay | When the sound starts after the motion begins |
40
+
41
+ Press **Hear it**, or the preview itself, to listen. Browsers play sound only after you have clicked on the page.
42
+
43
+ ## 6. Save
44
+
45
+ **Save to My icons** keeps the icon with your licence. Your saved icons appear in any browser where you unlock with the same key, and they are also kept in this browser. Up to 100 icons are kept; delete the ones you no longer need. What you are working on right now is kept in the browser too, so a refresh never loses it.
46
+
47
+ ## 7. Export
48
+
49
+ - **SVG:** a still image.
50
+ - **React (.tsx or .jsx), Vue, HTML:** animated, with your sound settings, using the free `magic-glyphs` package.
51
+ - **Lottie:** the motion, for any Lottie player on iOS, Android, Windows or Flutter.
52
+ - **Sound (.wav):** the sound with your settings, to play alongside Lottie in native apps.
53
+ - **Icon data (JSON):** use your icon everywhere the library works:
54
+
55
+ ```bash
56
+ npx magic-glyphs add my-logo --from my-icons/ --format react # or swiftui, flutter, compose, winui
57
+ MAGIC_GLYPHS_CUSTOM=./my-icons npx -y magic-glyphs-mcp # your coding assistant can use them too
58
+ ```
59
+
60
+ ## Tips
61
+
62
+ - Simpler artwork animates better. Merge tiny shapes in your design tool before importing.
63
+ - Convert text to outlines first; the maker reads shapes, not fonts.
64
+ - Your icons are yours. The maker runs in your browser; only icons you save are stored, with your licence.
package/docs/maui.md ADDED
@@ -0,0 +1,17 @@
1
+ # .NET MAUI
2
+
3
+ Each icon becomes one C# view that plays the icon's Lottie animation with SkiaSharp.
4
+
5
+ ```bash
6
+ dotnet add package SkiaSharp.Extended.UI.Maui
7
+ npx magic-glyphs add bell heart --format maui --out Glyphs
8
+ ```
9
+
10
+ In `MauiProgram.cs` add `builder.UseSkiaSharp();`, then:
11
+
12
+ ```csharp
13
+ var bell = new MagicGlyphs.BellGlyph(size: 32);
14
+ layout.Children.Add(bell); // plays on tap; call bell.Play() for other triggers
15
+ ```
16
+
17
+ Colours and style are set when you export: `--color "#2747f5" --style duotone`. For sound, add `Plugin.Maui.Audio`, put `bell.wav` (from `--format wav`) under `Resources/Raw`, and set `PlaySound`.
@@ -0,0 +1,49 @@
1
+ # Every other framework
2
+
3
+ Magic Glyphs is a standard web component, `<magic-glyph>`, so it works in every framework that renders HTML. Load it once, then use the tag.
4
+
5
+ ```bash
6
+ npm install magic-glyphs
7
+ ```
8
+
9
+ ```js
10
+ import 'magic-glyphs/all'; // the runtime and the 120 free icons; for paid icons see the CLI's bundle command
11
+ ```
12
+
13
+ Or with no build step:
14
+
15
+ ```html
16
+ <script src="https://unpkg.com/magic-glyphs/web/magic-glyphs.all.js"></script>
17
+ ```
18
+
19
+ ## Solid, Preact, Qwik, Lit, Ember
20
+
21
+ Import once in your entry file and write the tag in your components:
22
+
23
+ ```jsx
24
+ <magic-glyph name="heart" size="24" sound></magic-glyph>
25
+ ```
26
+
27
+ - **Solid, Qwik and Preact:** custom elements pass through untouched. In TypeScript, declare the tag once in a `.d.ts` file if your setup asks for it.
28
+ - **Lit:** use the tag inside your templates; it is a light-DOM element, so your styles reach it.
29
+ - **Ember:** import in `app/app.js`; use the tag in templates.
30
+
31
+ ## Angular
32
+
33
+ Add `CUSTOM_ELEMENTS_SCHEMA` to the component (or module) that uses the tag, and `import 'magic-glyphs/all';` in `main.ts`.
34
+
35
+ ## Alpine.js and htmx
36
+
37
+ The element draws itself whenever it is added to the page, including content swapped in by htmx or shown by Alpine. Bind attributes as usual: `<magic-glyph :name="icon">`.
38
+
39
+ ## Remix, React Router, SvelteKit
40
+
41
+ Follow the [React](https://magicglyphs.com/docs/react-vue/) or [Svelte](https://magicglyphs.com/docs/frameworks/) guides. The element renders on the server as an empty tag and draws in the browser, so there is no hydration mismatch.
42
+
43
+ ## Laravel (Blade), Django, Rails, Phoenix
44
+
45
+ Add the script tag to your base layout once and use `<magic-glyph name="...">` in any template. For paid icons, run `npx magic-glyphs bundle heart bell --out public/magic-glyphs.js` and load that file instead.
46
+
47
+ ## Electron, Ionic and Capacitor
48
+
49
+ These run your web front end, so everything above applies, sound included. Everything is local, with no network calls at run time. Expo apps use the [React Native](https://magicglyphs.com/docs/react-native/) components.
@@ -81,3 +81,8 @@ npx magic-glyphs add bell --format lottie --sound --out assets
81
81
  ## How the export was checked
82
82
 
83
83
  Every icon was converted and rendered at two mid-animation frames with an independent Lottie library, then compared pixel by pixel with the web engine. All 3,947 matched within a small tolerance. The files have **not** yet been played in lottie-ios, lottie-android or Lottie-Windows; try a handful on a device before relying on them.
84
+
85
+ ## After Effects, Webflow, Framer, LottieFiles
86
+
87
+ The Lottie files are standard Bodymovin JSON. Import them into After Effects with a Lottie import plugin to edit the motion further, drop them into Webflow's or Framer's Lottie element, or upload them to LottieFiles.
88
+
package/docs/qt.md ADDED
@@ -0,0 +1,26 @@
1
+ # Qt Quick (QML)
2
+
3
+ Each icon becomes one `.qml` file that draws the icon's own vectors with Qt Quick Shapes and plays its spring motion (pre-computed, so there is nothing to install). Qt 6.6 or newer.
4
+
5
+ ```bash
6
+ npx magic-glyphs add bell heart --format qml --out qml/glyphs
7
+ npx magic-glyphs add bell --format wav --out qml/glyphs # optional sound
8
+ ```
9
+
10
+ ```qml
11
+ import "glyphs"
12
+
13
+ BellGlyph { size: 32; color: "#2747f5" }
14
+ HeartGlyph { size: 32; color: palette.text; trigger: "click"; sound: true }
15
+ ```
16
+
17
+ | Property | Default | |
18
+ | --- | --- | --- |
19
+ | `size` | 24 | Width and height |
20
+ | `color` | black | Line and fill colour |
21
+ | `secondary` | `color` | Duotone fill (`--style duotone`) |
22
+ | `background` | white | Knocked-out details in the solid style |
23
+ | `trigger` | `"hover"` | `hover`, `click` or `none` (then call `play()`) |
24
+ | `sound` | false | Plays `<name>.wav` next to the file, using Qt Multimedia (only loaded when on) |
25
+
26
+ Python apps with PySide6 or PyQt6 load the same files.
@@ -0,0 +1,34 @@
1
+ # React Native
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ npm install lottie-react-native
7
+ npx magic-glyphs add heart bell --format react-native --sound --out src/icons
8
+ ```
9
+
10
+ Each icon is one `.tsx` file with its animation built in. `--sound` also writes `heart.wav` and `bell.wav`.
11
+
12
+ ## Use
13
+
14
+ ```tsx
15
+ import HeartGlyph from './src/icons/HeartGlyph';
16
+
17
+ <HeartGlyph size=28 accessibilityLabel="Like" />
18
+ ```
19
+
20
+ The icon plays when pressed. Props: `size`, `playOnPress`, `onPlay`, `accessibilityLabel`, `style`.
21
+
22
+ ## Sound
23
+
24
+ Play the WAV from `onPlay` with the audio library you already use, for example Expo:
25
+
26
+ ```tsx
27
+ import { useAudioPlayer } from 'expo-audio';
28
+ const player = useAudioPlayer(require('./src/icons/heart.wav'));
29
+ <HeartGlyph onPlay={() => { player.seekTo(0); player.play(); }} />
30
+ ```
31
+
32
+ The generated component type-checks against `react-native` and `lottie-react-native`.
33
+
34
+ > Generated from the same Lottie export as the other platforms, which is checked against an independent Lottie renderer. These component files have not yet been run on real devices; please report anything that does not work.
package/docs/react-vue.md CHANGED
@@ -39,6 +39,17 @@ Call `play()` through a template ref: `<MagicGlyph ref="g" ... />` then `g.value
39
39
 
40
40
  ## Shipping only the icons you use
41
41
 
42
+ Your bundle only holds the icons you register, never the whole library. Each icon is about 0.2 KB, plus 8 KB for the runtime.
43
+
44
+ - `magic-glyphs/icons.json` registers all 120 free icons at once (about 10 KB gzipped).
45
+ - `magic-glyphs/icons/<name>` imports one free icon:
46
+
47
+ ```jsx
48
+ import heart from 'magic-glyphs/icons/heart';
49
+ import bell from 'magic-glyphs/icons/bell';
50
+ register([heart, bell]);
51
+ ```
52
+
42
53
  The `icons.json` in the package holds the 120 free icons. For paid icons, and to ship only what you use, let the CLI write one small component per icon (after `npx magic-glyphs login`):
43
54
 
44
55
  ```bash
@@ -55,7 +66,7 @@ Each file registers just its own icon, so the bundle contains the 7 KB engine pl
55
66
 
56
67
  In a TypeScript project (one with a `tsconfig.json`), the CLI writes typed components: `.tsx` for React and `<script setup lang="ts">` for Vue, so `tsc` and `vue-tsc` builds pass. Add `--js` or `--ts` to choose yourself. React components start with `'use client'`, so they work inside Next.js server components.
57
68
 
58
- Tested with the default Vite React + TypeScript and Vue + TypeScript templates, and with Next.js (App Router).
69
+ Tested with the default Vite React + TypeScript and Vue + TypeScript templates, Next.js (App Router) and Nuxt 4. In Nuxt, generated components in `components/` are picked up automatically, and icons render on the server.
59
70
 
60
71
  ## A mute switch
61
72
 
package/docs/rust.md ADDED
@@ -0,0 +1,43 @@
1
+ # Rust
2
+
3
+ ```bash
4
+ cargo add magic-glyphs
5
+ ```
6
+
7
+ The crate has no dependencies (it is `no_std` with `alloc`) and includes the 120 free icons. Each icon has its layers, its sound's name, and its spring motion pre-computed as one 2D matrix per layer per frame.
8
+
9
+ ```rust
10
+ use magic_glyphs::{icons, Style};
11
+
12
+ let bell = icons::BELL; // or icons::by_name("bell")
13
+ let style = Style::duotone().color("#2747f5").size(32);
14
+
15
+ let svg = bell.svg(&style); // the resting icon
16
+ let frame = bell.svg_at(0.12, &style); // 120 ms into its motion
17
+ let done = bell.done(0.12); // redraw each frame until true
18
+ let m = bell.matrix(0, 0.12); // or draw it yourself: [a b c d e f] for layer 0
19
+ ```
20
+
21
+ Draw the SVG with what your toolkit uses: `resvg` + `tiny-skia` for a pixmap, an SVG image loader in **egui**, `svg::Handle` in **iced**, or Slint's image support. Start the motion on hover or click, and draw `svg_at(elapsed)` each frame until `done`.
22
+
23
+ ## Paid icons
24
+
25
+ Log in with your licence key, then generate the icons you use into your project. Each file holds one `pub const ICON: Icon`:
26
+
27
+ ```bash
28
+ npx magic-glyphs login YOUR-LICENCE-KEY
29
+ npx magic-glyphs add rocket heart --format rust --out src/glyphs
30
+ ```
31
+
32
+ ```rust
33
+ mod glyphs { pub mod rocket; pub mod heart; }
34
+ let svg = glyphs::rocket::ICON.svg(&Style::solid());
35
+ ```
36
+
37
+ ## Sound
38
+
39
+ `icon.sound` names the icon's sound. Export it with `npx magic-glyphs add bell --format wav` and play it with `rodio` (or your audio library) when the motion starts.
40
+
41
+ ## Tauri, Dioxus, Leptos, Yew
42
+
43
+ These draw in a web view, so use the [`<magic-glyph>` web component](https://magicglyphs.com/docs/web/), which plays the sound for you. See [Tauri and Rust](https://magicglyphs.com/docs/tauri-rust/).
@@ -0,0 +1,27 @@
1
+ # Webflow, Framer, Wix and other site builders
2
+
3
+ Every builder that accepts custom code can use Magic Glyphs. Add the script once for the whole site, then place icons with an embed. For WordPress and Shopify, see [HTML, WordPress, Shopify](https://magicglyphs.com/docs/web/).
4
+
5
+ The script for the free icons:
6
+
7
+ ```html
8
+ <script src="https://unpkg.com/magic-glyphs/web/magic-glyphs.all.js" defer></script>
9
+ ```
10
+
11
+ For paid icons, make your own file with `npx magic-glyphs bundle heart bell rocket --out magic-glyphs.js`, upload it to the builder's file storage, and point the script at it.
12
+
13
+ An icon anywhere on a page:
14
+
15
+ ```html
16
+ <magic-glyph name="rocket" size="32" sound></magic-glyph>
17
+ ```
18
+
19
+ | Builder | Where the script goes | Where icons go |
20
+ | --- | --- | --- |
21
+ | **Webflow** | Site settings → Custom code → Footer code | An **Embed** element |
22
+ | **Framer** | Site settings → General → Custom code (end of body) | An **Embed** component (HTML) |
23
+ | **Ghost** | Settings → Code injection → Site footer | An **HTML** card |
24
+ | **Squarespace** | Settings → Advanced → Code injection → Footer | A **Code** block |
25
+ | **Wix** | Settings → Custom code → Body end (all pages) | **Embed code** → Embed HTML |
26
+
27
+ Webflow and Framer can also play Lottie files directly: export with `npx magic-glyphs add rocket --format lottie` or from the [icon maker](https://magicglyphs.com/maker/) and use their Lottie element (without sound). Where scripts are not allowed at all, use an [animated GIF or video](https://magicglyphs.com/docs/images-video/).
package/docs/sound.md CHANGED
@@ -45,7 +45,7 @@ MagicGlyphs.sound.defaults({ volume: 0.8, pan: 0.5 });
45
45
  MagicGlyphs.sound.volume(0.4); // master volume, 0 to 1
46
46
  ```
47
47
 
48
- Icons you make or remix in the [icon maker](https://magic-glyphs-site.lewisvillamor26.workers.dev/maker/) carry their sound settings with them, so the exported React, Vue and HTML play exactly what you chose.
48
+ Icons you make or remix in the [icon maker](https://magicglyphs.com/maker/) carry their sound settings with them, so the exported React, Vue and HTML play exactly what you chose.
49
49
 
50
50
  ## A mute switch for visitors
51
51
 
@@ -76,4 +76,4 @@ All sounds are measured with the same hearing-weighted loudness curve used for b
76
76
 
77
77
  Give visitors a mute control if you turn sound on for a whole page, and keep it off for icons people see constantly, like navigation.
78
78
 
79
- Hear every sound on the website: https://magic-glyphs-site.lewisvillamor26.workers.dev/docs/sound/
79
+ Hear every sound on the website: https://magicglyphs.com/docs/sound/
@@ -0,0 +1,22 @@
1
+ # SwiftUI
2
+
3
+ ## Install
4
+
5
+ Add the [Lottie package](https://github.com/airbnb/lottie-ios) (4.4 or later) to your Xcode project, then:
6
+
7
+ ```bash
8
+ npx magic-glyphs add heart bell --format swiftui --sound --out MyApp/Icons
9
+ ```
10
+
11
+ Each icon is one `.swift` file with its animation built in. Add the `.wav` files to the app bundle for sound.
12
+
13
+ ## Use
14
+
15
+ ```swift
16
+ HeartGlyph(size: 28, label: "Like")
17
+ HeartGlyph(size: 28, sound: false)
18
+ ```
19
+
20
+ The icon plays when tapped, and its sound plays with it if the WAV is in the bundle.
21
+
22
+ > Generated from the same Lottie export as the other platforms, which is checked against an independent Lottie renderer. These component files have not yet been run on real devices; please report anything that does not work.
@@ -0,0 +1,15 @@
1
+ # Tauri and Rust
2
+
3
+ ## Tauri, Dioxus and Leptos
4
+
5
+ These apps draw their interface in a web view, so Magic Glyphs works exactly as on the web, including sound:
6
+
7
+ ```bash
8
+ npm install magic-glyphs
9
+ ```
10
+
11
+ Then use the `<magic-glyph>` tag, or the React, Vue or Svelte setup your front end uses. Everything runs locally; no network access is needed at run time. For paid icons, bundle what you use with `npx magic-glyphs bundle heart bell --out src/magic-glyphs.js` so the app needs no licence check at run time.
12
+
13
+ ## Native Rust interfaces (egui, iced, Slint)
14
+
15
+ Use the [magic-glyphs crate](https://magicglyphs.com/docs/rust/): `cargo add magic-glyphs`. It gives you each icon's SVG at any moment of its motion, with no dependencies.
package/docs/unity.md ADDED
@@ -0,0 +1,15 @@
1
+ # Unity
2
+
3
+ Unity gets each icon as a sprite sheet (every frame of the motion on one PNG) and a small component that plays it.
4
+
5
+ ```bash
6
+ npx magic-glyphs add bell heart --format unity --size 128 --color "#ffffff" --out Assets/Glyphs
7
+ npx magic-glyphs add bell heart --format wav --out Assets/Glyphs # optional sound
8
+ ```
9
+
10
+ 1. Select `bell.sheet.png` and set **Texture Type** to *Sprite (2D and UI)*.
11
+ 2. Add **BellGlyph** to a GameObject with an **Image** (UI) or a **SpriteRenderer**, and drag the sheet to **Sheet** (and `bell.wav` to **Sound**).
12
+
13
+ It plays on hover and click (UI needs an EventSystem; 2D objects need a collider), or call `Play()`. Pick `--size` for the largest size you show it at.
14
+
15
+ Other engines (Defold, Bevy, Phaser, GameMaker) can use `--format spritesheet`: a PNG grid plus JSON with the frame size, count and timing.
@@ -0,0 +1,23 @@
1
+ # Windows (WinUI)
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ dotnet add package CommunityToolkit.WinUI.Lottie
7
+ npx magic-glyphs add heart bell --format winui --sound --out Icons
8
+ ```
9
+
10
+ Each icon is one `.cs` control with its animation built in. Add the `.wav` files to the project as Content for sound.
11
+
12
+ ## Use
13
+
14
+ ```csharp
15
+ var heart = new HeartGlyph(28) { Sound = true };
16
+ panel.Children.Add(heart);
17
+ ```
18
+
19
+ The icon plays when tapped. Call `heart.Play()` to play it from code.
20
+
21
+ For WPF, Electron or Tauri on Windows, use the web or Lottie routes instead.
22
+
23
+ > Generated from the same Lottie export as the other platforms, which is checked against an independent Lottie renderer. These component files have not yet been run on real devices; please report anything that does not work.
package/lib.js CHANGED
@@ -12,7 +12,7 @@ const data=loadData();MG.register(data);
12
12
  const idxFile=path.join(__dirname,'data','index.json');
13
13
  const index=(()=>{let ix=null;try{ix=JSON.parse(fs.readFileSync(idxFile,'utf8'))}catch(e){}const own=data.icons.map(i=>({n:i.n,c:i.c,t:i.t}));return ix&&ix.length>own.length?ix:own})();
14
14
  const known=new Set(index.map(i=>i.n)),total=index.length;
15
- const STYLES=['outline','solid','duotone','glass'],FORMATS=['svg','lottie','json','react','vue','html'];
15
+ const STYLES=['outline','solid','duotone','glass'],FORMATS=['svg','lottie','json','react','vue','html','react-native','swiftui','compose','flutter','winui','gif','apng','webm','mp4','wav','maui','avalonia','qml','godot','unity','compose-multiplatform','rust','spritesheet'];
16
16
  const byName=new Map(data.icons.map(i=>[i.n,i]));
17
17
  const categories=()=>{const c={};index.forEach(i=>c[i.c]=(c[i.c]||0)+1);return c};
18
18
  function search(query,opt){
@@ -50,6 +50,14 @@ function render(name,format,o){
50
50
  case 'lottie':{if(style==='glass')throw new Error('Lottie export supports outline, solid and duotone (glass uses a gradient that Lottie players handle inconsistently).');
51
51
  const {toLottie}=require('./tools/lottie.js');return{ext:'json',file:name+(style==='outline'?'':'.'+style)+'.lottie.json',text:JSON.stringify(toLottie(ic,Object.assign({},o,{color:o.color||'#000000'})))}}
52
52
  case 'json':return{ext:'json',file:name+'.json',text:JSON.stringify(ic)};
53
+ // native apps: one file each, with the Lottie animation inside (see tools/native.js)
54
+ case 'react-native':case 'swiftui':case 'compose':case 'flutter':case 'winui':{if(style==='glass')throw new Error('Native formats support outline, solid and duotone.');
55
+ const f=require('./tools/native.js')[format](ic,Object.assign({},o,{style}));return{ext:f.file.split('.').pop(),file:f.file,text:f.text}}
56
+ // more native targets (tools/native2.js); unity and spritesheet also write a PNG sprite sheet
57
+ case 'maui':case 'avalonia':case 'qml':case 'godot':case 'unity':case 'compose-multiplatform':case 'rust':{if(style==='glass')throw new Error('Native formats support outline, solid and duotone.');
58
+ const f=require('./tools/native2.js')[format](ic,Object.assign({},o,{style,MG}));return{ext:f.file.split('.').pop(),file:f.file,text:f.text,extra:f.extra}}
59
+ case 'spritesheet':{if(style==='glass')throw new Error('Sprite sheets support outline, solid and duotone.');
60
+ const s=require('./tools/native2.js').spritesheet(ic,Object.assign({},o,{style,MG,size:o.size||128}));return{ext:'png',file:name+'.sheet.png',data:s.png,extra:[{file:name+'.sheet.json',data:JSON.stringify(s.meta,null,2)}]}}
53
61
  case 'react':{const P=pascal(name),ts=!!o.ts;
54
62
  // "use client" lets the component sit inside a Next.js server component tree; other bundlers ignore it
55
63
  return{ext:ts?'tsx':'jsx',file:P+'Glyph.'+(ts?'tsx':'jsx'),text:`'use client';\nimport { MagicGlyph, register${ts?', type MagicGlyphProps':''} } from 'magic-glyphs/react';\n\nregister([${JSON.stringify(ic)}]);\n\n/** Animated "${name}" icon. Props: variant, size, trigger, label, sound, className, style. */\nexport default function ${P}Glyph(props${ts?": Omit<MagicGlyphProps, 'name'>":''}) {\n return <MagicGlyph name="${name}" variant="${style}" {...props} />;\n}\n`}}
package/mcp/server.js CHANGED
@@ -20,7 +20,7 @@ server.registerTool('list_categories',{title:'List categories',description:'List
20
20
  async()=>{const c=L.categories();return text(Object.keys(c).sort().map(k=>k+': '+c[k]).join('\n')+'\ntotal: '+L.total)});
21
21
  server.registerTool('get_icon',{title:'Get icon',
22
22
  description:'Get one icon ready to use. format: "html" (custom element tag, needs the magic-glyphs script on the page), "react" or "vue" (component file source, needs the magic-glyphs npm package), "svg" (static SVG markup, no animation), "lottie" (animated Lottie JSON for iOS, Android, Windows, macOS and Flutter), "json" (raw icon data). Returns the suggested file name and the content.',
23
- inputSchema:{name:z.string().describe('Exact icon name from search_icons'),format:z.enum(L.FORMATS).optional().describe('Default "html"'),style:z.enum(L.STYLES).optional().describe('Default "outline"'),
23
+ inputSchema:{name:z.string().describe('Exact icon name from search_icons'),format:z.enum(L.FORMATS.filter(f=>!['gif','apng','webm','mp4','wav','spritesheet','unity'].includes(f))).optional().describe('Default "html"'),style:z.enum(L.STYLES).optional().describe('Default "outline"'),
24
24
  color:z.string().regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/).optional().describe('Hex colour for svg and lottie output'),secondary:z.string().regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/).optional().describe('Hex duotone fill colour'),size:z.number().positive().max(2048).optional().describe('Pixel size for svg and html')},
25
25
  annotations:{readOnlyHint:true}},
26
26
  async({name,format,style,color,secondary,size})=>{