fetaUI
GitHub

Usage

Props, colors and accessibility.

Props

PropTypeDefault
sizenumber24
trigger'hover' | 'click' | 'inView' | 'loop' | 'none''hover'
preset'draw' | 'pop' | 'wiggle' | 'spin' | 'bounce' | 'slide' | 'pulse' | 'shake' | 'blink' | 'float' | 'swap''draw'
speednumber1

Every other prop goes to the underlying svg. The ref exposes startAnimation() and stopAnimation().

Color

Icons draw in currentColor, so they follow the text color around them. Styles with extra colors read these variables:

VariableDefaultStyle
--feta-knockout#FFFFFFFilled. Set it to your surface color.
--feta-riso#FF8A5BRiso plate. Try #7CC4FF, #AFE67F or #FFD24D.
--feta-glass-from / -to#BFE3FF / #4F8BFFGlass gradient
--feta-glass-ink#1D3FA0Glass outline
--feta-neon-glow / -core#FF4FD8 / #FFE6FANeon
globals.css
.card {
  --feta-riso: #7cc4ff;
  --feta-knockout: var(--background);
}

Accessibility

  • Icons are decorative by default and get aria-hidden.
  • Pass aria-label to make an icon meaningful; it becomes role="img".
  • Give interactive icons a touch target of at least 44 × 44 px.
  • Icon ink should reach 3:1 contrast with its background. Check Glass on light surfaces and Neon on dark ones.
save-button.tsx
<button aria-label="Save">
  <BookmarkIcon />
</button>

<StarIcon aria-label="Favorite" />

Do and don’t

  • Use one style per surface.
  • Keep icons at 16, 20, 24, 32 or 48 px. Stroke scales with size, never per icon.
  • Recolor Riso with the variable, not by editing the SVG.
  • Use Neon on dark backgrounds only.