Skip to content
PixiKit

Dot Morph

A picture made of dots that rearranges into a second picture, with text that appears over it once the dots land.

pixikit.com/docs/components/dot-morph

Customize

Trigger
Dot size4px
Gap3px
Color
Duration700ms
Stagger240ms

Props

14
NameTypeDefaultDescription
fromstring[]RequiredThe picture at rest: one string per row; `#` solid, `o` ring, `.` faint, space empty.
tostring[]RequiredThe picture the dots travel to, in the same format.
trigger"hover" | "inView" | "click" | "none""hover"What morphs it: pointer or focus, entering the view, a click, or nothing.
activebooleanNoneControls the morph from outside; overrides the trigger.
dotSizenumber4A dot's diameter in pixels.
gapnumber3The space between dots, in pixels.
colorstring"var(--primary)"The dot colour; any CSS colour, theme variables included.
durationnumber700How long one dot travels, in milliseconds.
staggernumber240How much later the dots farthest from the centre start, in milliseconds.
slotDotMorphSlotNoneThe rectangle of the `to` picture, in cells, where `children` sits.
childrenReactNodeNoneShown over the slot once the dots have landed, hidden at rest.
ariaLabelstringNoneDescribes the picture to assistive tech; without it the picture is hidden from it.
onChange(active: boolean) => voidNoneCalled when the morph switches on or off.
classNamestringNone

Related