Add Tailwind CSS In Your React Native App

Sdílet
Vložit
  • čas přidán 2. 06. 2024
  • Hello everyone, today's video is about how you can add tailwind css into your react native app, I'm going to show you two methods to integrate tailwind into react native app.
    make sure you like this video and subscribe the channel for more react native videos.
    Github repo: github.com/syednomishah/React...
    React Native : reactnative.dev
    First Method (TWRNC) : www.npmjs.com/package/twrnc?a...
    Second Method (NativeWind) : www.nativewind.dev
    Tailwind CSS classes cheatsheet : nerdcave.com/tailwind-cheat-s...
    Add Navigation in React Native : • Food Delivery App with...
    If you appreciate my work and you would like to support my channel: www.buymeacoffee.com/syednoman
    🚨 more videos on react native:
    Food Recipe App with Reanimated : • 🔴 Build Food Recipe Ap...
    AI Voice Assistant with ChatGPT & DALL-E : • 🔴 Build a React Native...
    Weather App : • 🔴 Build Weather App Us...
    Movie App : • 🔴 Build Movie App Usin...
    Coffee App UI: • 🔴 Coffee App UI - Reac...
    CZcams Clone App: • 🔴 CZcams Clone - Reac...
    Login | SignUp UI : • 🔴 Login | SignUp UI - ...
    Fast Food App : • 🔴 Fast Food App UI - R...
    App Store UI : • 🔴 App Store UI - React...
    Fruit Shop UI : • 🔴 Fruit Shop UI - Reac...
    Firebase Authentication React Native: • React Native Firebase ...
    Food Delivery App : • Food Delivery App with...
    Learn React Native: • Build Expensify App Wi...
    Learn Reactjs: • Modern React For Begin...
    #expo #reactnative #tailwindcss #javascript #programming #typescript #speedcode #coding #design #appdevelopment #reactjs #ui #uiux #reactnavigation #reactnativetutorial #react #animation #reactjs #navigation #navigationbar #uidesign #mobiledevelopment #iosdeveloper #buildinpublic #opensource #reactnativeapp #reactjstutorial #typescript
    react native animations
    animations in react native
    react native tutorial
    react native app
    react native tutorial for beginners
    react native project
    react native course
    add tailwind css in react native
    react native ui
    ▬▬▬▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
    00:00 - Intro
    00:18 - Create React Native App
    01:32 - First Method (TWRNC)
    04:24 - Second Method (NativeWind)

Komentáře • 108

  • @codewithnomi
    @codewithnomi  Před 10 měsíci +30

    you may face this error with newer version of tailwindcss.
    Error: Use process(css).then(cb) to work with async plugins]
    To fix this error just downgrade your tailwindcss version, run this command:
    npm i --dev tailwindcss@3.3.2
    If you are using yarn then run this command:
    yarn add --dev tailwindcss@3.3.2

    • @sdk_gyan
      @sdk_gyan Před 10 měsíci

      how to setup dark and light mode

    • @codewithnomi
      @codewithnomi  Před 10 měsíci

      @@sdk_gyan will create a tutorial on this 😉

    • @MovieKaliReactions
      @MovieKaliReactions Před 9 měsíci

      bro I have struggled for ages to solve this , i was about to give up
      @lets connect brother am a react native dev too

    • @chintype91
      @chintype91 Před 9 měsíci

      Thanks a lot, but i had the one issue with react-navigation. It didn't work

    • @codewithnomi
      @codewithnomi  Před 9 měsíci

      @@chintype91 czcams.com/video/-Kr247pr9hQ/video.html

  • @aneneemmanuel7985
    @aneneemmanuel7985 Před 8 měsíci +4

    If you're runnig Expo on ANDROID and you're having issues adding the shadows, use this:
    For TailwindCSS (only):
    style={[tw`bg-teal-500 p-4 rounded-lg`, Platform.OS === 'android' && { elevation: 20 }]}
    For NativeWind & TailwindCSS:
    className="bg-teal-500 p-4 rounded-lg" style={[Platform.OS === 'android' && { elevation: 20 }]}
    Thanks for sharing, Nomi. Nice Tutorial.

  • @user-qx8kb7xx9x
    @user-qx8kb7xx9x Před 3 měsíci

    So simple! Thank you very much

  • @abdullahzafar8886
    @abdullahzafar8886 Před 11 měsíci +3

    Very mesmerising listening to your voice today ❤

  • @salmanhamza4202
    @salmanhamza4202 Před 11 měsíci

    i was waiting for it

  • @hamzaeshoul
    @hamzaeshoul Před 6 měsíci +2

    Great tutorial. Thank you very much sir !

  • @user-sx7ri3fk6t
    @user-sx7ri3fk6t Před 2 měsíci

    Thanks a lot man, solved my nighmare in just minutes... stay blessed.
    :)

  • @shahmeergull2040
    @shahmeergull2040 Před 5 měsíci +1

    bro it works well with first method but when i try to switch on 2nd method using on cli it just dont apply classes added on elements you know how to fix it?

  • @aneneemmanuel7985
    @aneneemmanuel7985 Před 4 měsíci +2

    I don't know if this'll help anyone but I noticed (ON MY COMPUTER) that if I install method 1 before installing method 2, then method 2 won't work at all (i.e. I won't be able to use className= "..."
    To fix this, I only install "NativeWind" first (or alone). If I want to install both NativeWind & twrnc, I'll install NativeWind first and then later, I'll install twrnc.
    I don't know if this is a general issue but maybe it'll save someone's time while coding. Thanks, Nomi.

  • @ChungKang
    @ChungKang Před 4 měsíci

    Awesome, thanks!

  • @JuanMolina-tl2xc
    @JuanMolina-tl2xc Před 4 měsíci +1

    I love you brother... Thank you

  • @brienaustinclayton
    @brienaustinclayton Před 9 měsíci +1

    Hey , sir
    I am not able to use colors like bg-teal-200 or whatever color

  • @yuliav4682
    @yuliav4682 Před 10 měsíci +1

    thank you dude)

  • @MrGamalin
    @MrGamalin Před 10 měsíci

    Do a video on implementation of RTL and LRT with Tailwind CSS

  • @ghayoorhussain8930
    @ghayoorhussain8930 Před 11 měsíci +1

    Thanks, a lot.

  • @alimardan2665
    @alimardan2665 Před 4 měsíci

    dude ur awesome

  • @Thunderstormplus
    @Thunderstormplus Před 11 měsíci +1

    Thanks =)

  • @ridamnibjia
    @ridamnibjia Před 14 dny

    if you're using the nativewind css and opening the app in web then in the App.js add this after the import:
    import { NativeWindStyleSheet } from "nativewind";
    NativeWindStyleSheet.setOutput({
    default: "native",
    });

  • @rangga1204
    @rangga1204 Před 6 měsíci +3

    thanks for the tutorial, but it does not work on CLI

  • @supercica
    @supercica Před 8 měsíci +2

    Hi Nomi, thank you for this video. I did this app and I tried to build .apk with expo eas. In development everything works but when I install .apk to Android phone, it starts, it opens expo splash screen and then just shuts down. There is no errors or any log and I can not find what is the problem. Have you ever had this situation. Do you have any advice for me? Thank you. And again thanks so much for these videos.

  • @ZaminHesenov
    @ZaminHesenov Před 9 měsíci +1

    If it was received, I would give you 10000000 likes thank youuuu

  • @whatsgoingonworld7556
    @whatsgoingonworld7556 Před 9 měsíci +1

    Thanks

  • @kntbruh
    @kntbruh Před 4 měsíci

    thanks a lot

  • @haseebshabir1970
    @haseebshabir1970 Před 10 měsíci +2

    Sir I'm following all the steps as you shown in video but at the end i got error and when i search this error on stack overflow it suggests me to downgrade the tailwind css version when i do so its classes only work in app. Js file not in other files. Please help me I'm stuck here very badly

    • @codewithnomi
      @codewithnomi  Před 10 měsíci

      you need to specify other files directory in the contents property of tailwind config file, this may solve the issue

    • @haseebshabir1970
      @haseebshabir1970 Před 10 měsíci

      @@codewithnomi sir I've done that but it is not working

  • @tundeakinola8122
    @tundeakinola8122 Před 9 měsíci +3

    I have tried using it with typescript tsx file but it was giving error with the ClassName getting red lines.. How does one solve it??

    • @dusekdan
      @dusekdan Před 3 měsíci

      className - no capital C.

  • @JavierDiaz-jh7ly
    @JavierDiaz-jh7ly Před 8 měsíci +2

    Nice tutorial. I'm facing an issue with text colors. When I change the className to modify the background color, size, or other properties, it works. However, when I try to change the text color, it's the only property that doesn't seem to work. I'm using Tailwind CSS version 3.3.2 because version 3.3.3 breaks everything.

    • @codewithnomi
      @codewithnomi  Před 8 měsíci

      thats very strange!!
      it should work because I'm currently using this in a project.

    • @prateekpuri796
      @prateekpuri796 Před 6 měsíci

      Hi DId you get the solution for ir. I am also facing same issue.

    • @JavierDiaz-jh7ly
      @JavierDiaz-jh7ly Před 6 měsíci

      @@prateekpuri796 I tried downgrading the tailwind version but doesn't works. So finally I made it without tailwind, just css

    • @prateekpuri796
      @prateekpuri796 Před 6 měsíci +1

      I found the issue, the issue is with the exp web only and it works just fine with expo go app on my android device

    • @prateekpuri796
      @prateekpuri796 Před 6 měsíci

      Expo web*

  • @chamaldezilva
    @chamaldezilva Před 10 měsíci +2

    Is it possible to add the conditional styles using nativewind? If yes how can I do that?

    • @codewithnomi
      @codewithnomi  Před 10 měsíci

      yes
      className={ condition? "style1" : "style2" }

    • @chamaldezilva
      @chamaldezilva Před 10 měsíci +1

      @@codewithnomi thank you!

  • @RonanThomas
    @RonanThomas Před 4 měsíci

    Hi Nomi, followed the video, have tailwindcss and nativewind installed but when l write the className css in my homeScreen file, nothing happens, cant change background colour or centre text or anything. Any tips here?

    • @lalithadwarapureddi3283
      @lalithadwarapureddi3283 Před 4 měsíci

      Yes

    • @codewithnomi
      @codewithnomi  Před 4 měsíci

      Maybe it's not implemented correctly, did you follow all the steps?

    • @RonanThomas
      @RonanThomas Před 4 měsíci

      @@codewithnomi I followed all the steps provided for Nativewind v4 in their documentation, I’m using React Native with Expo Router v2 and Typescript. Not getting any errors but it’s just not doing anything in the simulator.

    • @codewithnomi
      @codewithnomi  Před 4 měsíci +1

      @@RonanThomas I'm currently working on a series where I'm building a firebase app, I'll explain nativewind 4 setup in that series 😉

  • @abdullahzafar8886
    @abdullahzafar8886 Před 11 měsíci

    MashaAllah shah g i miss u so much

  • @albinholmgren9045
    @albinholmgren9045 Před 10 měsíci +1

    the expo gives me error: "use process(css).then(cb)"
    do you know what it might be and how to solve it?

    • @codewithnomi
      @codewithnomi  Před 10 měsíci +1

      I'll check and get back to you 🙂

    • @albinholmgren9045
      @albinholmgren9045 Před 10 měsíci

      @@codewithnomi Thank you very much!

    • @albinholmgren9045
      @albinholmgren9045 Před 10 měsíci

      @@codewithnomi thank you very much!

    • @codewithnomi
      @codewithnomi  Před 10 měsíci +1

      try using this version of tailwind : tailwindcss@3.3.2

    • @albinholmgren9045
      @albinholmgren9045 Před 10 měsíci +1

      @@codewithnomi i did but still does not seem to fix the problem

  • @abhishekpatil4649
    @abhishekpatil4649 Před 8 měsíci

    Sir i am not getting tailwind classes suggestions in vs code when i start typing classes. what can i do for that

    • @codewithnomi
      @codewithnomi  Před 8 měsíci

      you need to install "tailwind intellicence" extension on vs code

    • @abhishekpatil4649
      @abhishekpatil4649 Před 8 měsíci

      @@codewithnomi sir have it installed already

    • @abhishekpatil4649
      @abhishekpatil4649 Před 8 měsíci

      @@codewithnomi thank you sir. i got the solution

  • @haidarDevDiary
    @haidarDevDiary Před 11 měsíci

    Boss 👍

  • @JoDaniel_Keys
    @JoDaniel_Keys Před 2 měsíci

    i am unable to add shadow

  • @Slayzan
    @Slayzan Před 11 měsíci +1

    Could you make a tutorial where you explain how to get virtual phone device like you on the right ?

    • @codewithnomi
      @codewithnomi  Před 11 měsíci

      sure, I will make a video on this someday 😉

    • @zaidshaikh2449
      @zaidshaikh2449 Před 8 měsíci

      We are still waiting for this video@@codewithnomi

  • @gangulyyadav2555
    @gangulyyadav2555 Před 10 měsíci +1

    does it only work with expo projec?

    • @codewithnomi
      @codewithnomi  Před 10 měsíci

      the setup process is the same for both expo and cli

  • @anikatahsin7716
    @anikatahsin7716 Před 7 měsíci

    not working nativewind. frustrating to do the react native project using tailwind css.

  • @Anonymous-pf4cr
    @Anonymous-pf4cr Před 5 měsíci +1

    still not working using nativewind any suggestions

    • @codewithnomi
      @codewithnomi  Před 4 měsíci

      try installing latest nativewind 4, i'll create a tutorial on that soon 😉

  • @mohanj2849
    @mohanj2849 Před 8 měsíci

    bro how to open , mobile preview on windows like ios ?? plz replay..

    • @codewithnomi
      @codewithnomi  Před 8 měsíci

      install android studio for android simulator

  • @vuaiduong8918
    @vuaiduong8918 Před 8 měsíci

    not working with me

  • @user-zq5iy8dr4j
    @user-zq5iy8dr4j Před 7 měsíci

    Hi, nice video, how to add google font?

    • @codewithnomi
      @codewithnomi  Před 7 měsíci +1

      I'll create a tutorial on adding custom fonts 😉

    • @user-zq5iy8dr4j
      @user-zq5iy8dr4j Před 7 měsíci

      @@codewithnomi thanks, i wait it very much)

    • @user-zq5iy8dr4j
      @user-zq5iy8dr4j Před 7 měsíci

      @@codewithnomi please, custom and google fonts

  • @harizfauzil7672
    @harizfauzil7672 Před 9 měsíci

    why don't you make a tutorial from scratch, I'm a little confused about where to start

    • @codewithnomi
      @codewithnomi  Před 9 měsíci +1

      I literally created this tutorial from scratch 😶

    • @harizfauzil7672
      @harizfauzil7672 Před 9 měsíci

      @@codewithnomi I mean from the start since installing the dependencies😅

  • @danieliberi
    @danieliberi Před 11 měsíci +1

    nativewind doesn’t work for me and i’ve done everything to make it work

    • @codewithnomi
      @codewithnomi  Před 11 měsíci

      if you've followed the docs just restart the server and it should work 😉

    • @danieliberi
      @danieliberi Před 11 měsíci

      @@codewithnomi is there a way i can send you a message privately and show you how my code is? or could it because of react navigation

    • @codewithnomi
      @codewithnomi  Před 11 měsíci +1

      sure lets connect on Instagram
      instagram.com/codewithnomi_?igshid=ZDc4ODBmNjlmNQ==

    • @danieliberi
      @danieliberi Před 11 měsíci

      @@codewithnomi i’ve sent you a dm bro

    • @rohitbarnwal1420
      @rohitbarnwal1420 Před 11 měsíci +2

      @@danieliberi any luck??? not working for me as well.... done everything according to the docs....

  • @manojmohapatra986
    @manojmohapatra986 Před 11 měsíci

    Where are the auto suggestions

    • @codewithnomi
      @codewithnomi  Před 11 měsíci

      suggestions only show up when we use the className property not inside the style property

    • @manojmohapatra986
      @manojmohapatra986 Před 11 měsíci +1

      @@codewithnomi he thnx buddy 🫡

  • @febrilian
    @febrilian Před 9 měsíci

    which one do u prefer?

  • @waseemahmed5916
    @waseemahmed5916 Před 10 měsíci

    i am using typescript when i write className in View Tag it gives me this error can u plz resolve my issue No overload matches this call.
    Overload 1 of 2, '(props: TextProps | Readonly): Text', gave the following error.
    Type '{ children: string; className: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
    Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
    Overload 2 of 2, '(props: TextProps, context: any): Text', gave the following error.
    Type '{ children: string; className: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
    Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.

    • @codewithnomi
      @codewithnomi  Před 10 měsíci

      not sure about this one bro, you have to search online 😉

    • @waseemahmed5916
      @waseemahmed5916 Před 10 měsíci +1

      @@codewithnomi ok if u find something regarding this do let me know

    • @eraybaydemir8240
      @eraybaydemir8240 Před 4 měsíci

      did you solve it???

  • @masoom10101
    @masoom10101 Před 11 měsíci +1

    I need to contact you, how to, email or anything

    • @codewithnomi
      @codewithnomi  Před 11 měsíci

      send a message on Insta
      instagram.com/codewithnomi_?igshid=ZDc4ODBmNjlmNQ==

  • @emmanuelsheshi961
    @emmanuelsheshi961 Před 5 měsíci

    thanks alot