1.0.10 • Published 8 years ago

fdmg-ts-react-linked-image v1.0.10

Weekly downloads
14
License
ISC
Repository
github
Last release
8 years ago

Build Status Coverage Status

npm version

fdmg-ts-react-linked-image

ReactJS LinkedImage component. This component renders an image with a link.

Installation

  • Run npm i --save-dev fdmg-ts-react-linked-image

or

  • Run yarn add fdmg-ts-react-linked-image --dev

Usage

TypeScript

import * as React from 'react';
import LinkedImage from 'fdmg-ts-react-linked-image';

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

    constructor(props: any) {
        super(props);
        this.props = props;
    }
    
    clickHandler(event) {
        console.info('Clicked');
    }

    render() {
        return (
            <LinkedImage
                className="css-class-name"
                target="newWindow"
                src={'image.png'}
                href={'https://fd.nl'}
                onClick={this.clickHandler.bind(this)}
                alt="FD.nl logo"
                ariaLabel="Shows this text as aria-label or uses alt text when this props is not set"
            />
        );
    }
}

Resulting HTML

<a href="https://fd.nl" target="newWindow" class="css-class-name" aria-label="Shows this text as aria-label or uses alt text when this props is not set">
    <img src="image.png" alt="FD.nl logo"/>
</a>
1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago