Skip navigation
This works by using:
0:00 / 0:21

This works by using:

Kevin Grajeda

@k_grajeda10K followers

Visit on X
2,824 likesDownloadOriginal post

310,934 views

This works by using: - normal border-radius - a ::before pseudo-element for the tab - Framer Motion to handle the drag interaction - a tiny distance-to-progress calculation that updates the border radii

36 Comments

Comments from the original post on X (Twitter)

  • Haz's profile picture

    @diegohaz

    That's cool. I built it a while ago. The biggest challenge is syncing it with nonlinear transitions:

    21 likes

  • daniel petho's profile picture

    @nonzeroexitcode

    ufff this is so goooood!

    11 likes

  • Kevin Grajeda's profile picture

    @k_grajeda

    🙌thanks

    1 like

  • Said fatah's profile picture

    @SaiduSenpay

    recreated it using clip-path , this was a fun exercise for my frontend skills .

    6 likes

  • Spanky McDoob's profile picture

    @59thProfile

    theres a point where it gets too pointy on the slide, i wonder if that can be fixed

    2 likes

  • Mathieu Jouhet's profile picture

    @daformat

    This reminds me of the technique I used and explain in my how to round svg polygons @observablehq notebook:

    2 likes

  • Moe Amaya's profile picture

    @moeamaya

    Sooo good

    2 likes

  • Mona's profile picture

    @mona_biasia

    really cool!

    1 like

  • Rasmus Andersson's profile picture

    @rsms

    Very nice! Add smoothing to the curves (squircle style) and it’ll look even more organic I bet

    1 like

  • Kevin Grajeda's profile picture

    @k_grajeda

    Will do!

  • shawn.'s profile picture

    @zzzzshawn

    thank you for this

    1 like

  • Igor bedesqui's profile picture

    @bedesqui

    amazing post thank you

    1 like

  • John Rees's profile picture

    @johnreesxyz

    would you mind sharing what you created this animation with? it's so effective for explaining things!

    1 like

  • Ashutosh Rana • UX for AI Products's profile picture

    @AshutoshDes

    Preety cool, the amount of details is crazy

  • Edoardo Galati's profile picture

    @edogalati

    So smooth!

  • Rakibul's profile picture

    @rakibulism

    superb

  • Rico's profile picture

    @ricoberan

    soo tufff

  • رِزق's profile picture

    @irzg_z

    The devil is in the details. 😫

  • Rene Wang's profile picture

    @renedotwang

    love your attention on details. gonna feature this on

  • AI Mastery Guide's profile picture

    @aiseomastery

    That distance to progress trick is such a clever way to handle the drag.