Center | NativeBase | Universal Components for React and React Native

Search
K
Hire us
Data Display
Typography
Disclosure
Media and Icons
Others
If you are starting a new project, please try gluestack-ui for better performance and new design.
Center
Center aligns its contents to the center within itself. It is a layout component.
Show Code
Playground
Import
Copy
import { Center, Square, Circle } from 'native-base';
Center: Centers its child, pass width and height
Square: Center but we need to pass size (width and height)
Circle: Center with round borderRadius, pass size (width and height)
Examples
Basic
Put any child element inside it, give it any width or/and height. It'll ensure the child is centered.
Playground
Icon frames
Center can be used to nicely position icons in the center and add frames around them.
Playground
Square and Circle
Square and Circle automatically center their children.
Playground
Props
Nativebase logo
MadeWithNativeBase