Skip navigation
How to transform a shadcn switch into a pricing toggle ↓
0:00 / 0:39

How to transform a shadcn switch into a pricing toggle ↓

Pasquale Vitiello

@pacovitiello13K followers

Visit on X
1,504 likesDownloadOriginal post

109,333 views

How to transform a shadcn switch into a pricing toggle ↓

8 Comments

Comments from the original post on X (Twitter)

  • Pasquale Vitiello's profile picture

    @pacovitiello

    Things got a bit lively on this one 😀 @yann_birba, you’re right—using a switch probably wasn’t the best call for a pricing toggle, especially since switches typically show two states of the same thing (like “Lights On/Off”) rather than two distinct options. Thank you all for your feedback; I appreciate your input 👍

    10 likes

  • Yann Birba - 🦋 @yannbirba.fr's profile picture

    @yann_birba

    @shadcn For accessibility concerns. I think it's simple radio inputs. Not a switch. Switch must be used to toggle something not choose between 2 values.

    28 likes

  • LioRael's profile picture

    @lio_rael

    @shadcn why not tabs?

    20 likes

  • Fabrizio Calderan's profile picture

    @fcalderan

    @shadcn A no-tailwind and more accessible version with radioboxes

    7 likes

  • Soham Dasgupta 🇮🇳⚽'s profile picture

    @thesobercoder

    @shadcn After watching this, I can confidently say that I don't know how to use Tailwind! 🤷‍♂️

    6 likes

  • Sergiu 🤖 AI Directories's profile picture

    @s_chiriac

    @shadcn I wish I could code like this. I’m more like… Cursor, now I want the button on the left. 😂

    4 likes

  • Mike Majara's profile picture

    @mikemajara

    @shadcn Cool stuff!! It's actually been a while since I see a human coding. Looks vintage

    3 likes

  • alex's profile picture

    @alexwohlbruck

    @shadcn this is neat but don't do this

    3 likes