FlowFieldAvatar

The <FlowFieldAvatar> component renders deterministic streamlines through a seed-derived noise field.

It follows the same approach used by plotter-style flow fields: start from a grid of points, displace each seed slightly, then trace vertices through the angle returned by a 2D noise field.

Usage

<script setup>
import { FlowFieldAvatar } from '@maxnth/gestalt'
</script>

<template>
  <FlowFieldAvatar seed="jane@example.com" :size="96" />
</template>

Props

PropTypeDefaultDescription
seedstring | number-Any value; each unique seed yields a unique flow field.
sizenumber32Rendered size in pixels.
radiusnumber | string"9999px"Corner radius. Number is pixels; string is CSS.
columnsnumber14Number of seed columns.
rowsnumber14Number of seed rows.
iterationsnumber28Steps traced in each direction from every seed.
stepSizenumbersize * 0.014Step size in SVG user-space units.
xDampnumbersize * 0.95Horizontal noise scale denominator.
yDampnumbersize * 0.95Vertical noise scale denominator.
jitternumber0.8Seed displacement as a fraction of each grid cell.
marginnumbersize * 0.08Margin around the seeded grid in SVG user-space units.
angleRangenumber180Angle spread in degrees sampled from the noise field.
bidirectionalbooleantrueDraw both forward and reverse traces from each seed.
backgroundstring-SVG background as #RGB or #RRGGBB; invalid values use the generated color.
colorsstring[]-#RGB or #RRGGBB stroke colors; invalid entries are ignored.
strokeWidthnumbersize * 0.005Stroke width in SVG user-space units.
opacitynumber0.72Stroke opacity from 0 to 1.
ringboolean | number | stringfalseOptional outline. true = white 2px ring.
styleobject-Extra inline styles merged onto the wrapper.

Examples

<!-- Dense short traces -->
<FlowFieldAvatar seed="field" :size="96" :columns="22" :rows="22" :iterations="18" />

<!-- Longer plotter-style traces -->
<FlowFieldAvatar seed="field" :size="96" :columns="9" :rows="9" :iterations="56" :step-size="4" />

<!-- Custom palette -->
<FlowFieldAvatar
  seed="field"
  :size="96"
  background="#101014"
  :colors="['#F8FAFC', '#38BDF8', '#F472B6', '#FACC15']"
/>