Skip to content
PixiKit

Face Magnifier

A grid of small portraits with a lens that follows the pointer: tiles under it grow, spread apart and regain their color, and a click opens one in the centre.

pixikit.com/docs/components/face-magnifier

Customize

Preset
Columns12
Tile size0.36
Magnify1.50×
Lens size1.30
Fill0.92
Radius0.14
Saturation0.00
Dim0.25
Follow0.45s
Autoplay
Autoplay speed1.00
Open on click
Captions
Interactive
Background color
Seed0
Paused

Props

26
NameTypeDefaultDescription
itemsFaceMagnifierItem[]DEFAULT_ITEMSThe portraits; they repeat to fill the grid.
preset"studio" | "mosaic" | "loupe" | "wide" | "colour" | "dots""studio"A named setup. Values you leave at their defaults follow it.
columnsnumber12Tiles per row.
tileSizenumber0.36Resting tile size, as a share of its cell.
magnifynumber1.5How much the tiles under the lens grow and spread.
lensSizenumber1.3Reach of the lens, in cells.
fillnumber0.92How much of its enlarged cell a magnified tile fills.
radiusnumber0.14Corner rounding, as a share of the tile; 0.5 makes circles.
saturationnumber0Color left in tiles outside the lens; 0 is black and white.
dimnumber0.25How much tiles outside the lens fade.
follownumber0.45Seconds the lens takes to catch up with the pointer.
autoplaybooleantrueWhen the pointer is away, the lens drifts across the grid on its own.
autoplaySpeednumber1Speed of the drifting lens.
openOnClickbooleantrueClicking a tile opens its photo large in the centre. Click again or press Escape to put it back.
captionsbooleantrueShows the title and subtitle of the opened photo.
interactivebooleantrueLets the pointer and keyboard steer the lens. Arrow keys move it tile by tile; Enter opens the tile under it.
backgroundColorstring"transparent"Color behind the grid.
seednumber0Changes which portrait lands on which tile.
pausedbooleanfalseFreezes the drifting lens.
dprnumber2Kept for parity with canvas galleries; this one is drawn by the browser at its own pixel ratio.
ariaLabelstring"Portrait grid"Label announced for the grid.
onOpen(item: FaceMagnifierItem, index: number) => voidNoneCalled when a photo is opened.
refRef<FaceMagnifierHandle>NoneHandle with open, close and focusAt.
childrenReactNodeNoneContent laid over the grid.
classNamestringNone
styleCSSPropertiesNone

Related