The Ultimate Button with React Aria! Build a React Component Library with Tailwind CSS & Next.js

  Рет қаралды 4,044

Build SaaS with Ethan

Build SaaS with Ethan

Күн бұрын

Пікірлер: 29
@mounis
@mounis Жыл бұрын
Adobe has also created a component library called React Aria Compoemmets. It’s still in beta I guess but you can achieve all of this with a lot less/clean code
@ethan_mick
@ethan_mick Жыл бұрын
Their library is excellent, but there's not harm in learning how it works and how to build your own components. Their documentation even states that you should drop to a lower level (the hooks) when you need to. This series isn't about just using another component library, it's about building your own.
@CommunityAllSeasons
@CommunityAllSeasons Жыл бұрын
Please do more videos on react-aria. A lot of people have focused on Radix but there's a surprisingly lack of content on react-aria. I think a series on building a component library would be amazing.
@ethan_mick
@ethan_mick Жыл бұрын
I agree! I like both libraries, but I'll make sure to do some more on React Aria.
@ronaldpaek
@ronaldpaek Жыл бұрын
I checked out the GitHub repo and looked at the the tailwind classes you used, how come you on primary you used data-[hovered] and on secondary you just used the normal hover: pseudo selector also was wondering if you need to actually have them all say [hover=true]? and if [hover] is okay? also do you know if it's hovered=true? cause i was inspecting the html and it seems like it's hovered, thank your content is so helpful!
@ethan_mick
@ethan_mick Жыл бұрын
Thanks for pointing this out! A few things: 1. I should have used the `data-[hovered=true]` over true for all of the selectors, that was an oversight. 2. Using `hovered=true` is more explicit, it'll only trigger when the state is set to `true`. With how I'm setting them their either true or non-existent, so it works out to be the same. But the `=true` is safer in case in the future it reads `hovered=false`. I've updated the code (github.com/ethanmick/button-advanced/commit/e92025a2d89c1cfb5b2567f9edf968cea236009e) in the latest commit so it should be consistent now.
@fujisan0388
@fujisan0388 Жыл бұрын
I am learning so much from your videos! Thank you.
@ethan_mick
@ethan_mick Жыл бұрын
Thank you! Thanks for watching another one :)
@asimalqasmi7316
@asimalqasmi7316 Жыл бұрын
I liked the tweeks and their effects Thanks a lot 🌹🌹
@ethan_mick
@ethan_mick Жыл бұрын
Thank you!
@madatbay
@madatbay Жыл бұрын
After 2 weeks, at last 😮
@ethan_mick
@ethan_mick Жыл бұрын
Haha, I promise I'll be better!
@oemeraran8183
@oemeraran8183 Ай бұрын
Did you try react-aria-components already? The setup is a lot simpler that way.
@ronaldpaek
@ronaldpaek Жыл бұрын
do you know where in the settings you need to change so that when you save the file it will apply prettier? currently it only works when i manually have i run the prettier write command
@ethan_mick
@ethan_mick Жыл бұрын
Make sure you have `"editor.formatOnSave": true,` in your VS Code configuration. Sometimes there are conflicting formatters, so you might also need: "[typescriptreact]": { "editor.codeActionsOnSave": { "source.organizeImports": true }, "editor.defaultFormatter": "esbenp.prettier-vscode" }, Change out the language as needed. Let me know if that helps! I use the prettier plugin with VS code.
@Showmatic
@Showmatic Жыл бұрын
react aria ❤
@ethan_mick
@ethan_mick Жыл бұрын
Literally the best ❤️❤️❤️
@StevenOrtiz-g5r
@StevenOrtiz-g5r Жыл бұрын
hello friend, do you have a tutorial on how to create a saaS from scratch with roles in Next.js
@ethan_mick
@ethan_mick Жыл бұрын
Hey, I don't have a full tutorial yet, but I'm moving in that direction. What sort of roles are you looking for?
@grif.n
@grif.n Жыл бұрын
When should we use a react aria hook? ie. should we use something like useFocus only if the component needs to do something specific on focus? Or do we always add all hooks to a new component for accessibility purposes anyway? Also - do they have examples or preferred methods of building a menu with menuitems and the accessibility/kbd navigation requirements that comes with that? Thanks :D
@ethan_mick
@ethan_mick Жыл бұрын
React Aria has a Menu hook and a Menu Component. Here's their example with keyboard navigation too: react-spectrum.adobe.com/react-aria/Menu.html#accessibility In general, I'd only add the hooks when your interactive component needs them. If it doesn't care about the focus state, you don't need to add that hook. That'll keep your code simpler in the long run too.
@athulgeorge4873
@athulgeorge4873 Жыл бұрын
Great video, however I had some trouble when using your button component with radix ui's modals. The focus classNames of the button are not working when the focus is trapped within the modals children. As in when I am in the modal and try to tab, the focus is not moving to the next element within the modal, however when using a normal button it works fine. Any idea why this may be the case?
@ethan_mick
@ethan_mick Жыл бұрын
I'm going to investigate this; stay tuned.
@athulgeorge4873
@athulgeorge4873 Жыл бұрын
@@ethan_mick Hi is there any updates on this, I have looked into it and it seems like using the focusProps from useFocusRing() is causing the problem, however I am not sure how to get around it, while still having the benefits of using useFocusRing().
@haack79
@haack79 Жыл бұрын
Could you pass icons into this button pretty easily, for instance when using next-auth and then making a google sign in button and using google image?
@ethan_mick
@ethan_mick Жыл бұрын
Yes you can! The takes any ReactNode as it's children so you could do Login with Google and it should work.
@haack79
@haack79 Жыл бұрын
@@ethan_mick Yes, thank you i figured it out, created a signin button that takes your super button and adds nextauth functionality to it! Pretty sweet !
@MrCone9
@MrCone9 Жыл бұрын
Shadcn ui > all
@ethan_mick
@ethan_mick Жыл бұрын
I like shadcn/ui a lot (I've used it in some videos), but I find the button to be pretty uninspired. It also doesn't handle any of the edge cases that React Aria handles well. Once you notice these bugs, you can't use anything else.
shadcn/ui - Theming Wrapped in a Tailwind Plugin/Preset
30:14
simonswiss
Рет қаралды 49 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 2,5 МЛН
Trick-or-Treating in a Rush. Part 2
00:37
Daniel LaBelle
Рет қаралды 45 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 97 МЛН
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 34 МЛН
Authoring Components with CVA + tailwindcss - Basic Buttons (1 / 4)
17:04
React Tips with Brooks Lybrand
Рет қаралды 3 М.
Set up Next-Auth with Next.js and Prisma with this ultimate guide!
42:45
Build SaaS with Ethan
Рет қаралды 56 М.
How to build a Recursive React Component
21:16
Sam Selikoff
Рет қаралды 52 М.
You’re doing dark mode wrong!
7:54
Coding in Public
Рет қаралды 54 М.
Build a contact form and send an email with React + Next.js (End-To-End!)
43:37
Build SaaS with Ethan
Рет қаралды 15 М.
Why You Should Use React Aria Components...
30:08
Jolly Coding
Рет қаралды 15 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 2,5 МЛН