react-figure
A tiny figure image for react.
installation
npm install -S @jswork/react-figure
properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | - | The extended className for component. |
caption | any | false | - | Default image caption. |
usage
- import css
@import "~@jswork/react-figure/dist/style.css";
// or use sass
@import "~@jswork/react-figure/dist/style.scss";
// customize your styles:
$react-figure-options: ()
- import js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import NxRandomAvatar from '@jswork/next-random-avatar';
import ReactFigure from '@jswork/react-figure';
import './assets/style.scss';
class App extends React.Component {
render() {
return (
<ReactDemokit
className="p-3 app-container"
url="https://github.com/afeiship/react-figure">
<ReactFigure caption="test picture">
<img src={NxRandomAvatar.lego()} alt="" />
</ReactFigure>
</ReactDemokit>
);
}
}
ReactDOM.render(<App />, document.getElementById('app'));
documentation
license
Code released under the MIT license.