# Code

Display a snippet of code with syntax highlighting.

---

## Default

```tsx
import { Code } from '@vercel/geistcn/components';
import type { JSX } from 'react';

const codeExampleTsx = `import { Snippet } from '@vercel/geistcn/components';
import type { JSX } from 'react';

export function Component(): JSX.Element {
  return <Snippet text="npm init next-app" width="300px" />;
}`;

export function Component(): JSX.Element {
  return <Code syntax="javascript">{codeExampleTsx}</Code>;
}
```
