Goo Ball
betaA decorative jelly ball you drag around a well: it stretches along its velocity and squashes against the walls.
- Effects & motion
- 1 file
- 3 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add goo-ballnpm packages installed: class-variance-authority, motion, radix-ui.
import { GooBall } from "@/components/ui/goo-ball";Default
Gallery
Controlled
Wide Well
Disabled
Right To Left
<GooBall>
| Prop | Type | Default |
|---|---|---|
defaultValueStarting position (uncontrolled). Defaults to the centre. | GooBallValue | CENTRE |
disabledStops dragging and keyboard nudging. | boolean | false |
fill | "light" | "dark" | "light" |
giveSpring softness, 10-100: how slow and wobbly the settle is. | number | 50 |
gripHow tightly the blob tracks the handle, 0-100. Lower lags more. | number | 50 |
onValueChangeCalled with the new position as the ball is dragged or nudged. | (value: GooBallValue) => void | — |
sizeBall diameter in px (bencho: 32-84). | number | 56 |
stretchHow far the blob deforms with speed, 0-70. 0 keeps it a rigid circle. | number | 36 |
strokeAdds a 1px hairline ring in the border colour. | boolean | false |
valuePosition in percent of travel (controlled). | GooBallValue | — |
Plus every attribute of <div> except defaultValue, onChange.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes