Table of Contents
Code
Use Code to style and format inline fragments of computer code.
How to use it
Default
Use Code to style and format <code>
elements.
Color
You can also change background and text color.
Size
Code comes in small, medium, and large. By default, size is inherited from the parent element.
Configuration
- Name9.4.0•View source•View on npm
- Installnpm install @zendeskgarden/react-typography
- Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
- Importimport { Code } from '@zendeskgarden/react-typography'
API
Code
Extends HTMLAttributes<HTMLElement>
Prop name | Type | Default | Description |
---|---|---|---|
hue | 'grey' | 'red' | 'green' | 'yellow' | 'grey' | Applies color to the background and the text |
size | 'small' | 'medium' | 'large' | 'inherit' | 'inherit' | Adjusts the font size. By default font size is inherited from the surrounding text. |