Snippet

Display a snippet of copyable code for the command line.

General

Basic Usage

Width

Specify width manually.

Types

Show different states with colors.

Rounded

You can completely round the corners of any type of Snippet with the rounded property.

Multi Line

You can use multi line of the Snippet with the array in text prop.

Without Copy

Hide icon for copy. (disable copy)

Custom Symbol

You can custom symbol of the Snippet with the property symbol.

Custom Toast

You can custom toast of the Snippet with the property toastText and toastType.

Filled

Show different states filled with colors.

APIs

Snippet.Props

AttributeDescriptionTypeAccepted valuesDefault
textcode snippetstring string[]--
typesnippet typesSnippetTypesSnippetTypesdefault
filledfilled styleboolean-false
widthset CSS stringstring-initial
copyfunction of copy buttonCopyTypesCopyTypesdefault
symbolsymbol snippetstring-$
toastTexttoast textstring-Copied to clipboard!
toastTypetoast typeToastTypesToastTypessuccess
...native propsHTMLAttributes'id', 'name', 'className', ...-

SnippetTypes

type SnippetTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'

CopyTypes

type CopyTypes = 'default' | 'silent' | 'prevent'

ToastTypes

type ToastTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'
Edit this page on GitHub

Previous

Slider

Next

Spacer

MADE & DESIGNED WITHBY BRUNO ANDRADE
docs background gradient blue
docs background gradient violet