0.4.3 • Published 3 years ago

react-soccer-lineup v0.4.3

Weekly downloads
28
License
MIT
Repository
github
Last release
3 years ago

react-soccer-lineup

⚽ React Soccer Line up - A soccer pitch representation component for React ⚛️

NPM JavaScript Style Guide npm

Install

npm install --save react-soccer-lineup

npm.io

Usage

import React, { Component } from 'react'

import SoccerLineUp from 'react-soccer-lineup'


class Example extends Component {

    render () {

        return (
            <SoccerLineUp
              size={ "small" }
              color={ "lightseagreen" }
              pattern={ "lines" }
            />
        )

    }
}

API

PropTypeRequiredDefault valueDescription
colorstringNo#588f58 #588f58The pitch background color
sizestringNo"normal"Pitch dimensions. Supported values: small, normal, big, responsive, fill
patternstringNo-The pattern applied to the pitch grass. Supported values: lines, squares, circles
homeTeamTeamNo-The left side team
awayTeamTeamNo-The right side team

Team

AttributeTypeRequiredDefault valueDescription
squadSquadYes-The team players by role
styleStyleNo-The team style

Squad

AttributeTypeRequiredDefault valueDescription
gkPlayerNo-The squad goalkeeper
dfPlayer[]No-The squad defenders
cdmPlayer[]No-The squad central defensive midfielders
cmPlayer[]No-The squad central midfielders
camPlayer[]No-The squad central attack midfielders
fwPlayer[]No-The squad forwards

Style

AttributeTypeRequiredDefault valueDescription
colorstringYes#f08080 #f08080 (home) / #add8e6 #add8e6 (away)The team color
numberColorstringYes#ffffff #ffffff (home) / #333333 #333333 (away)The team number color
nameColorstringNo#ffffff #ffffff (home) / #333333 #333333 (away)The team players' name color

Player

AttributeTypeRequiredDefault valueDescription
namestringNo-The displayed player name
numbernumberNo-The displayed player number
colorstringNoThe team colorThe player color
numberColorstringNoThe team number colorThe player number color
nameColorstringNoThe team players' name colorThe player name color
onCLickFunctionNo-Callback to invoke when clicking on the player

Live

Check a live example here.

License

MIT © giustini

0.4.1

3 years ago

0.4.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago