YouTubevideo· Aug 8, 2024· 15:53

Shadcn/ui but for Laravel

Watch on YouTube ↗

transcript

37 moments
  1. if you're a developer and you haven't heard about Shad CN UI then you probably either live under a rock or you're just a developer who actually writes code and ships products while us other developers find new ways to procrastinate and play around and do anything other than code but it's kind of taken the developer world at least the UI World by storm to be able to create quick and fast and beautiful UI without having to do much

  2. it's built on top of giants like tailwind and radics and even has ports for spelt and view on top of probably many others that I'm forgetting but what if you want that style within laril and you don't necessarily want to use inertia you'd rather just use blade or just use Live Wire so you're in luck this is probably one of my most requested videos in the past couple of months because I have been finding the

  3. perfect solution for you the viewer to use a Shad C nuui like feel Within your Live Wire applications so here's three UI component libraries that I would say are inspired by Shad Cen have different limitations have different takes on ways of how to do this but are using Alpine and tailwind and some even use live wire as well so why don't we take a look at

  4. Artisan UI Pines UI and then louy or lovey UI so first up Pines UI built by someone that I very much appreciate and also look up to in the L Livewire Alpine world is Tony Leia at Dev Dojo so Pine zi is incredible and a a little bit different of a take than the other two which is why I want to talk about it first for example all of

  5. these are just going to be Alpine and Tailwind but similar to the maybe Tailwind UI approach where you just find the ones you want and then copy the code so this isn't necessarily a component that you install if you have PJs until ta when installed you just copy this so for example this accordion right here looks absolutely beautiful and code I can just I don't even have to look at

  6. the code actually I can just say copy that and in my code editor I have a little playground Live Wire volt component up and ready to go I'm just going to paste this right in there go ahead and save and let's take a look and then this is how it looks again this is great for those one off little components that you need on an application while I love pinees UI it's

  7. not necessarily meant to be a okay you just use this and copy this for every single button that you want like if I had this button here and then you know here's just a classic button that looks like shadu cnii I could copy this and maybe I could create my own components saying PHP artisan make component and

  8. we'll just call this Pines button maybe there we go so Pines button and then I'll just copy that in here so if I was to use my x- Pines Das button then we would still see that here again this is just to show that it's not necessarily the same approach that some of the other

  9. ones that we're going to take a look at I think these styles are phenomenal in the sense that everything that you need is customizable and it's just all tailin behind the scenes you can customize all this so if you want to make your own UI Library maybe changing a couple of different things it's customizable to the point that there is no customizations because you can just build it yourself and so I

  10. would say this is what I like to use as the oh I don't necessarily have this particular UI component I only need it for one page Pine UI is perfect for that some of the my favorites that I like within this there's a text animation one that's perfect for like marketing Pages uh if you have a Dev Dojo premium subscription then there's also like

  11. phenomenal marketing Pages itself and this is kind of how the author Tony Leia pays for everything because Dev Dojo puts out Pine's UI for free and so you have things like this that it's if you have a an account you'll be able to download download pages that look phenomenal they look great out of the box so again Pines UI I would say is the perfect component Library if you don't

  12. necessarily want a full component Library I would say it's probably the most complete out of the ones that we're going to take a look at just because there is so much that Pines offers but it's not necessarily A I'm going to install this as a composer package and now I just have x- button in my code it's for you to build it yourself in a lot of ways or just take one-offs where you need it now if you wanted something

  13. that looks really similar to pinees UI but you want those buttons and have them as a component within your larel package then I would take a look at the Genesis starter kit by Dev dojo and that's because it's built by the same person who built pincy and a lot of the style is very similar and that has some components out of the gate so if we look

  14. at stubs uh within default resources views components UI so we have things like badges buttons checkbox inputs placeholders select stuff that you would probably need for most applications again it's not necessarily a word for word substitute for Pine's UI it's not Pines UI as this it's more like

  15. it's a similar style as pin UI but in compos component form I like having components like this where then if I do need to extract it if I use it more than one time two times then I can have it be a little bit more abstracted and I can customize it to the style to the props that I want to give on each thing so the things I need to change every single time so when I'm building out an

  16. application and I'm using Pines UI it's great to be able to start my component library on top of anything else that I'm adding to this to the page so that's Pine's UI next up is lovey UI and this is one I came to find as I was doing some research on this particular video this is one that is going to be very similar in how you initiate or add new

  17. components to a Shad Cen type component library because it's not necessarily just copy and paste in the same way that Pine's UI would be if we were to go into installation we can install a comp composer package that's laravel lovey and then we can publish individual components by running the tag for the component name so all the components are technically installed but now you can publish each individual one when you

  18. need it and this is very similar to how Shad C nuui works for the other for the react view spelt for example one thing to know is you also need to install the anchor and collapse plugin while larvo blade gives you the forms plugin for Tailwind out of the box you do have to install the Tailwind CSS animate so why don't we do that and then our V config

  19. we need to add this resource CSS lovey UI and then add it to our v as well so I have that in my welcome just for Simplicity sake a lot of the icons that they have in the example is this blade loose side icons pack and I'm going to go ahead and install that as well publishing the CSS assets with vendor publish tag CSS and then also Tailwind if you use other config settings within

  20. Tailwind you'll want to save those that you can add those back as you see fit I think this should be good to go though and then in Live Wire V3 Livewire ships with anchor and collapse out of the box and it looks like those are the two we need for lovey anchor and collapse so we should be good to go why don't we go ahead and install something let's go

  21. ahead and start with the maybe just a simple accordion so in our code this is what the code looks like why don't we install it there we go and now I should be able to just copy and paste this I'm just going to erase everything else I had and copy and paste that so we have these x-

  22. accordion items and triggers I did install Lille Breeze before for running all of this which means that there are probably there might be some components that clash in this case um if I was to install a button for example because we have a x- primary button so it might not Clash but just something to note if you're using something like breeze to get this up and running so let's take a

  23. look at what this looks like looks like we have some Alpine errors I'm just going to install these plugins just in case I don't think I need them but we'll go ahead and see and then we'll add these to our app.js file okay so it looks like it does need those Alpine plugins or it's probably because that those components need those plugins and in that case when we publish them

  24. perhaps the JS isn't being recognized and adding that code that can be found in the installation seemed to work for me let's add a few more so why don't we do the menu bar that looks nice go ahead and copy this uh first we'll install it so install it and then we'll go ahead and copy this so

  25. we have something to take a look at and why don't I just go ahead and set this to be flex and set it so it's centered in these screens so justify Center item Center and there we go there's our menu bar I don't know the edit didn't seem to or it seemed like the file so there might be some some small little things that we could fix for example but it's nice to be able to have all this kind of

  26. out the gate ready to go even like nested links right here and since these are components it's nice to be able to just find them so this menu bar we have this menu bar index and we can make any changes to it because they are published within our Lille package so very nice I love the style of it I love how you can install them piece by piece when needed

  27. of course I don't think it's necessarily as maybe as complete or as full just yet but go ahead and take a look for yourself give it a star on GitHub and that's laravel lovey UI components for Lille you can copy and paste into your app Shad skin UI like built with blade and Alpine JS usable with Livewire okay so it doesn't necessarily even need live Arts just with alpine JS but you can have

  28. then be accessible with Livewire and then last let's take a look at Artisan UI so this is again is very similar I think an approach to what lovey is doing in the sense that you need to install each component piece by piece and maybe you don't actually now that I think about it I think you install everything and then just use the component itself so let's go ahead and install it and we'll go ahead and add this preset in our Tailwind

  29. configuration file think we have any presets in here nope presets our CSS file we need to import the projects CSS so CSS we'll import the project CSS and our JS file we'll import the project javascripts file so app.js and then we can import

  30. that here or use the blade directive but we should be good to go with just this and now we can test let's go to our playground we'll remove everything else and now we have a x- aui colon colon button so they're using specific it's not necessarily even components that you might have in your layal application and the good thing

  31. about stuff like this is if you wanted to kind of mix a match you could for all three that we're looking at you could grab a little bit of Pines UI add your own components and then have some lovey and then you have this Artisan UI as well so take a look yeah of course I don't have anything inside of it so hello there YouTube great stuff like this I love because it's all flexible

  32. when you want to start using things like Livewire or Alpine JS or anything else that you might need to okay maybe we'll have a when maybe we'll have when a a wire loading is up then we can add a spinner to this button it's stuff like that that I love thinking through when it comes to when it comes to component librar specifically ones like this where

  33. you have all the components ready for you so it looks here we have this button we have specific variants that we could have so a default secondary destructive outline ghost link and then specific sizes or icons as well I'll be putting out another video because one of the things that I think separates stuff like this from from Pines UI to love UI to Artisan UI while these are great I think they're in a

  34. different realm than a full component Library something like I often use in my videos wire UI where it's specifically linked to Live Wire where instead of just having the actual UI piece anytime there is a loading indicator then the button has a spinner attached to it it's stuff like that that you would have have to spend a little bit of time on your own to get working within lville within Livewire but those full component

  35. libraries then maybe have a little less flexibility that you would have with something like this so all these three component libraries that we looked at UI libraries uh between Pines UI love UI and then Artisan UI are all meant to copy the style of something like this something like Shad CI where it's a little bit more minimalistic a little bit more uh flat in a lot of ways and

  36. just gives you something nice something pretty out of the box so that you can add your own interaction your own customization down the road as need be so hopefully you found something that might work good for you or just a couple new libraries to be able to try out all the links will be in the description whether that's Pines UI Artisan UI or love UI so build something new with it uh figure out what might work best for you in your projects maybe this is a

  37. good middle ground between having a full component library and I'll have a video on some that I like in the future so this is specifically meant to have that unique design that you are probably looking for if you're just wanting to build something as quick as possible Pines UI love a UI and Artisan UI use them and keep creating

just you here