Skip to content
Components54 / 118

Liquid Toolbar

A borderless pill of Apple-style liquid glass holding a row of icon actions, rendered for real on the GPU. What is behind it is frosted through the flat face and bent hardest in the wide rounded bevel, with a faint colour fringe, so the edge reads by refraction alone: no outline, no shadow. Soft highlights follow your cursor round the bevel. A clear lens glides to what you point at on a soft spring, and when you press it lifts into a magnifying drop you can slide along the bar while the bar dips, swells and settles. Fully keyboard accessible.

WebGL2 liquid glassBorderlessReal refractionSpringsKeyboard accessibleGSAPReduced-motion safe
Press and slide along the actionsDrag the glass by its edge across the photo

Tweak

LIVE

Stage

Behind the glass

Glass

76px
#141416
0.20
#ffffff

Optics

1.00
0.60
10.0px
0.75

Tool picker

Keep the lens on the last pressed action

Props

16 props
  • itemsLiquidToolbarItem[]
    The actions: { id, label, icon, onSelect? }. icon is "plus", "circle", "square" or your own SVG.default Add, Ellipse, Rectangle
  • backdropRefObject<HTMLImageElement | HTMLVideoElement | HTMLCanvasElement>
    The image, video or canvas behind the toolbar, refracted through the glass. Without it, the page behind is frosted.
  • valuestring | null
    Controlled selected id.
  • defaultValuestring | null
    Initially selected id when uncontrolled.default null
  • onValueChange(id: string) => void
    Called with the pressed action's id.
  • selectableboolean
    Keep the lens on the last pressed action (a tool picker). Off: plain actions.default true
  • sizenumber
    Height of the pill, px.default 76
  • tintstring
    Colour of the glass tint.default "#141416"
  • frostnumber
    Strength of the tint, 0 clear to 1 solid.default 0.2
  • iconColorstring
    Colour of the icons.default "#ffffff"
  • refractionnumber
    Strength of the refraction.default 1
  • dispersionnumber
    Colour fringing in the bevel, 0 to 1.default 0.6
  • blurnumber
    Frosting of what is seen through the glass, px.default 10
  • bevelnumber
    Width of the rounded bevel, 0.2 to 1 (share of the half height).default 0.75
  • aria-labelstring
    Accessible name of the toolbar.default "Toolbar"
  • classNamestring
    Extra classes on the toolbar.