Get started
Introduction
Soft clay web components. One WebGL2 shader draws every surface, ui-sdk does the behaviour, and CSS draws the same clay when WebGL2 isn't there.
Claymorph UI gives ui-sdk's web components a clay body. You keep writing the ui-sdk parts you know, like <ui-button> or <ui-switch>, and wrap them in a clay element. The wrapper adds the material and the motion; the keyboard, focus, ARIA and form behaviour stay in ui-sdk.
Every component is named for one verb, so picking one takes a second:
Actions
Inputs
Views and popups
Display
Songs played
1,248
Current streak
7
How the clay is drawn
- One WebGL2 context draws every surface on the page, then copies each into its own small canvas. Browsers cap WebGL contexts, so the page never runs out.
- Shapes are signed distance fields: rounded rectangles with a pillow-shaped height profile. Wells are the same shape pressed in. Shapes can melt into each other with a smooth union, like the Roll button's bead.
- Clay shading: wrap lighting, a subsurface tint near the terminator, a broad matte sheen, fine fingerprint grain and a shadow tinted with the clay's own colour.
- Springs, not keyframes: an analytic damped spring drives hover swell, press squash and every knob, bead and ball. It runs only while something moves.
- It degrades to CSS: before the first frame, without WebGL2, on context loss or in forced colours, the same clay is drawn with layered
box-shadow.