SunUI
創設メンバー$79・永久更新・1月11日まで枠を確保する

SunUI Icons

ひとつの基準で描いたアイコン。

ピクセル、2色、線の3セットを、ひとつの基準で。すべて動き、コマンド1行で1セット入ります。

$ 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} />