Nativebase logo
NativeBase
Data Display
Typography
Disclosure
Media and Icons
Others
Center
Center is a layout component that centers its child within itself.
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 centers their children.
Playground
Props
Nativebase logo
MadeWithNativeBase