525

Snippet

A component for showing a short, copyable, command or phrase.

Installation

Usage

Variants

It defaults to outline but can also be primary, secondary, or destructive.

Multiline

You can have multiple lines for multiple commands.

Overflow

It also handles overflows nicely, allowing users to scroll the text, and showing them faded edges where there is more to see (in supported browsers).

API Reference

Snippet

The root component for displaying a code snippet with copy functionality.

PropTypeDefault
variant?
enum default
text?
string | string[] -
class?
string -
onCopy?
function -