Box

If you're looking for a flexible component to help with low-level layout needs, the Box component might be just what you need. With its customizable styles and props, it can be used to create a wide range of UI elements, from simple containers to complex layout structures.
Installation
This is an illustration of Box component.
<Box bg="$primary500" p="$5">
<Text color="$text0">This is the Box</Text>
</Box>

Installation

Step 1: Copy and paste the following code into your project.

import { View } from "react-native"
import { styled } from "@gluestack-style/react"
const StyledRoot = styled(View, {})
export const Box = StyledRoot

Step 2: Update the import paths to match your project setup.

To use this component in your project, include the following import statement in your file.
import { Box } from "@/components/ui/Box"
export default () => <Box />

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Box

It inherits all the properties of React Native's View component.
Edit this page on GitHub