Skip navigation
Wobble Buttons made with HTML in Canvas
0:00 / 0:27

Wobble Buttons made with HTML in Canvas

Wes Bos

@wesbos444K followers

Visit on X
509 likesDownloadOriginal post

54,565 views

Wobble Buttons made with HTML in Canvas I can't stop clicking these

34 Comments

Comments from the original post on X (Twitter)

  • Alex Greenland's profile picture

    @ajrgd

    wild… so everything's easy and fast because there's no reflow/rendering step — it's all paint?

    6 likes

  • Wes Bos's profile picture

    @wesbos

    The canvas is updated when the DOM element is - so I assume it still goes through layout + paint. I do think it is a bit more taxing to draw to canvas, but it does seem to be pretty responsive!

    1 like

  • Alex Greenland's profile picture

    @ajrgd

    but maybe the layout step is confined to each canvas's bounds, not the whole page, so can be very performant and parallelised (hello GPUs)

    2 likes

  • Wes Bos's profile picture

    @wesbos

    Yeah I'm not 100% sure how it works, but the browser already knows which parts of the screen to paint. So requesting to paint to canvas isn't too taxing.

    1 like

  • Steve McNiven-Scott's profile picture

    @stevemcniven

    > Wobble Button That was my nickname in highschool

    1 like

  • Peter Fox's profile picture

    @peterfox

    This is going to lead to some really dumb and ugly UI choices. Like early 2000s ugly UI choices 😂

    1 like

  • Sebastian's profile picture

    @Danmoreng

    Remind me in ~3 years, when all major browsers have this in stable release...

    1 like

  • Wes Bos's profile picture

    @wesbos

    k - its a sunday but Ill work the weekend for ya

    13 likes

  • Nicholas Shanks's profile picture

    @nickshanks_

    Jelly!

    1 like

  • Adrian Wołczuk's profile picture

    @woladiX

    The no-reflow angle is what makes this interesting for design systems. Canvas-rendered components bypass the layout engine entirely — which means you can encode motion constraints directly in the component logic rather than fighting CSS specificity. Wild approach.

    1 like

  • Cowboy's profile picture

    @Cowboycodey

    Jiggly

    1 like

  • Christoph Nakazawa's profile picture

    @cnakazawa

    Man, where was this when I was building Athena Crisis with the DOM (I'm an idiot).

    1 like

  • Daniel Ives's profile picture

    @couponnephew

    daaang I need to add some effects to my Risk game

    1 like

  • Mark Davis's profile picture

    @MarkFonts

    Can someone explain why these are impressive? Was this pretext enabled or shader enabled?

    1 like

  • Wes Bos's profile picture

    @wesbos

    Painting elements to canvas was enabled. So now anything you could do with canvas, you can apply to HTML elements, without giving up the ease or accessibility of html and css

    5 likes

  • Tommy J. Vedvik's profile picture

    @tommyvedvik

    @MarkFonts this is bigger than pretext 😅

    1 like

  • Mark Davis's profile picture

    @MarkFonts

    @wesbos that’s what she said

  • Serge's profile picture

    @sergical

    Is this Flash v33?

    1 like

  • jass's profile picture

    @jassdotgg

    I NEED SOUND. PLEASE.

    1 like

  • BLU3MOJO 🍟's profile picture

    @BLU3MOJO

    Been loving all the html in canvas content ngl