SunUI
创始会员$79 终身更新,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} />