created:3/5/2021
updated:3/5/2021
loc
48
comments
13%
passed
14
coverage
33%
Source
Syntax highliting source code component. Uses prism for the actual source display.
export const sample = () => {const [state, setState] = React.useState(false);return (<BooleanEditorname="prop"onChange={(name, newVal) => setState(newVal)}prop={{ type: ControlTypes.BOOLEAN, value: state }}/>);};
Name | Description | Default | Controls |
---|---|---|---|
children | source code to be displayed. (string & (boolean | ReactChild | ReactFragment | ReactPortal | null)) | ||
language | source lnguage used, by default "jsx". markupbashclikeccppcssjavascriptjsxcoffeescriptactionscriptcss-extrdiffgitgographqlhandlebarsjsonlessmakefilemarkdownobjectivecocamlpythonreasonsassscsssqlstylustsxtypescriptwasmyaml | - | |
dark | used to specify a "dark" color theme - applcable only if no custom theme prop is provided. if dark: true, duotoneDark theme is used. if dark: false, duotoneLight theme is used. boolean | - |
Name | Description | Default | |
---|---|---|---|
ActionContainerProps(2 properties) | |||
actions | optional actions provided to the component ActionItem[] | - | |
plain | if plain, skip the border and spacing around the children boolean | - | |
SyntaxHighlighterProps(9 properties) |
14 commits
package | imports | peer |
---|---|---|
copy-to-clipboard ^3.2.1 | copy | |
react ^17.0.1 | useStateMouseEventFC | * |
theme-ui ^0.8.4 | jsx |
file | imports |
---|---|
"../SyntaxHighlighter" | SyntaxHighlighterSyntaxHighlighterProps |
"../ActionContainer" | ActionContainerActionContainerProps |
export const sample = () => {const [state, setState] = React.useState(false);return (<BooleanEditorname="prop"onChange={(name, newVal) => setState(newVal)}prop={{ type: ControlTypes.BOOLEAN, value: state }}/>);};