YouTubevideo· Sep 25, 2024· 11:21

First Look at Livewire Flux (and I'm building a starter kit?)

Watch on YouTube ↗

transcript

29 moments
  1. so flux has been released I've been playing around with it and here's some of the things that I really love if you haven't heard about Livewire flux it is the Livewire UI so a component Library specifically built for Livewire by the creator of Livewire and Alpine as well as a hir designer Hugo who helped build all of this who helped design it and build it specifically for web standards and for accessibility standards and there's a lot that went

  2. into this and all of the pricing controversy and laun and everything behind it there's some great things and yes the docks kind of give you a little bit of look behind the curtain if you will there's some free components so the

  3. button drop- down icon separator and Tool tip are all free I've always wanted to build a starter kit for myself of like hey I'm doing a new demo or I'm making a new video most of the time I'm using Live Wire most of the time I'm using volt currently it'd be nice to have something looking nice and currently it's just been okay let me just spin up live larel Breeze but now I can make things a little bit nicer and that's what I have here so this is my own implementation of basically larel Breeze but with flux

  4. volt and folio and so I wanted to show off a little bit of what I've done so far and give maybe some things that I found with flux that's incredibly nice as well as just some tips with volt and folio that I really enjoy as well so the

  5. cool thing with flux is that and is this isn't really mentioned that much in the docs but I really love this part about it so if I was to pull up let's say the login page I'm just using I'm basically just pulled a bunch of stuff from larel Breeze and just implemented it within flux with volt and with folio so all of this is just page-based routing you see here we have an index that is basically the dashboard page um and it redirects

  6. since it has metalware to the login so I'm using class based volt components uh with the flux components itself so if you see here and the input for let's just say input for email it just has wire model form. email that's the login form for app Live Wire forms login form so it just has a wire model of form.

  7. email there's no no error page or anything like that and flux handles all that so if I was to say blank at and then do this log in not going to have me do that but uh these credentials don't match records that's a error on the email but I didn't have to do all of this and it works the same with a password as well for example if I was to create a new account and I was saying Josh josh.com if I was to have a

  8. different confirmed password word all of this is just kind of baked into the inputs of flux so on register if we take a look here I just have flux input password wire model and uh wire model password confirmation

  9. but all of the validation is being pushed to those inputs and it's be and it's handling it with these nice error handling itself that's one thing that I wanted to kind of like make a note on I'm going to zoom out here to show something else that's really neat that I that's kind of like a feature of Live Wire volt just live wire itself flux and

  10. then just something cool that I did so in Breeze all of the statuses is in session so if I want to forget password and I'm saying Josh siri.com email password reset link well I don't have that user uh email password reset link I'm using flux um toasts down here here

  11. to show any kind of like confirmations or anything like that so if we have to go into reset password or forgot password we're just showing this flux toast with the status now here's the really cool thing if I was to pull open the email right here and I'm just going to open this up in the browser now I'm going to input a new password testing password testing password within

  12. laravel Bree what happens here is when I click reset password it's going to reset push something to the session and then on the login page we're just going to check if something's in the session and show that status just in a little component and yeah you could do that but with flux toasts you could just show a toast but

  13. if I click reset password okay your password's being reset we're back in the login page we changed pages but we're still showing a toast well that's where Live Wire persist can come into handy so I have app layout where I have this flux

  14. toast I'm just saying we're persisting this and actually I have an off layout as well that also persist the same toast so if I'm in one layout and I'm showing a toast even if we're changing pages that toast is still going to stay there until it fades away this is really this comes really in handy if I'm saying let's log in and so now I'm in a different layout

  15. log out here so I have a playground home everything's really Snappy we have a profile page I kind of used to borrow some IDs from larel Breeze but if I want to delete an account okay it's a modal I'm inputting my password I'm in one app layout but I'm pushing to the login page

  16. when I delete an account so I can show show a modal but because I'm persisting it and it's the same persisted component across two layouts we'll be able to see that toast really neat huh um that is one thing that I'm I really love so the toasts is really neat and just like with folio and persisting within volt I think it just looks really clean it's something that I have been loving is like this magic of folio where I just

  17. have everything on one page and can just use blade until I need logic and then I can just wrap it in this volt tag um as well as the input fields that just have all that wrapped up together in one within flux has been awesome like this didn't take me that long to kind of uh

  18. put together of saying okay I have all these pages I again the only thing I don't have is like validate email like those types of pages but all like the password reset and verification the profile Pages all of this is like 90% of what comes out of the box with Breeze and I just ported it over to folio volt and flux and this is

  19. what I use most of the time to start setting up a new demo or a new video it's nice to have login so things are saved to a particular user in the database if I was creating like a to-dos for example or you know new emails or anything like that I have users to play with but now I can just do in the playground for example now I just have information that I or things that I could do for example let's just create a new flux button and say hi there and

  20. right here now I just have all of this ready to go say hi and we'll just say this message is hello there okay really quick but all a sudden we have you know this built out I have a playground ready to go and that's usually what I say within most of the videos that I that I do the ability to have things like this

  21. ready to go have a page where I can put things on it and have nice buttons out of the box and inputs and things of that nature to be able to have all this just ready for me and that's what I am going to love about this kind of build up and I'm going to probably add a little bit more opinions into this of things I like things I don't like that kind of thing but uh yeah I'm loving it so far oh one

  22. more thing that's really interesting and I'm going to uh like maybe mess around with different ways of doing this but one thing that's really cool is let's say you have a long running function or method that exists say you wanted to you know it creates a new CSV for example well now within Lille you could just put all that within a defer function so that way the user doesn't have to wait and we can show a uh we can show a toast right

  23. away so we could put in the you know we could put in the sleep right here and not have to worry about showing that to the user okay that's all great but let's say you did have a long running function

  24. um what we could do let's say you wanted to show the user that this is actually working well there is a loading component basically icon is loading for a button you just have this here so you could kind of wire all of that up and there might be some better ways of doing this in the future but one neat thing about this is instead of saying wire click we're just going to say type is submit I can push a button and most of

  25. the time you probably have this within a form you don't just have a button to do this maybe you have a form or modal I can push this into a form wire submit is say Hi and then form here and so we have this type of submit flux automatically because it's a

  26. submit button is going to disable this button when I click High there so it's disabled while the function the method is running really neat stuff I I didn't refresh so it kind of went away there but really neat stuff to be able to you know have this easy disclaimer or this

  27. easy visual representation to the user that something is happening something is happening behind the scenes and all I did was just push this flux button into a form now again uh maybe in the future there's a way of putting something like uh loading equals say high or something like that which would be nice that's not the case but so many small things I've

  28. only played around with 20% of the flux components in building all this out but so many things that just make flux a no-brainer for me personally because not only can I play around with this within my own you know demos videos and personal projects but now I just have a great starting point for any new projects that I'm going to build or new client work that I'm doing whatever that might be I just love the ability to do stuff like

  29. this it makes building easier it makes creating easier so keep building keep creating

just you here