1.0.0 • Published 4 years ago

@jswork/react-figure v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-figure

A tiny figure image for react.

version license size download

installation

npm install -S @jswork/react-figure

properties

NameTypeRequiredDefaultDescription
classNamestringfalse-The extended className for component.
captionanyfalse-Default image caption.

usage

  1. 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: ()
  2. 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.