Building a command palette with Tailwind CSS, React, and Headless UI

  Рет қаралды 68,590

Tailwind Labs

Tailwind Labs

Күн бұрын

Пікірлер: 170
@amirreza-dev
@amirreza-dev 2 жыл бұрын
There are some programmers in the world who makes programming much lovely, sweet and enjoyable You my sir are one of those people Thank you so much
@zyishai
@zyishai 2 жыл бұрын
Agree 100%!!!!
@simonswiss
@simonswiss 2 жыл бұрын
Awwwwe thank you so much 🙏
@nemethricsi
@nemethricsi 2 жыл бұрын
@@simonswiss I wanna echo these compliments. Really awesome tutorial! Can I ask what font are you using in your editor? 🙈 Thank you Simon
@simonswiss
@simonswiss 2 жыл бұрын
@@nemethricsi Thank you so much! The font is called Dank Mono.
@nemethricsi
@nemethricsi 2 жыл бұрын
@@simonswiss OMG I’m using the same font that’s why it was familiar 😂 But looked even more better in the video. Maybe less font-weight :) Tailwind is awesome! I’m just starting getting familiar with it.
@soviut303
@soviut303 2 жыл бұрын
I especially like how you've shown some of the traps (window location vs router, resetting search too early, etc.) and how to avoid them.
@simonswiss
@simonswiss 2 жыл бұрын
Thanks! Yeah, they let you appreciate the subtle details even more, things you'd take for granted 👍
@soviut303
@soviut303 2 жыл бұрын
@June@97 You should post this as a top level comment. Also, you'll have to specify which font you mean; the one on the web page or the one in the text editor?
@eyalch
@eyalch 2 жыл бұрын
Small suggestion: In the useEffect's dependencies array you're providing isOpen, which is required because isOpen is indeed being used inside the callback (to get an opposite value). This causes the keydown event listener to be re-created every time the command palette is opened and closed. A nice and easy solution to this is instead of passing the new value directly to setIsOpen we can pass a callback which accepts the current value and returns a new one, then we can remove isOpen from the dependencies array. Thank you for producing such high quality content!
@simonswiss
@simonswiss 2 жыл бұрын
That's a great tip, thank you!
@xadden
@xadden 2 жыл бұрын
Code wise, I believe Exo means instead of using setIsOpen(!isOpen), use setIsOpen(value => !value)
@eyalch
@eyalch 2 жыл бұрын
@@xadden Exactly!
@som.shekhar
@som.shekhar 2 жыл бұрын
Firstly, I don't think so recreating the function has any significant performance impact at all. Secondly, even if you pass a callback to `setIsOpen` you would now be recreating the callback function `(isOpen) => !isOpen` on every toggle -- which is a little less obvious, but true. So, essentially you're swapping in creation of one function for the other. Let me know your thoughts on this.
@eyalch
@eyalch 2 жыл бұрын
@@som.shekhar It's not only the function that gets re-created, but the event listener itself (together with the handler function)
@BarisPalabiyik
@BarisPalabiyik 2 жыл бұрын
Can't believe I just watch the whole thing, even tho I knew most of the things in it. That's says a lot about the pace and presentation.
@simonswiss
@simonswiss 2 жыл бұрын
Thank you so much! Yeah I really try to respect everyone's time, even in longer form video like this one.
@YazinS
@YazinS 2 жыл бұрын
The difference with Tailwind videos is obvious. These guys aren't just building cool stuff.. they're having fun! Love these videos
@iamnwanguma
@iamnwanguma 2 жыл бұрын
Tailwind makes frontend and styling beautiful for me
@Syndeer
@Syndeer 2 жыл бұрын
@@iamnwanguma Yeah I absolutely agree with you Tailwind css is so much fun and easier
@fabhi
@fabhi 2 жыл бұрын
CSS instructors are the most fun to watch!
@hazemturki
@hazemturki 2 жыл бұрын
Lost my mind trying to get a combobox to work using listbox, so glad to this happened. I coincidentally landed on headless ui home page. And saw it, and that made me so happy. Thanks for all the work!
@hot4mix
@hot4mix 2 жыл бұрын
Genuinly impressive flow. i will watch you code anything. literally anything xD
@simonswiss
@simonswiss 2 жыл бұрын
Thank you!
@JimOHalloran
@JimOHalloran 2 жыл бұрын
Wow, that was a ride! I built a select box with a search field on the drop down (Vue + Headless UI) a while ago, but I was never 100% happy with it. I think it's time to rebuild using the new combo box components!
@simonswiss
@simonswiss 2 жыл бұрын
Haha nice, let us know how you go!
@somerandomchannel382
@somerandomchannel382 2 жыл бұрын
Another great design idea of a ComboBox is ofcourse Tailwind's Search in Documentation . It's really flexible and handy to find any classes you want know the tailwind prefix for :)
@juraso7312
@juraso7312 2 жыл бұрын
tailwindcss search in documentation is build with algolia not combobox, search on tailwindui documentation is build with combobox
@gomflo
@gomflo 2 жыл бұрын
Really amazing work, the subtle details, the production, how you explain, very well done.
@simonswiss
@simonswiss 2 жыл бұрын
Thank you! It really is a team effort 👍
@sumitsharma_002
@sumitsharma_002 2 жыл бұрын
Thank you it was really informative. @headlessui is such a cool library component to have in your projects.
@code.design
@code.design Жыл бұрын
this tutorial is something else. I came for tailwind and learned as a bonus about nextjs. Awesome stuff!
@nguimeyabill-gates2577
@nguimeyabill-gates2577 2 жыл бұрын
I was actually stuck implementing a search component, he just answered my questions. Thanks a lot!
@liferc
@liferc Жыл бұрын
Damn man! This is way too good. Please make video with other headless components it would be a lot better learning from you
@dingen636
@dingen636 2 жыл бұрын
Top quality video as always! I know Tailwind is ment for implementation with JS frameworks but would be amazing to have documentation on how to use Tailwind in a Wordpress theme. Thanks for all the hard work!
@dexter-wy5bo
@dexter-wy5bo 2 жыл бұрын
This video should give you everything you need for that. It's possible and not hard at all, the only difference is you have to build/compile your tailwind css before pushing to the site, packaging the theme, etc... kzbin.info/www/bejne/pXiZiYOvZtlkgaM
@lukasmolcic5143
@lukasmolcic5143 2 жыл бұрын
If you are building a custom theme from scratch I would recommend setting up twig or some other templating language so that you can build components, working with tailwind without components is not that great, I used to use the timber plugin to achieve that, but these days we are usually going for headless wp + next for cms based websites.
@simonswiss
@simonswiss 2 жыл бұрын
Tailwind is definitely not limited or meant purely for implementation with JS frameworks! You could argue in fact that since it generates "just CSS", it works really well with WordPress, .NET, anything really. Headless UI, on the other hand, is definitely a JS framework implementation.
@AliMoeeny
@AliMoeeny 2 жыл бұрын
Isn't this just pure gold, thank you very much.
@alirezakiani1222
@alirezakiani1222 2 жыл бұрын
It was great. I always use your tutorials. Thank you for being
@StayFlyJW
@StayFlyJW 2 жыл бұрын
You, sir, are a dev that I need to learn under. Your design and teaching style is wonderful. Also, we need workflow… gotta replace ClickUp pronto.
@NamasteProgramming
@NamasteProgramming 2 жыл бұрын
This tutorial so good, I didn't even notice light theme IDE
@Billiam112
@Billiam112 2 жыл бұрын
Fantastic content! More in headless ui would be highly appreciated! ❤️
@robotyang8501
@robotyang8501 2 жыл бұрын
love headless UI from now on.
@josegmdev
@josegmdev 2 жыл бұрын
Amazing video as always! you do an awesome job with this channel 🙌🏼
@simonswiss
@simonswiss 2 жыл бұрын
🙏
@aghileslounis
@aghileslounis 2 жыл бұрын
Amazing video as always, so inspiring to do great work
@octavian0704
@octavian0704 2 жыл бұрын
Amazing mate !!! really well done and nicely explained. Thanks for sharing.
@amankumarverma8494
@amankumarverma8494 10 ай бұрын
So good 💯
@universecode1101
@universecode1101 2 жыл бұрын
Awesome man 🚀 These three together 🔥 Tailwind is a game changer, thanks ✌🏻
@stephan3199
@stephan3199 2 жыл бұрын
Thanks so much! You really inspire me to be as good as you in the future
@esdev
@esdev 2 жыл бұрын
Simon, You're just Aweeeeesome 🤩🥰
@sergeitinc
@sergeitinc 2 жыл бұрын
It's just some gift for us. Thank you so much.
@danvilela
@danvilela Жыл бұрын
I wanna like this video a thousand times!!
@simonswiss
@simonswiss Жыл бұрын
One time will do - I appreciate the support!
@GrahamBillington
@GrahamBillington 2 жыл бұрын
These videos are awesome, they help with learning react too
@hudson_w
@hudson_w 2 жыл бұрын
You're amazing. This is so cool. Keep having fun and inspiring others
@eminalizade8998
@eminalizade8998 2 жыл бұрын
Loving TailwindCSS, keep up the good work! 😍
@adityakadam2256
@adityakadam2256 2 жыл бұрын
It is such an amazing video. It makes me try it out by myself. Thanks a ton.
@irsyadadl
@irsyadadl 2 жыл бұрын
Nice & Thank you Simon.
@endernator
@endernator 2 жыл бұрын
soooo goooooooodddd.... please more ui with nextjs and headlessui.... it is a match made in heaven by the nerd gods 😇🤓
@__sr__
@__sr__ 2 жыл бұрын
Excellent video as always.
@s4ndeep1203
@s4ndeep1203 2 жыл бұрын
That didn't feel like 38 minutes ! loved it
@MasterPloKoon
@MasterPloKoon 2 жыл бұрын
Would love to see a Vue tutorial next time when using Headless UI (:
@catreunion
@catreunion 2 жыл бұрын
Thank you Simon!
@Pixalynx
@Pixalynx 2 жыл бұрын
I would buy a react course from you !
@dexter-wy5bo
@dexter-wy5bo 2 жыл бұрын
excellent video, as always !
@vOnez212
@vOnez212 2 жыл бұрын
Great stuff!
@jasonhoi85
@jasonhoi85 2 жыл бұрын
Great tutorial, i will use the same toolbox to make my command panel
@codingwithtien
@codingwithtien 2 жыл бұрын
Super useful tutorial.
@hiimaustin
@hiimaustin 2 жыл бұрын
I don’t know that you will see my comment or not but that you so much😍❤️ This is help me a lot🙏🏻❤️
@simonswiss
@simonswiss Жыл бұрын
I see your comment today! Glad you enjoyed, the video, Austin 🙏
@hiimaustin
@hiimaustin Жыл бұрын
@@simonswiss yess man! I love it
@tofustew
@tofustew 2 жыл бұрын
Another suggestion - omit the `text-sm` classname on the input field to avoid auto-zoom for iPhone users (Android, too, maybe?). Mobile Safari zooms in on input fields with text smaller than 16 px (and `text-sm` produces 14px text). Anyway, awesome video!
@trenom
@trenom 2 жыл бұрын
good stuff learned so much from this video xD
@sargeantscigar
@sargeantscigar Жыл бұрын
Fantastic video, learned a lot! How can I implement your 🤙 terminal? It’s great!
@jasonji1152
@jasonji1152 2 жыл бұрын
Can someone explain why `relative` fixed the stacking issue at 7:25? Thx
@simonswiss
@simonswiss 2 жыл бұрын
There are many CSS classes that create a new "stacking context", which is necessary here to stack the modal window above the "fixed" element. position:relative happens to be one of those. Super confusing for sure, but here's a good read: developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
@simonswiss
@simonswiss 2 жыл бұрын
Arguably I could/should have used the "isolate" utility class here - since its intent it to create a new stacking context. But that also confuses a lot of folks 😅
@endernator
@endernator 2 жыл бұрын
mindblowingly good 🤯👏🏼
@WidianDAlbie
@WidianDAlbie 2 жыл бұрын
Thank you sir for amazing video
@davidluhr
@davidluhr 2 жыл бұрын
Another great guide Simon! Small suggestion: the combobox option markup can be a NextJS `` component with an `` tag for native navigation instead of `useRouter`. If I'm not mistaken, this will also take care of closing the Dialog on a route change.
@simonswiss
@simonswiss 2 жыл бұрын
Ah, nice one! I think it was still good to show the "onChange" prop on the Combobox component for general purposes, but for this specific scenario your solution sounds pretty elegant if it indeed closes the Dialog in the route change process 👍
@amanueltigistu8268
@amanueltigistu8268 2 жыл бұрын
What a great way of Building UI. Headless UI is really fantastic. But the framework support is limited to react & vue. There are really good framework like solid-js & svelte. Is there anything work to make Headless UI available for framework other than vue & react? One thing that I recommend is to make the core package separated from the framework implementations. In these way we can make Headless UI available for all of Us. Thanks.
@jameswong3388
@jameswong3388 2 жыл бұрын
Hi anyone know how to do the navigation on vuejs3, tried @change="window.location.href..." but doesn't work
@InfinityFnatic
@InfinityFnatic 2 жыл бұрын
What is the cursive font and how to set it up? Thank you!
@craftsmanhafeez
@craftsmanhafeez 2 жыл бұрын
does the combobox.button component mentioned in the headless ui docs have any special functionality. Can i wrap the combobox.input and combobox.button components in a form tag and use it like a normal searchbox for an ecommerce site with the combobox.options component giving the user search suggestions as he types?
@pkgoncalves
@pkgoncalves 2 жыл бұрын
Nice work!
@webdev1943
@webdev1943 2 жыл бұрын
nice way to explain , thank you
@yagorodi
@yagorodi Жыл бұрын
Amazing 👏
@matheuscabral4402
@matheuscabral4402 2 жыл бұрын
Great video!!! Any idea on how to prefetch on option selection?
@Ms37maracaibo
@Ms37maracaibo Жыл бұрын
Awesome! Could you make a command pallette using Nuxt 3 Tailwind and latest Headless UI ? Thanks !!!
@abacuswithrehan264
@abacuswithrehan264 2 жыл бұрын
Hello Loved the video. Can you share your current video font , theme and vscode settings please don't ignore, please 🙏
@AndersonSousa33
@AndersonSousa33 2 жыл бұрын
What a video!
@perfect.stealth
@perfect.stealth 6 ай бұрын
I can fall asleep to this
@marbot9780
@marbot9780 2 жыл бұрын
Good Morning - thank you for the great video! Where can I download the Start and End environments? Greetings Markus
@vilijanmonev896
@vilijanmonev896 2 жыл бұрын
Great video as always! Thank you very much, your skills are impressive. I have one question, in the Combox.Input I believe it is a common practice to perform the filter once the user has stopped typing or some amount of milliseconds has passed in order not to create computational overheat. Is there is a way to achieve something like this?
@chbb9027
@chbb9027 2 жыл бұрын
What is that font in VSCode?
@praveenprasad9477
@praveenprasad9477 2 жыл бұрын
Anyone know which app this "workflow"??
@robrechtmeersman8301
@robrechtmeersman8301 2 жыл бұрын
You'll want to stop propagation on your keydown event, because Ctrl+K is a reserved shortcut in Chrome on Windows.
@axelv21
@axelv21 2 жыл бұрын
wow, instant rebuilding my autocomplete with this! Goodby downshift.
@adarshdesai3081
@adarshdesai3081 10 ай бұрын
could you guys share the source code got the project management app?
@austintoddj
@austintoddj 2 жыл бұрын
Love the video. Having a tough time translating the “custom keyboard shortcut” to a Vue app. Do you have any examples or links that might offer some insight into the specific keyboard event handling?
@kashnigahbaruda
@kashnigahbaruda 2 жыл бұрын
MORE PLEASE
@VinceKronlein
@VinceKronlein 2 жыл бұрын
This is so great, thanks Simon. I know it's a long shot, but any chance we can get a tutorial of this in Vue without Headless UI? My clients are not yet using Vue 3 so we're not able to use Headless UI yet. Either way, thanks for the great video.
@QuangAkita
@QuangAkita 2 жыл бұрын
Could you please let me know font for code editor in this video!
@tuscala
@tuscala 2 жыл бұрын
What is your VS Code theme? It's beautiful
@clemensheithecker
@clemensheithecker 2 жыл бұрын
Thanks for the great video Simon! What theme and font are you using? It makes it easy to read and follow your code.
@simonswiss
@simonswiss 2 жыл бұрын
I usually use Night Owl + Dank Mono. This one uses Night Owl *Light* + Dank Mono ✨
@kevingrondin974
@kevingrondin974 2 жыл бұрын
Thanks it’s very cool 👍
@msnxcrj
@msnxcrj Жыл бұрын
I would like to know the vs code font he is using. I really love those!
@msnxcrj
@msnxcrj Жыл бұрын
I figured it out, its "dank mono font"
@simonswiss
@simonswiss Жыл бұрын
That's the one!@@msnxcrj
@vojica6055
@vojica6055 2 жыл бұрын
Can someone help me, how to config file if my design is like this: i need on large desktop 1920px 1080 a container which is 1440grid width, can you help me how to edit that container is 1440 width and not 1526px (2xl) thanks a lot :)
@kashnigahbaruda
@kashnigahbaruda 2 жыл бұрын
Add multiple prop to SelectHeadlessUI component please!
@yazugaming5573
@yazugaming5573 2 жыл бұрын
which font of your IDE use?
@rafaeljuniorize
@rafaeljuniorize 2 жыл бұрын
🤩🥺 Beautiful
@abdiafrah4907
@abdiafrah4907 2 жыл бұрын
Great content!!!! But one question, who uses white theme on code editor looool
@simonswiss
@simonswiss 2 жыл бұрын
I do, sometimes 😅
@milon27
@milon27 2 жыл бұрын
please create a headless ui playlist
@panomojame6279
@panomojame6279 2 жыл бұрын
What is wrong with your non-italics lowercase F?!
@DanStroot
@DanStroot 2 жыл бұрын
In desktop Safari, if I use command+k to open and close the search bar the screen scrolls to the bottom after I close the modal. Doesn't happen in Chrome or Firefox. Anyone seeing this? Any ideas?
@DanStroot
@DanStroot 2 жыл бұрын
Dialog model works fine, no issues. Put a Combobox in the model, no problem. The Combobox.Input seems to be the culprit. If that is inside the modal and you close with keyboard the page scrolls to the bottom on Safari. If I comment the Input out the page does not scroll.
@DanStroot
@DanStroot 2 жыл бұрын
import { useState, useEffect } from 'react'; import { Dialog, Combobox } from '@headlessui/react'; export function Test() { let [isOpen, setIsOpen] = useState(false); /* Handle Keyboard Input */ useEffect(() => { function handleKeyDown(event) { event.preventDefault(); event.stopPropagation(); /* e key for error - ha! */ if (event.key === 'e' && (event.ctrlKey || event.metaKey)) { setIsOpen((value) => !value); } } window.addEventListener('keydown', handleKeyDown); return () => { window.removeEventListener('keydown', handleKeyDown); }; }, []); /* minimal code to reproduce the issue */ return ( setIsOpen(false)} className='fixed top-0 z-10'> Hello {/* comment this out to see it work properly */} ); }
@bassman2145
@bassman2145 Жыл бұрын
Does anyone know what font is being used in the code editor?
@simonswiss
@simonswiss Жыл бұрын
I rock with Dank Mono in this video 👍
@SaeedNeamati
@SaeedNeamati 2 жыл бұрын
first liked, then watched
@AlonGvili
@AlonGvili 2 жыл бұрын
I really like your code flow, feel good, btw can you show some demos using Remix.run framework instead of NEXT ?;
@simonswiss
@simonswiss 2 жыл бұрын
Haha this is definitely something I want to do and will do 💫
@joshuagalit6936
@joshuagalit6936 2 жыл бұрын
The best !!
@jimmyj.6792
@jimmyj.6792 2 жыл бұрын
Tailwind world 😍😍😍😍 💕💕
@imsarvesh_
@imsarvesh_ 2 жыл бұрын
I am speechless 😶
@simonswiss
@simonswiss 2 жыл бұрын
Lucky you can use the command palette to do a search instead of talking to Siri/Google/Alexa 🤣
@abobakerhilal4138
@abobakerhilal4138 2 жыл бұрын
What is type font it used in vscode? Its nice
@simonswiss
@simonswiss 2 жыл бұрын
Dank Mono
@LuisPerez-cb4rp
@LuisPerez-cb4rp 2 жыл бұрын
Thank you 🙏
@RomeoKhazalia
@RomeoKhazalia 2 жыл бұрын
Do similar thing with Vue pls.
@johnrothfield6126
@johnrothfield6126 2 жыл бұрын
What about non-react.js users? alpine, stimulus, etc?
@simonswiss
@simonswiss 2 жыл бұрын
So far, only Vue.js (v3)
@coledrain2158
@coledrain2158 2 жыл бұрын
Sadly we won't be seeing Simon here again 😞
@coledrain2158
@coledrain2158 2 жыл бұрын
@Aroyan He is no longer on Tailwind Lab team.
@AnsgarSteinkamp
@AnsgarSteinkamp 2 жыл бұрын
New videos of Simon: kzbin.info
Rebuilding Sick Fits with Tailwind CSS
1:13:16
Tailwind Labs
Рет қаралды 47 М.
Tailwind Connect 2023 - Keynote
1:37:11
Tailwind Labs
Рет қаралды 348 М.
Andro, ELMAN, TONI, MONA - Зари (Official Audio)
2:53
RAAVA MUSIC
Рет қаралды 8 МЛН
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Theming Tailwind with CSS Variables
27:24
Tailwind Labs
Рет қаралды 130 М.
What's new in Tailwind CSS v3.1?
33:20
Tailwind Labs
Рет қаралды 121 М.
TypeScript Crash Course
52:27
Traversy Media
Рет қаралды 622 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,3 МЛН
What's new in Tailwind CSS v3.0?
26:33
Tailwind Labs
Рет қаралды 183 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 105 М.
This UI Library is a GAME CHANGER! (Not Lying)
20:48
Harkirat Singh
Рет қаралды 275 М.