File size: 715 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: Code
description: Used to display inline code
links:
  source: components/code
  storybook: typography-code--basic
  recipe: code
---

<ExampleTabs name="code-basic" />

## Usage

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

```jsx
<Code>Hello world</Code>
```

## Examples

### Sizes

Use the `size` prop to change the size of the code component.

<ExampleTabs name="code-with-sizes" />

### Variants

Use the `variant` prop to change the appearance of the code component.

<ExampleTabs name="code-with-variants" />

### Colors

Use the `colorPalette` prop to change the color scheme of the component.

<ExampleTabs name="code-with-colors" />

## Props

<PropTable component="Code" part="Code" />