Floating Labels with Tailwind CSS

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 152

  • @himanshusrivastava931
    @himanshusrivastava931 3 роки тому +107

    Whenever a new video comes from this channel, first I 'like' the video then I watch it. 😁

    • @themsaid
      @themsaid 3 роки тому +4

      Simon is GOAT

    • @dotkeyz
      @dotkeyz 3 роки тому +1

      Just did now 😁

    • @MrSonicastra
      @MrSonicastra 3 роки тому +1

      Haha i do the same :)

    • @KunalGulati7
      @KunalGulati7 3 роки тому +1

      Hi Himanshu, would like to connect with you on call for some tailwind theme creation if interested let me know.

    • @iamfaizanarif
      @iamfaizanarif 3 роки тому +1

      Same 2 u

  • @rfmiotto
    @rfmiotto 3 роки тому +40

    Again, one more awesome material by Tailwind Labs!
    You are a game changer for web developers. I also learned CSS a lot from you.

  • @igdev6095
    @igdev6095 3 роки тому +21

    You guys can add "select-none" and "pointer-events-none" for best experience!

    • @87whateva
      @87whateva 2 роки тому +1

      Thank you very much. That was the missing piece for a great UX!

  • @jeffnikelson5824
    @jeffnikelson5824 2 роки тому

    you're a magician man
    just found out about tailwind and every day I'm more and more convinced
    thank you so much

  • @mc-ty4br
    @mc-ty4br 3 роки тому +2

    Without those screencasts, I'd only know about the basics of tailwindcss. Thank you!

  • @ApoorvMote
    @ApoorvMote 3 роки тому +8

    I have about 20 forms on my site. This is going to dramatically change everything. Thanks Tailwind.

  • @flanger001
    @flanger001 2 роки тому +6

    You entirely changed my mind on this pattern. I hated this when I first saw it because it was always implemented some buggy JS that interfered with password managers. But a pure CSS implementation? Absolute genius. Thank you 💜

  • @AndresMarquezOk
    @AndresMarquezOk 2 роки тому

    The best effect is 7:14 "pru".. Great video! Thanks!!!

  • @swyxTV
    @swyxTV 3 роки тому +4

    Simon you’re crushing it. Love the demo and the editing and the music!

    • @simonswiss
      @simonswiss 3 роки тому +1

      Thanks! 🙏 Yeah I am slowly getting the hang of it all 🎉

  • @isaaccloos1084
    @isaaccloos1084 3 роки тому +9

    Yooo, that shot at the end was great 👍🏻

    • @simonswiss
      @simonswiss 3 роки тому

      My son just read that! ✨ Thank you 🙏

  • @Laratips
    @Laratips 3 роки тому +1

    Mind blowing. Doing this only with css is just amazing.

  • @BharatKumarDhaker
    @BharatKumarDhaker 3 роки тому +1

    Cool tips, I was looking this for days, -- One thing left in there I think, -- cursor ---> label in text area cause issue to override the cursor-text -- so the solution is --> label default & peer-focus 'cursor-default' and in peer-placeholder-shown it should be cursor-text

  • @Yaxqb
    @Yaxqb 3 роки тому +6

    This is insane and i would never in my life want to implement this in raw css
    Bravo!!!

  • @andreich1980
    @andreich1980 3 роки тому +4

    Great stuff! I did this just the other day. Some more of UX improvements: add this classes to labels `pointer-text pointer-events-none`.

  • @sharvinpingulkar3844
    @sharvinpingulkar3844 Рік тому

    Thank you! You solved my issue and changed my thought process on how to approach this kind of issue. Keep smashing!

  • @RyanRampersad
    @RyanRampersad 3 роки тому +3

    This is really great. Thanks for making a video on it. The pattern is popular and while I think it looks funny and actually more confusing, I understand why people like it!

  • @pagarevijayy
    @pagarevijayy 3 роки тому +1

    I thought the end of the video will be like.. now tailwind takes care of all of this in our forms plugin lol. Nice video btw!

  • @ShezanKazi
    @ShezanKazi 2 місяці тому

    Love the simplicity. ❤

  • @telegramvideos1313
    @telegramvideos1313 3 роки тому

    I'm commited to learn new tailwind trick every day, this is the trick for today.. Thanks !

  • @shafu_xyz
    @shafu_xyz 3 роки тому +1

    JIT has made tailwindcss even better!

  • @io_inc
    @io_inc 7 місяців тому

    I like this, simple and minimalistic

  • @mamtaagarwal1009
    @mamtaagarwal1009 3 роки тому +1

    Tailwind is just getting better. Let's go

  • @adamtak3128
    @adamtak3128 3 роки тому +3

    This is my favorite approach to handling labels and inputs. I'm so happy I don't have to write custom css for it anymore.

  • @modprog
    @modprog 3 роки тому

    you can also use a space in the placeholder IIRC

  • @mbparvezme
    @mbparvezme 3 роки тому +1

    Awesome design by an awesome tool. A suggestion for a little improvement in the terms of UX. Class "cursor-text" for the label would be really good to make a fluent UX feel.

  • @MrSonicastra
    @MrSonicastra 3 роки тому

    Cool Simon, i was looking today for that on UA-cam! I'm glad i found it 😁. Lifesaver, thumps up.

  • @ayazsheikh6827
    @ayazsheikh6827 3 роки тому

    Hope you have recovered from ribs injury.. tha ks for your beautiful work

    • @simonswiss
      @simonswiss 3 роки тому +1

      Not quite yet - but this video was recorded just before the accident!

    • @ayazsheikh6827
      @ayazsheikh6827 3 роки тому +1

      @@simonswiss wish you speedy recovery!

  • @AntNZ
    @AntNZ 3 роки тому +1

    I'm sooooo using this - i had no idea this was possible with css\tailwind. Mind = blown.

  • @ShaharHarshuv
    @ShaharHarshuv Рік тому +1

    Amazing!

  • @notfadeaway6617
    @notfadeaway6617 Рік тому

    i like these small detail tricks

  • @MOGE_
    @MOGE_ 11 місяців тому

    naaaaaaah I thought i knew tailwind before watching this video. I could literally feel my proverbial tailwind skill bar go up as I watched this.

  • @EkySambora
    @EkySambora 2 роки тому

    Great tutorial

  • @alfredomontoya4087
    @alfredomontoya4087 2 роки тому

    Excellent work and explanation, thank you very much for everything.

  • @jimmyj.6792
    @jimmyj.6792 3 роки тому +1

    Holy crap this awesome tip 😍 thanks a lot 😀😀 accessibility power 💪

  • @joyontokarmakar5765
    @joyontokarmakar5765 2 роки тому +1

    What is the name of your PREVIEW extension??

  • @daretobedangerous6552
    @daretobedangerous6552 2 роки тому

    your tutorials are amazing! cheers mate

  • @hcsftw
    @hcsftw 3 роки тому +1

    Hi Simon, instead of absolute you could have used flex on the div and order on the input and label to fix this.

  • @beni0208tube
    @beni0208tube 3 роки тому +2

    For the label => "pointer-events-none"

  • @hariniran6360
    @hariniran6360 2 роки тому +1

    So I have a silent problem where I can't type if I click directly on the peer-placeholder, please help. If I can anywhere else in the input field and it's fine !

  • @ObviouslyProgrammer
    @ObviouslyProgrammer Рік тому

    Thank you this is so nice!

  • @cristianpallares7565
    @cristianpallares7565 3 роки тому

    Nice! Thanks for the video. Learned something new

  • @JoshKLPA
    @JoshKLPA 2 місяці тому

    Great video! I don't know how to feel about the property names being in cursive.

  • @talgatsaribayev821
    @talgatsaribayev821 3 роки тому +15

    why not use display: flex and change order? Other than that thanks. It is always amazing.

    • @ashutoshanand4263
      @ashutoshanand4263 3 роки тому

      Had the same thought

    • @rfmiotto
      @rfmiotto 3 роки тому +1

      If you ask about the parent div that wraps the input and label tags having a flex col-reverse attribute, I don't think it would fix the problem. This is because the peer will still be listening to the previous sibling in the DOM (that is, in the HTML structure and not necessarily the component you see in the screen).

  • @ed1nh0
    @ed1nh0 3 роки тому

    Wondering if there some attr or prop, or even a behavior I could not use a class for it!

  • @breezycodes
    @breezycodes 2 роки тому +2

    How do you get your classes to stay on different lines?

    • @MOGE_
      @MOGE_ 11 місяців тому

      press enter

  • @khaledelhoushi8834
    @khaledelhoushi8834 Рік тому

    In 4:14c you were typing "class="absolute left-0 -top-3.5(grey image)text-gray-600 text-sm"". Does this code act like CSS or is it the code in the CSS portion or file affecting the webpage?

  • @alitonoliveira1700
    @alitonoliveira1700 Рік тому

    How to make the label go up as soon as I click on the input? The way you showed it only goes up when I start typing.

  • @deephousefridays1911
    @deephousefridays1911 3 роки тому

    I wish I could add more than one like! Awesome videos!

  • @osman3404
    @osman3404 3 роки тому

    Omg that’s awesome but i wish that was the default of placeholders to Begin with

  • @harvanchik
    @harvanchik 3 роки тому

    Incredible! Thanks so much!

  • @ayobamijimoh4953
    @ayobamijimoh4953 2 роки тому

    awesome, thank you

  • @mnikk1
    @mnikk1 2 роки тому

    Instead of -top-3.5 u can make parent 'flex flex-col-revese' or use order class for positioning

  • @mass-im
    @mass-im Рік тому

    Great content as always! Tnx!!!
    Is it possible to move the styles into an @layer @apply directive?

  • @DongQian
    @DongQian 3 роки тому +3

    I hope tailwindcss can write multiple classes to one pseudo-classes. For example hover:[text-red-500, bg-white, ...] instead of repeat `hover:` again and again, it makes the class name list way too long. I think there are libraries that help with this, but I would like to see it as build-in support. Thanks

    • @thomasfindlay2034
      @thomasfindlay2034 3 роки тому

      I asked Adam about it recently, but unfortunately, he said that it's not going to be added.

  • @mdekramulhassanavi1819
    @mdekramulhassanavi1819 2 роки тому

    Thank you it's help me a lot.

  • @jamesgrubb
    @jamesgrubb 3 роки тому

    Thanks great information. I had to add a class for when the form is actually filled in ' .label:not(:empty) {
    @apply -top-5;
    }'

  • @vigneshwaranrenganathan7743

    great work, is it possible to bring same effect using and ?

  • @amirnoorani5017
    @amirnoorani5017 3 роки тому

    Best tuts from you

  • @Sabutofons
    @Sabutofons 3 роки тому

    I am using vscode prettier extension but it doesn't format my tailwind classes to use multiline like it did for Simon. Am I missing any settings?

  • @AndreNitschke
    @AndreNitschke 2 роки тому +1

    Nice Workflow, but is this with the label after input not a problem for screen-readers?

    • @AndreNitschke
      @AndreNitschke 2 роки тому

      aria-labelledby in input field with id from label - should solve this problem. Nice

  • @aislanarislou
    @aislanarislou 3 роки тому

    Now a video teaching how to make a ripple effect into buttons : )

  • @Sashankyt
    @Sashankyt 3 роки тому

    I am not getting the peer-placeholder selector in the tailwind docs. It is sometimes hard to know what is available and what not.

  • @merictunc
    @merictunc 3 місяці тому

    thank you!

  • @PixelRubble
    @PixelRubble 2 роки тому +1

    Fantastic trick for text boxes. Do you have a similar trick for drop downs in order to keep page styling similar?

  • @girishnashipudi6933
    @girishnashipudi6933 3 роки тому

    Awesome! Thank you.

  • @SusanthCom
    @SusanthCom 2 роки тому

    Awsome Video

  • @Nate-gi7no
    @Nate-gi7no 2 роки тому

    anyone have a problem with not being able to click through the labels to focus the input? am i doing something wrong?

  • @nick97000
    @nick97000 3 роки тому +1

    Lovely video and definitely going to implement this solution. How would you handle autocomplete? When I hover over an autocomplete option, the labels and the filled in values appear on top of each other!

  • @mohakmaheshwari8756
    @mohakmaheshwari8756 3 роки тому

    Peer class is not working anymore plz help.

  • @mryechkin
    @mryechkin 3 роки тому

    That is DOPE! 🤯

  • @kumardeepam
    @kumardeepam Рік тому

    this is so sleek

  • @nyambe
    @nyambe 3 роки тому

    wooo 😘, will be using it

  • @CARUSAR21
    @CARUSAR21 3 роки тому

    Just amazing

  • @kukasn
    @kukasn Рік тому

    What of select input anyone help me with that

  • @ahmadabuaysheh
    @ahmadabuaysheh 3 роки тому

    is this available in the documentation?? I tried to search for it but couldn't find it.

  • @FrederickROS
    @FrederickROS 3 роки тому

    Super good content as usual. I hope your ribs are going to cure soon!

  • @samueljagestedt6479
    @samueljagestedt6479 7 місяців тому

    seems like a ux problem that the user can't click the placeholder to focus the input.

  • @__su_man
    @__su_man 3 роки тому

    Can anyone tell me, which font is this?

  • @xidnebwoz
    @xidnebwoz 2 роки тому

    Awesome!

  • @it-s-me-mohit
    @it-s-me-mohit 3 роки тому

    Awesome 👍👍👍

  • @thanossmponias2915
    @thanossmponias2915 3 роки тому

    just amazing . . . .

  • @AmxCsifier
    @AmxCsifier 3 роки тому

    Is there a way to regroup the variant classes?

  • @mansourahmed3841
    @mansourahmed3841 3 роки тому

    VS Code Auto-Complete Tailwindcas not working

  • @iamsiddd007
    @iamsiddd007 3 роки тому

    When I click label it doesn't work. Is that supposed to happen or did I do something wrong. If anyone knows please let me know.

  • @Zoutzuurtjes
    @Zoutzuurtjes 3 роки тому

    What theme are you using?

  • @DanielDrummond2k6
    @DanielDrummond2k6 3 роки тому

    Do you intend to create courses on Tailwind 3.0 or do you already have one?

  • @GustavAgar
    @GustavAgar 3 роки тому

    excellent 🙌 make more videos please

  • @HassanHajX
    @HassanHajX 3 роки тому +1

    How did you do the wavy red lines ? Is it possible to do that with just tailwind ?

  • @codephilip
    @codephilip 3 роки тому

    Awesome 😎

  • @Habesha_Today
    @Habesha_Today Рік тому

    your vscode font?

  • @lucasj.pereira4912
    @lucasj.pereira4912 3 роки тому

    Does it work in any browser or only recent versions? Asking because some css options does not work in older browsers

  • @mohamedyoussef8835
    @mohamedyoussef8835 Рік тому

    Awesome video +++++++++++++++ 🙂

  • @tiagotheoliveira
    @tiagotheoliveira 3 роки тому

    Always incredible videos and content 👏🏼

  • @NeerajKumar-mm4rl
    @NeerajKumar-mm4rl 3 роки тому

    Simon, which font family you are using in code editor. Subscribed 😀

  • @devatrii
    @devatrii 2 місяці тому

    Cool

  • @LRXAORLOV
    @LRXAORLOV 3 роки тому

    This is very cool) how can I improve accessibility for such a solution ?

  • @sebsobseb
    @sebsobseb 3 роки тому

    In terms of accessibility, does it matter to have the label after the input?

    • @flanger001
      @flanger001 2 роки тому

      So long as the "for" attribute is set correctly it will still be accessible!

  • @EdzonmxDev
    @EdzonmxDev Рік тому

    Hello, Please How are you ?
    Please i can have the name of your VS Code Font...

  • @gamingklex9010
    @gamingklex9010 3 роки тому

    Are you always making these small templates before the video, or where are you getting these?

  • @nuotsu
    @nuotsu 3 роки тому

    great approach to floating labels, but i hate how much bloat tailwind adds