SunUI
創始會員NT$2,490 終身更新,1月11日截止取得席位

SunUI 圖示

用同一套標準畫出來的圖示。

像素、雙色、線條三套,同一套標準。全部會動,一行指令裝好一套。

$ npx shadcn@latest add https://sunui.synvize.com/r/icons/sunui-animated-pixel-icons.json

197 個圖示

M

用法

圖示會繼承 currentColor,除非傳入 title,否則螢幕閱讀器會略過它。

example.tsx
import { Icon } from "@/components/ui/sunui-icons";

// Decorative, next to a text label
<button><Icon name="cart" size={16} /> Add to cart</button>

// Standalone, announced as "Claimed"
<Icon name="stamp-check" title="Claimed" />

// Point the accent part at your theme color for one subtree
<div className="[--sunui-icon-accent:var(--primary)]">
  <Icon name="punch-card" />
</div>

動態圖示

AnimatedIcon 使用相同的圖形。懸停類圖示會在外層按鈕被懸停或聚焦時播放,整個控制項都是觸發範圍。切換類圖示跟隨 active,載入類圖示只在它為 true 時循環。開啟減少動態時,每個圖示都直接跳到結束狀態。

animated.tsx
import { AnimatedIcon } from "@/components/ui/sunui-animated-icons";

// Plays the tear along the perforation when the button is hovered
<button><AnimatedIcon name="coupon" size={16} /> Claim coupon</button>

// Menu morphs into a close icon
<button aria-expanded={open} onClick={() => setOpen(!open)}>
  <AnimatedIcon name="menu" active={open} title={open ? "Close menu" : "Open menu"} />
</button>

// Fills with a short press
<AnimatedIcon name="heart" active={saved} />

// Spins only while loading
<AnimatedIcon name="loader" active={pending} />