Display a snippet of copyable code for the command line.
Basic usage.
Specify width manually.
Show different states with colors.
Hide icon for copy. (disable copy)
Snippet.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
text | code snippet | string Array<string> | - | - |
type | snippet types | SnippetTypes | SnippetTypes | default |
filled | filled style | boolean | - | false |
width | set CSS string | string | - | initial |
copy | function of copy button | CopyTypes | 'default', 'slient', 'prevent' | default |
symbol | symbol snippet | string | - | $ |
toastText | toast text | string | - | Copied to clipboard! |
toastType | toast type | NormalTypes | NormalTypes | success |
... | native props | HTMLAttributes | 'id', 'name', 'className', ... | - |
SnippetTypes
type SnippetTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error' | 'dark' | 'lite'
NormalTypes
type NormalTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'