This package has been deprecated

Author message:

Superseded by @fdmg/design-system. See: https://github.com/FDMediagroep/fd-design-system

@fdmg/ts-react-image-button
TypeScript icon, indicating that this package has built-in type declarations

1.0.26 • Public • Published

fdmg-ts-react-image-button

Build Status Coverage Status npm version Greenkeeper badge

ReactJS ImageButton component. This component renders an image with onClick hook.

Installation

  • Run npm i --save-dev @fdmg/ts-react-image-button

or

  • Run yarn add @fdmg/ts-react-image-button --dev

Usage

TypeScript

import * as React from 'react';
import ImageButton from 'fdmg-ts-react-image-button';

export default class foo {
    public state: any;
    public props: any;

    constructor(props: any) {
        super(props);
        this.props = props;
    }

    clickHandler() {
        console.info('Image button clicked');
    }

    render() {
        return (
            <ImageButton
                src={"img/button.svg"} 
                onClick={this.clickHandler.bind(this)}
                className="image-btn btn"
                alt="Special button"
            />
        );
    }
}

Resulting HTML

<span class="image-btn btn"
      role="button"
      tabIndex="0"
      aria-label="Special button">
    <img alt="Special button" src="img/button.svg"/>
</span>

Readme

Keywords

none

Package Sidebar

Install

npm i @fdmg/ts-react-image-button

Weekly Downloads

1

Version

1.0.26

License

ISC

Unpacked Size

161 kB

Total Files

13

Last publish

Collaborators

  • dirk-straat
  • willem_liu
  • sapulidi