Add Tailwind CSS In Your React Native App

Поделиться
HTML-код
  • Опубликовано: 2 июн 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...
    RUclips Clone App: • 🔴 RUclips 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)

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

  • @codewithnomi
    @codewithnomi  10 месяцев назад +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 10 месяцев назад

      how to setup dark and light mode

    • @codewithnomi
      @codewithnomi  10 месяцев назад

      @@sdk_gyan will create a tutorial on this 😉

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

      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 9 месяцев назад

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

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

      @@chintype91 ruclips.net/video/-Kr247pr9hQ/видео.html

  • @aneneemmanuel7985
    @aneneemmanuel7985 8 месяцев назад +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 3 месяца назад

    So simple! Thank you very much

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

    Very mesmerising listening to your voice today ❤

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

    i was waiting for it

  • @hamzaeshoul
    @hamzaeshoul 6 месяцев назад +2

    Great tutorial. Thank you very much sir !

  • @user-sx7ri3fk6t
    @user-sx7ri3fk6t 2 месяца назад

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

  • @shahmeergull2040
    @shahmeergull2040 5 месяцев назад +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 4 месяца назад +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 4 месяца назад

    Awesome, thanks!

  • @JuanMolina-tl2xc
    @JuanMolina-tl2xc 4 месяца назад +1

    I love you brother... Thank you

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

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

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

    thank you dude)

  • @MrGamalin
    @MrGamalin 10 месяцев назад

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

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

    Thanks, a lot.

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

    dude ur awesome

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

    Thanks =)

  • @ridamnibjia
    @ridamnibjia 14 дней назад

    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 6 месяцев назад +3

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

  • @supercica
    @supercica 8 месяцев назад +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 9 месяцев назад +1

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

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

    Thanks

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

    thanks a lot

  • @haseebshabir1970
    @haseebshabir1970 10 месяцев назад +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  10 месяцев назад

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

    • @haseebshabir1970
      @haseebshabir1970 10 месяцев назад

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

  • @tundeakinola8122
    @tundeakinola8122 9 месяцев назад +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 3 месяца назад

      className - no capital C.

  • @JavierDiaz-jh7ly
    @JavierDiaz-jh7ly 8 месяцев назад +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  8 месяцев назад

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

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

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

    • @JavierDiaz-jh7ly
      @JavierDiaz-jh7ly 6 месяцев назад

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

    • @prateekpuri796
      @prateekpuri796 6 месяцев назад +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 6 месяцев назад

      Expo web*

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

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

    • @codewithnomi
      @codewithnomi  10 месяцев назад

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

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

      @@codewithnomi thank you!

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

    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 4 месяца назад

      Yes

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

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

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

      @@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  4 месяца назад +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 11 месяцев назад

    MashaAllah shah g i miss u so much

  • @albinholmgren9045
    @albinholmgren9045 10 месяцев назад +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  10 месяцев назад +1

      I'll check and get back to you 🙂

    • @albinholmgren9045
      @albinholmgren9045 10 месяцев назад

      @@codewithnomi Thank you very much!

    • @albinholmgren9045
      @albinholmgren9045 10 месяцев назад

      @@codewithnomi thank you very much!

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

      try using this version of tailwind : tailwindcss@3.3.2

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

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

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

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

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

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

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

      @@codewithnomi sir have it installed already

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

      @@codewithnomi thank you sir. i got the solution

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

    Boss 👍

  • @JoDaniel_Keys
    @JoDaniel_Keys 2 месяца назад

    i am unable to add shadow

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

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

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

      sure, I will make a video on this someday 😉

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

      We are still waiting for this video@@codewithnomi

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

    does it only work with expo projec?

    • @codewithnomi
      @codewithnomi  10 месяцев назад

      the setup process is the same for both expo and cli

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

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

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

      try using tailwindcss 3.3.2

  • @Anonymous-pf4cr
    @Anonymous-pf4cr 5 месяцев назад +1

    still not working using nativewind any suggestions

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

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

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

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

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

      install android studio for android simulator

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

    not working with me

  • @user-zq5iy8dr4j
    @user-zq5iy8dr4j 7 месяцев назад

    Hi, nice video, how to add google font?

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

      I'll create a tutorial on adding custom fonts 😉

    • @user-zq5iy8dr4j
      @user-zq5iy8dr4j 7 месяцев назад

      @@codewithnomi thanks, i wait it very much)

    • @user-zq5iy8dr4j
      @user-zq5iy8dr4j 7 месяцев назад

      @@codewithnomi please, custom and google fonts

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

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

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

      I literally created this tutorial from scratch 😶

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

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

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

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

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

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

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

      @@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  11 месяцев назад +1

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

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

      @@codewithnomi i’ve sent you a dm bro

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

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

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

    Where are the auto suggestions

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

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

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

      @@codewithnomi he thnx buddy 🫡

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

    which one do u prefer?

  • @waseemahmed5916
    @waseemahmed5916 10 месяцев назад

    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  10 месяцев назад

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

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

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

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

      did you solve it???

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

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

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

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

  • @emmanuelsheshi961
    @emmanuelsheshi961 5 месяцев назад

    thanks alot