Snippet
Display a snippet of copyable code for the command line.
General
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
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
text | code snippet | string string[] | - | - |
type | snippet types | SnippetTypes | SnippetTypes | default |
filled | filled style | boolean | - | false |
width | set CSS string | string | - | initial |
copy | function of copy button | CopyTypes | CopyTypes | default |
symbol | symbol snippet | string | - | $ |
toastText | toast text | string | - | Copied to clipboard! |
toastType | toast type | ToastTypes | ToastTypes | success |
... | native props | HTMLAttributes | 'id', 'name', 'className', ... | - |
SnippetTypes
type SnippetTypes =
| 'default'
| 'secondary'
| 'success'
| 'warning'
| 'error'
| 'dark'
| 'lite'
CopyTypes
type CopyTypes = 'default' | 'silent' | 'prevent'
SnippetTypes
type SnippetTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
ToastTypes
type ToastTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
Contributors