Snippet

Display a snippet of copyable code for the command line.

Default

Basic usage.

width

Specify width manually.

types

Show different states with colors.

Multi Line

without copy

Hide icon for copy. (disable copy)

custom symbol

custom toast

filled

APIs

Snippet.Props

AttributeDescriptionTypeAccepted valuesDefault
textcode snippetstring Array<string>--
typesnippet typesSnippetTypesSnippetTypesdefault
filledfilled styleboolean-false
widthset CSS stringstring-initial
copyfunction of copy buttonCopyTypes'default', 'slient', 'prevent'default
symbolsymbol snippetstring-$
toastTexttoast textstring-Copied to clipboard!
toastTypetoast typeNormalTypesNormalTypessuccess
...native propsHTMLAttributes'id', 'name', 'className', ...-

SnippetTypes

type SnippetTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error' | 'dark' | 'lite'

NormalTypes

type NormalTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'