@yozora/react-image
v2.0.0-alpha.4
Published
render markdown image in react
Maintainers
Readme
This component is for rendering the Image data produced by
@yozora/tokenizer-image.
This component has been built into @yozora/react-markdown, you can use it directly.
Install
npm
npm install --save @yozora/react-imageyarn
yarn add @yozora/react-image
Usage
Basic:
import React from 'react' import Image from '@yozora/react-image' import '@yozora/react-image/lib/esm/index.css' const wrapper = (<Image src="https://avatars.githubusercontent.com/u/42513619" />)
Props
Name | Type | Required | Default | Description
:----------:|:---------------------:|:---------:|:-------:|:-------------
alt | string | false | #src | Image alt
className | string | false | - | Root css class
src | string | true | - | Image src
style | React.CSSProperties | false | - | Root css style
title | string | false | - | Image title
className: The root element of this component will always bind with the CSS class'yozora-image'.
