react-soccer-lineup
Install
npm install --save react-soccer-lineup
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
Team
Attribute | Type | Required | Default value | Description |
---|---|---|---|---|
squad |
Squad |
Yes | - | The team players by role |
style |
Style |
No | - | The team style |
Squad
Attribute | Type | Required | Default value | Description |
---|---|---|---|---|
gk |
Player |
No | - | The squad goalkeeper |
df |
Player[] |
No | - | The squad defenders |
cdm |
Player[] |
No | - | The squad central defensive midfielders |
cm |
Player[] |
No | - | The squad central midfielders |
cam |
Player[] |
No | - | The squad central attack midfielders |
fw |
Player[] |
No | - | The squad forwards |
Style
Player
Attribute | Type | Required | Default value | Description |
---|---|---|---|---|
name |
string |
No | - | The displayed player name |
number |
number |
No | - | The displayed player number |
color |
string |
No | The team color | The player color |
numberColor |
string |
No | The team number color | The player number color |
nameColor |
string |
No | The team players' name color | The player name color |
onCLick |
Function |
No | - | Callback to invoke when clicking on the player |
Live
Check a live example here.
License
MIT © giustini