SlideShare a Scribd company logo
1 of 22
Getting started with React
Native: Building UI
nativebase.io/
Building Beautiful UI in React Native
• Building a User Interface (UI) for mobile apps is more difficult than doing
the same for a web app. The reasons for this are :
• Mobile devices have limited screen size.
• Each type of mobile device (tablets, smartphones etc) is different from the
other and they all require various kinds of support.
• Android and Apple have their own respective platform standards that a
developer should follow. So an app built to work on Android devices will
need its code to be changed in order to run on Apple devices.
What is React Native?
React Native is an open source JavaScript library that enables a developer to
build cross-platform apps.
Installation
• Before we start building the UI, let’s make sure that you have installed
React Native on your system.
• Click here and follow the steps carefully. Once you have successfully
installed React Native, we can get started with building an UI with the help
of React Native.
Let’s Take a Button Component
This component has two parts: the caption which
says “Awesome Button” and the blue box with
rounded corners surrounding the caption. In
React Native, the box is declared
in <TouchableOpacity />and the caption is
declared in <Text />.
How to
design
awesome
button
Style can be
declared
separately instead
of doing it inside
the class.
How To Layout?
Let’s try creating a Layout using React Native
A screen has 3 basic parts:
• Header
• Content Area
• Footer
Layout
• The Header and Footer are similar since they both need to
have a fixed height, a background color with white text and
the user should not be able to scroll them.
• The content area, on the other hand should have fluid height
so that the user can scroll in this area.
• <View />is used for header and footer and <Scroll View />is
used for content area. <Scroll View />is same as <View
/>with the exception that the user can scroll with <Scroll
View />.
The screen we get by writing the code shown on left would look something
like image shown on right side
Adding a color using
component looks like this
Few errors in alignment
There are still a few errors in this screen. The content
area is not properly visible and the header and footer
text is at the side rather than at center. We use Flex
box to align it properly .
Flexbox
To position elements on your screen, you can
use Flexbox. Flexbox is a layout module based
on CSS3
Two parts of Layout
• The layout is divided into two parts:
Container and Items.
• Flexbox has separate properties for
containers and items.
• Container properties like flex-direction,
align-items and justify-content set the
layout rules for the items inside the
container.
Flex Direction
flex-direction defines the direction in
which the items are placed in the container.
Align-items
align-items defines the default behaviour for how items are laid out along the cross axis on
the current line.
Justify-Content
justify-content defines the alignment along the main axis. It helps distribute
extra free space left over when either all the flex items on a line are
inflexible, or are flexible but have reached their maximum size.
Align-Self
1. Item properties like align-
self, flex, and aspect-ratio
set the layout rules for a
particular item in the
container. Item properties
take precedence over
container properties.
2. align-self allows the
default alignment (or the
alignment set by a
container property) to be
overridden for an
individual item.
Usage of property Flex
• By using the item property flex, which is a
combination of flex-grow, flex-shrink, and flex-basis,
our layout will now change , Use the align-items and
justify-content property to bring your header and
footer text to the center.
• Our layout looks much better than what we had
initially started with. But UI contains a lot more than
just rectangular boxes and buttons.
Icons
• React Native has over 3000
icons which can be accessed
from “react-native-vector-
icons” package.
• Writing this code will get
above icon
Custom Shapes
We can also design custom shapes in React Native using the
“react-native-svg” package.
To get the shape of right end we will write our code as
Adding UI
elements
• But is that all we need to build a
beautiful UI? What about Tabs,
Cards, Swiper…..?
• Building apps using React Native
would be much easier if there was
a generic set of UI components.
We knew this was essential since
long back.
• That’s why we built NativeBase, an
open source UI components
library for React Native.
Change in
Screen after
importing UI
Components
Takeaways
Finally, we can summarize that:
• Building UI in React Native is quite similar to the web.
• Flexbox is necessary to build better layouts in React Native.
• Using third party libraries like NativeBase can help you save time that is
used for development in React Native.

More Related Content

Similar to Beautiful UI in react native By - nativebase.io

Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperFabrit Global
 
Building an Adaptive App in Ember
Building an Adaptive App in EmberBuilding an Adaptive App in Ember
Building an Adaptive App in EmberFeather Knee
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Michael Shrove
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationVu Tran Lam
 
Top 7 react developer tools to use in 2021
Top 7 react developer tools to use in 2021Top 7 react developer tools to use in 2021
Top 7 react developer tools to use in 2021WrapPixel
 
[React Native Tutorial] Lecture 6: Component, Props, and Network
[React Native Tutorial] Lecture 6: Component, Props, and Network[React Native Tutorial] Lecture 6: Component, Props, and Network
[React Native Tutorial] Lecture 6: Component, Props, and NetworkKobkrit Viriyayudhakorn
 
Components in Ionic Presentation (FrontEnd)
Components in Ionic Presentation (FrontEnd)Components in Ionic Presentation (FrontEnd)
Components in Ionic Presentation (FrontEnd)Knoldus Inc.
 
Assignment1 A 0
Assignment1 A 0Assignment1 A 0
Assignment1 A 0Mahmoud
 
IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st TutorialHassan A-j
 
Basics of expression blend4
Basics of expression blend4Basics of expression blend4
Basics of expression blend4Samson Tennela
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetnTOPS Technologies
 

Similar to Beautiful UI in react native By - nativebase.io (20)

Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
Building an Adaptive App in Ember
Building an Adaptive App in EmberBuilding an Adaptive App in Ember
Building an Adaptive App in Ember
 
adaptive_ember
adaptive_emberadaptive_ember
adaptive_ember
 
Jquery Mobile
Jquery MobileJquery Mobile
Jquery Mobile
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
 
Top 7 react developer tools to use in 2021
Top 7 react developer tools to use in 2021Top 7 react developer tools to use in 2021
Top 7 react developer tools to use in 2021
 
[React Native Tutorial] Lecture 6: Component, Props, and Network
[React Native Tutorial] Lecture 6: Component, Props, and Network[React Native Tutorial] Lecture 6: Component, Props, and Network
[React Native Tutorial] Lecture 6: Component, Props, and Network
 
Components in Ionic Presentation (FrontEnd)
Components in Ionic Presentation (FrontEnd)Components in Ionic Presentation (FrontEnd)
Components in Ionic Presentation (FrontEnd)
 
Assignment1 A 0
Assignment1 A 0Assignment1 A 0
Assignment1 A 0
 
IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st Tutorial
 
iOS storyboard
iOS storyboardiOS storyboard
iOS storyboard
 
Diving deep in compose.pdf
Diving deep in compose.pdfDiving deep in compose.pdf
Diving deep in compose.pdf
 
Chapter3 mo
Chapter3 moChapter3 mo
Chapter3 mo
 
Mobile Application Development class 003
Mobile Application Development class 003Mobile Application Development class 003
Mobile Application Development class 003
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Basics of expression blend4
Basics of expression blend4Basics of expression blend4
Basics of expression blend4
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetn
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
 

Recently uploaded

WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2
 
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 

Recently uploaded (20)

WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in Uganda
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 

Beautiful UI in react native By - nativebase.io

  • 1. Getting started with React Native: Building UI nativebase.io/
  • 2. Building Beautiful UI in React Native • Building a User Interface (UI) for mobile apps is more difficult than doing the same for a web app. The reasons for this are : • Mobile devices have limited screen size. • Each type of mobile device (tablets, smartphones etc) is different from the other and they all require various kinds of support. • Android and Apple have their own respective platform standards that a developer should follow. So an app built to work on Android devices will need its code to be changed in order to run on Apple devices.
  • 3. What is React Native? React Native is an open source JavaScript library that enables a developer to build cross-platform apps. Installation • Before we start building the UI, let’s make sure that you have installed React Native on your system. • Click here and follow the steps carefully. Once you have successfully installed React Native, we can get started with building an UI with the help of React Native.
  • 4. Let’s Take a Button Component This component has two parts: the caption which says “Awesome Button” and the blue box with rounded corners surrounding the caption. In React Native, the box is declared in <TouchableOpacity />and the caption is declared in <Text />.
  • 6. Style can be declared separately instead of doing it inside the class.
  • 7. How To Layout? Let’s try creating a Layout using React Native A screen has 3 basic parts: • Header • Content Area • Footer
  • 8. Layout • The Header and Footer are similar since they both need to have a fixed height, a background color with white text and the user should not be able to scroll them. • The content area, on the other hand should have fluid height so that the user can scroll in this area. • <View />is used for header and footer and <Scroll View />is used for content area. <Scroll View />is same as <View />with the exception that the user can scroll with <Scroll View />.
  • 9. The screen we get by writing the code shown on left would look something like image shown on right side
  • 10. Adding a color using component looks like this
  • 11. Few errors in alignment There are still a few errors in this screen. The content area is not properly visible and the header and footer text is at the side rather than at center. We use Flex box to align it properly . Flexbox To position elements on your screen, you can use Flexbox. Flexbox is a layout module based on CSS3
  • 12. Two parts of Layout • The layout is divided into two parts: Container and Items. • Flexbox has separate properties for containers and items. • Container properties like flex-direction, align-items and justify-content set the layout rules for the items inside the container.
  • 13. Flex Direction flex-direction defines the direction in which the items are placed in the container.
  • 14. Align-items align-items defines the default behaviour for how items are laid out along the cross axis on the current line.
  • 15. Justify-Content justify-content defines the alignment along the main axis. It helps distribute extra free space left over when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size.
  • 16. Align-Self 1. Item properties like align- self, flex, and aspect-ratio set the layout rules for a particular item in the container. Item properties take precedence over container properties. 2. align-self allows the default alignment (or the alignment set by a container property) to be overridden for an individual item.
  • 17. Usage of property Flex • By using the item property flex, which is a combination of flex-grow, flex-shrink, and flex-basis, our layout will now change , Use the align-items and justify-content property to bring your header and footer text to the center. • Our layout looks much better than what we had initially started with. But UI contains a lot more than just rectangular boxes and buttons.
  • 18. Icons • React Native has over 3000 icons which can be accessed from “react-native-vector- icons” package. • Writing this code will get above icon
  • 19. Custom Shapes We can also design custom shapes in React Native using the “react-native-svg” package. To get the shape of right end we will write our code as
  • 20. Adding UI elements • But is that all we need to build a beautiful UI? What about Tabs, Cards, Swiper…..? • Building apps using React Native would be much easier if there was a generic set of UI components. We knew this was essential since long back. • That’s why we built NativeBase, an open source UI components library for React Native.
  • 22. Takeaways Finally, we can summarize that: • Building UI in React Native is quite similar to the web. • Flexbox is necessary to build better layouts in React Native. • Using third party libraries like NativeBase can help you save time that is used for development in React Native.