GithubHelp home page GithubHelp logo

antony-hk / react-soccer-lineup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giustini/react-soccer-lineup

0.0 0.0 0.0 4.07 MB

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

Home Page: https://rsl-example.netlify.com/

HTML 4.79% JavaScript 59.61% TypeScript 23.23% SCSS 12.37%

react-soccer-lineup's Introduction

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

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

Prop Type Required Default value Description
color string No #588f58 #588f58 The pitch background color
size string No "normal" Pitch dimensions. Supported values: small, normal, big, responsive, fill
pattern string No - The pattern applied to the pitch grass. Supported values: lines, squares, circles
homeTeam Team No - The left side team
awayTeam Team No - The right side team

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

Attribute Type Required Default value Description
color string Yes #f08080 #f08080 (home) / #add8e6 #add8e6 (away) The team color
numberColor string Yes #ffffff #ffffff (home) / #333333 #333333 (away) The team number color
nameColor string No #ffffff #ffffff (home) / #333333 #333333 (away) The team players' name color

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.