Box is the most abstract component on top of which all other Chakra UI components are built. It renders the div element by default.
div
Here's an example of how to customize the navigation bar:
You can find this example code at
/koii.X/src/components/common/Nav/index.tsx, line 18
<Box bg="blue.500" px="4" color="white"> ... ...
In this Box component, it has bg, pxand color props, which control the background color, padding, and text color
bg
px
color
<Box bg="red.500" px="4" color="black"> ... ...
After changing blue.500 to red.500, you will notice the navigation color has changed. The same is true for color .
blue.500
red.500
You can also use HEX for color selector such as #171753 to choose your favorite color..
For more information and properties, check https://chakra-ui.com/docs/layout/boxarrow-up-right
Last updated 3 years ago