@yozora/react-emphasis
v2.0.0-alpha.4
Published
render markdown emphasis in react
Downloads
58
Maintainers
Readme
This component is for rendering the Emphasis data produced by
@yozora/tokenizer-emphasis.
This component has been built into @yozora/react-markdown, you can use it directly.
Install
npm
npm install --save @yozora/react-emphasis
yarn
yarn add @yozora/react-emphasis
Usage
Basic:
import React from 'react' import Emphasis from '@yozora/react-emphasis' import '@yozora/react-emphasis/lib/esm/index.css' const wrapper = ( <Emphasis style={{ color: 'orange', fontSize: '16px' }}> some text1 <span>some text2</span> </Emphasis> )
Props
Name | Type | Required | Default | Description
:----------:|:---------------------:|:---------:|:-------:|:-------------
children
| React.ReactNode
| false
| - | Emphasis contents
className
| string
| false
| - | Root css class
style
| React.CSSProperties
| false
| - | Root css style
className
: The root element of this component will always bind with the CSS class'yozora-emphasis'