Package that neatly displays yml in a code block
npm install --save yaml-code-block
import React, { Component } from 'react'
import YamlCodeBlock, { YamlCodeBlockProps } from 'YamlCodeBlock'
yamlData,
(showLineNumbers = false),
(font = 'monospace'),
(fontColor = '#3f515f'),
(backgroundColor = '#f0f0f0')
class Example extends Component {
inputProps: YamlCodeBlockProps = {
yamlData = myData,
showLineNumbers = true, // Optional
font = 'monospace', // Optional
fontColor = '#3f515f', // Optional
backgroundColor = '#f0f0f0' // Optional
}
render() {
return <YamlCodeBlock {...inputProps} />
}
}
Explore our components in Storybook: View Storybook
MIT © JosephBarkate