0.3.59 • Published 5 days ago
@synerise/ds-code-snippet v0.3.59
id: code-snippet
title: CodeSnippet
CodeSnippet UI Component
Installation
npm i @synerise/ds-code-snippet
or
yarn add @synerise/ds-code-snippet
Usage
import CodeSnippet from '@synerise/ds-code-snippet'
<CodeSnippet type={'single-line'} >
{"code"}
</CodeSnippet>
Demo
API
Property | Description | Type | Default |
---|---|---|---|
type | Defines the type of the codesnippet | CodeSnippetType | INLINE |
className | Class name for main CodeSnippet's container | string | - |
children | CodeSnippet's content | string | "" |
tooltipHint | Defines the text | string | 'Copy' |
labelBeforeExpanded | Defines the text of button before expand | string | 'Show more' |
labelAfterExpanded | Defines the text of button after expand | string | 'Show less' |
tooltipTitleHover | Tooltip title on hover | string | 'Copy' |
tooltipTitleClick | Tooltip title on click | string | 'Copied!' |
fontSize | Defines the size for single block | FontSize | 'small' |
colorSyntax | Specify when use color syntax | boolean | false |
languages | Array of langugages defined for color syntax | LanguageHighlight[] | 'javascript', 'typescript', 'json' |
rows | Specify the number of visible lines before expand | number | 6 |
wrap | Specify whether content is wrap or not | boolean | false |
onExpand | An extra function to invoke on button click expand content | () => void | - |
onCopy | An extra function to invoke on copy button event | () => void | - |
0.3.59
5 days ago
0.3.58
11 days ago
0.3.57
13 days ago
0.3.56
1 month ago
0.3.55
2 months ago
0.3.54
2 months ago
0.3.53
2 months ago
0.3.52
2 months ago
0.3.51
3 months ago
0.3.50
3 months ago
0.3.49
3 months ago
0.3.48
3 months ago
0.3.47
4 months ago
0.3.46
4 months ago
0.3.45
4 months ago
0.3.44
5 months ago
0.3.43
5 months ago
0.3.42
6 months ago
0.3.31
10 months ago
0.3.39
7 months ago
0.3.38
7 months ago
0.3.37
7 months ago
0.3.36
8 months ago
0.3.35
8 months ago
0.3.34
9 months ago
0.3.33
9 months ago
0.3.32
9 months ago
0.3.41
6 months ago
0.3.40
7 months ago
0.3.30
11 months ago
0.3.29
11 months ago
0.3.28
12 months ago
0.3.27
12 months ago
0.3.26
1 year ago
0.3.25
1 year ago
0.3.24
1 year ago
0.3.23
1 year ago
0.3.22
1 year ago
0.3.21
1 year ago
0.3.20
1 year ago
0.3.19
1 year ago
0.3.18
1 year ago
0.3.17
2 years ago
0.3.16
2 years ago
0.3.15
2 years ago
0.3.14
2 years ago
0.3.13
2 years ago
0.3.10
2 years ago
0.3.9
2 years ago
0.3.8
2 years ago
0.3.7
2 years ago
0.3.6
2 years ago
0.3.5
2 years ago
0.3.4
2 years ago
0.3.0
3 years ago
0.3.2
2 years ago
0.3.1
3 years ago
0.3.3
2 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.0
3 years ago
0.0.1
3 years ago