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.

chakra ui pro

Import#

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

Usage#

Hello world
Editable Example

Colors#

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

console.log(welcome)var chakra = 'awesome!'npm install chakra
Editable Example

Props#

NameTypeDescriptionDefault
colorScheme"blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "whiteAlpha" | "blackAlpha" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram""gray"
sizestringSizes for Code are not implemented in the default theme. You can extend the theme to implement them.-
variant"outline" | "solid" | "subtle""subtle"