Code

Code is a component used to display inline code. It is composed from the Box component with a font family of `mono` for displaying code.

Source@chakra-ui/layout

Import#

import { Code } from '@chakra-ui/react'

Usage#

<Code>Hello world</Code>

Colors#

You can change the color scheme of the component by passing the colorScheme prop.

<Stack direction='row'>
<Code children='console.log(welcome)' />
<Code colorPalette='red' children="var chakra = 'awesome!'" />
<Code colorPalette='yellow' children='npm install chakra' />
</Stack>
Edit this page on GitHub

Proudly made inNigeria by Segun Adebayo

Deployed by â–² Vercel