---
id: Code block
section: components
cssPrefix: pf-c-code-block
propComponents: ['CodeBlock', 'CodeBlockAction', 'CodeBlockCode']
---

import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';

## Examples

### Basic

```ts file="./CodeBlockBasic.tsx"
```

### Expandable

```ts file="./CodeBlockExpandable.tsx"
```
