How to Setup Shadcn UI + Themes in NextJs 14

Поделиться
HTML-код
  • Опубликовано: 19 янв 2025

Комментарии • 79

  • @alexdin1565
    @alexdin1565 11 месяцев назад +8

    woow amazing you are the first one on youtube who cover theming topic thakns

    • @hamedbahram
      @hamedbahram  11 месяцев назад +1

      My pleasure! Glad to hear that.

  • @uixmat
    @uixmat 11 месяцев назад +3

    Been using Radix Primitives and more recently shadcn ui for a while now. frickin love em!

  • @BooleanOperator
    @BooleanOperator 10 месяцев назад +2

    Another great tutorial, Thanks Hamed.

    • @hamedbahram
      @hamedbahram  10 месяцев назад +1

      Thanks! I appreciate that.

  • @teacookie-wynn
    @teacookie-wynn 6 месяцев назад +1

    Finally someone talking about custom themes...

  • @harirasamir2436
    @harirasamir2436 8 месяцев назад +1

    Waw bravo high-quality content and excellent courses. Thanks Hamed well done

    • @hamedbahram
      @hamedbahram  8 месяцев назад +1

      Thank you! welcome to the channel 🙌🏼

  • @PooyaDehghani-s1m
    @PooyaDehghani-s1m 11 месяцев назад +2

    Well done Hamed Jan, thanks.

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      Thanks! Appreciate that.

  • @neoTriny
    @neoTriny 7 месяцев назад +1

    Awesome ! Just discovered this channel. Thanks for the nice explanations @hamed. Go ahead Next js 💥

    • @hamedbahram
      @hamedbahram  7 месяцев назад

      Thanks! Welcome to the channel.

  • @Anshumantiwarianstiwar
    @Anshumantiwarianstiwar 11 месяцев назад +1

    amazing high-quality content, thanks !!!!

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      My pleasure! I appreciate that.

  • @duanewood
    @duanewood 3 месяца назад +1

    Excellent! Very helpful.

  • @hijuliansosa
    @hijuliansosa 3 месяца назад +1

    Well done!

  • @DesignWithPravin
    @DesignWithPravin 4 месяца назад +1

    Awesome! thank you very much, it was really helpful

  • @idontknowmyname2387
    @idontknowmyname2387 6 месяцев назад +1

    absolutely amazing!

  • @Elliot-Dx
    @Elliot-Dx 11 месяцев назад +1

    Now that's some proper explanation, appreciate it... just 1 query though, how do you make multi-layer navbar menu with active state of parent & child ?

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      I'll have that in mind for future videos.

  • @fakhrulislamfuad8072
    @fakhrulislamfuad8072 11 месяцев назад +1

    nice video bro.. keep this good work up😃😃

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      Thanks! I appreciate that.

  • @zvinzv
    @zvinzv 11 месяцев назад +2

    i love it ❤‍🔥, can i know what is the font name used in vscode?

    • @hamedbahram
      @hamedbahram  11 месяцев назад +1

      My pleasure! My font is Operator mono

  • @muhammadsetyanto3515
    @muhammadsetyanto3515 4 месяца назад +1

    Fantastic! Thanks sir.

  • @emmanuelmantilla1465
    @emmanuelmantilla1465 9 месяцев назад +2

    Hello, just want to add something if you add more themes then tailwind will have problems to know which are dark and which don't, imagine you add 'darkgreen', then TW will treat it as a regular theme, that would be troublesome because if you use (dark:text-white) then that will only be applied to the default dark theme not to the 'darkgreen', in order to tell TW about it you need to specify it in the config file.
    if someone needs to know the code to let tailwind know to which colors apply dark mode just let me know.

    • @hamedbahram
      @hamedbahram  9 месяцев назад +1

      Wouldn't it be easier with css variables?

  • @sivadhanushuppalapati4041
    @sivadhanushuppalapati4041 11 месяцев назад +1

    Hi sir, Installing this UI library increases the project/ application size?
    If so is this to be concerned sir?

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      This is not a UI library to install, you can copy paste only the components you're using. With or without this you're going to need to write your components.

  • @brainbustergk
    @brainbustergk 3 месяца назад +1

    sir how to add a multiple theme in next js project using shadcn? i want to multiple color theme are add in our project and user can click particular theme color than change whole theme color.

    • @hamedbahram
      @hamedbahram  3 месяца назад

      Theming in shadcn is via css variables. You can change the value of the css variables by getting a hold of the `root` element, then use `root.styles.setProperty('--primary', '240 5.9% 10%') to change the values to the selected theme.

    • @brainbustergk
      @brainbustergk 3 месяца назад

      Sir any example? Please help me

    • @hamedbahram
      @hamedbahram  3 месяца назад

      @@brainbustergk Here is an example → css-tricks.com/updating-a-css-variable-with-javascript/

  • @dolapoajayi2156
    @dolapoajayi2156 11 месяцев назад +1

    Nice video man❤..but what if I wanna use a custom orange shade and not Shadcn orange shade?any idea??

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      Thank you! you can change the css variable values to whatever color you wish.

    • @dolapoajayi2156
      @dolapoajayi2156 11 месяцев назад +1

      @@hamedbahram yeah I know I can change it but I don’t wanna mess things up that’s why I needed to be sure how to do it..any tips please🙏..I wished you covered that in your video or just guide me🙏🙏

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      @@dolapoajayi2156 go to the `globals.css` where we have the css variables and change the value to your colors. shadcn uses hsl colors, so you can just replace the values:
      ```
      --foreground: 50 80% 40%;
      ```

  • @sayedalisinasadat2908
    @sayedalisinasadat2908 9 месяцев назад +1

    it was useful for me and if you have time please make video Radix UI 😍.

    • @hamedbahram
      @hamedbahram  9 месяцев назад

      For sure! Thanks for the suggestions.

  • @raymondmichael4987
    @raymondmichael4987 11 месяцев назад +1

    How to enable both light and dark mode on a particular color, like orange in dark and light mode. ❤😊😊

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      You can have next-themes control the light and dark and create another theme toggle for the other colors. Then in your CSS you'd have light and dark class for every other theme. Does that make sense?

    • @d4rzk252
      @d4rzk252 11 месяцев назад +1

      @@hamedbahramSo I will just do .orange.dark {...}, .orange.light {...} in css?

    • @raymondmichael4987
      @raymondmichael4987 11 месяцев назад +2

      @@hamedbahram
      For light
      .orange{}
      For dark
      .dark .orange {}
      Right?

    • @hamedbahram
      @hamedbahram  11 месяцев назад +1

      @@raymondmichael4987 Exactly!

    • @hamedbahram
      @hamedbahram  11 месяцев назад

      @@d4rzk252 Exactly!

  • @ayushkushwaha171
    @ayushkushwaha171 Месяц назад +1

    thanks for the vid

  • @fabouwes9240
    @fabouwes9240 9 месяцев назад

    I've been trying to create another plugging (next to dark/light plugging) which gonna change the color theme, but I haven't succeed so far. I can only have one color more than dark/light. Any ideas?

    • @hamedbahram
      @hamedbahram  9 месяцев назад

      You have to separate the theming from the light/dark mode.

  • @roBz92
    @roBz92 16 дней назад

    you just completely lost me at about 23:05 when you "Added in all components" by just drag and drop.. how?

  • @xenonjr6738
    @xenonjr6738 Месяц назад

    can it use image/pattern instead of plain color?

  • @sattayaprata
    @sattayaprata 4 месяца назад

    how to setting Themes config in NextJs 14 by get value from api

    • @hamedbahram
      @hamedbahram  4 месяца назад +1

      You mean changing the css variable values in response to an API call?

    • @sattayaprata
      @sattayaprata 3 месяца назад +1

      @@hamedbahram I want to get color values ​​from API to set theme
      Color

  • @PootCoinSol
    @PootCoinSol 6 месяцев назад

    If anyone has issues where it wont select the correct multiple theme, make sure your custom theme is below :root. I was dumb and had it above so the root theme was constantly overriding my custom theme

  • @MeenaVlogs1313
    @MeenaVlogs1313 8 месяцев назад

    How can change js html css into next.js ?

  • @MichaelHofweller
    @MichaelHofweller 6 месяцев назад

    The theme provider adds the dark or light class that then throws this error: Prop `className` did not match. Server: "__className_3a0388 dark" Client: "__className_3a0388" Any help with a fix?

    • @hamedbahram
      @hamedbahram  6 месяцев назад +1

      Clone my code and see what you're doing differently. For additional resource read here → github.com/pacocoursey/next-themes?tab=readme-ov-file#avoid-hydration-mismatch

    • @MichaelHofweller
      @MichaelHofweller 6 месяцев назад

      @@hamedbahram Cool I'll check it out. Thank you! Great videos.

    • @MichaelHofweller
      @MichaelHofweller 6 месяцев назад

      @@hamedbahram The solution as far as I can tell was the use of supressHydrationWarning in the