New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-soccer-lineup

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-soccer-lineup

A soccer pitch representation component for React

latest
Source
npmnpm
Version
1.0.0-beta.10
Version published
Weekly downloads
209
20.81%
Maintainers
1
Weekly downloads
 
Created
Source
React Soccer Lineup

React Soccer Lineup

⚽ A soccer pitch representation component for React ⚛️

NPM JavaScript Style Guide npm

Install

npm install react-soccer-lineup

Basic usage

import SoccerLineUp from 'react-soccer-lineup';

function App () {
    return <SoccerLineUp />;
}

Render teams

import SoccerLineUp, { type Team } from 'react-soccer-lineup';

function App () {
    const homeTeam: Team = {
      squad: {
        gk: { number: 1 },
        df: [{ number: 2 }, { number: 4 }, { number: 5 }, { number: 3 }],
        cm: [{ number: 11 }, { number: 6 }, { number: 8 }, { number: 7 }],
        fw: [{ number: 9 }, { number: 10 }]
      },
      style: {
        borderColor: '#333333'
      }
    };
    
    const awayTeam: Team = {
      squad: {
        gk: { number: 1 },
        df: [{ number: 2 }, { number: 4 }, { number: 5 }, { number: 3 }],
        cm: [{ number: 6 }, { number: 8 }, { number: 10 }],
        fw: [{ number: 11 }, { number: 9 }, { number: 7 }]
      },
      style: {
        borderColor: '#ffffff'
      }
    };
    
    return (
        <SoccerLineUp
          size='responsive'
          color='#327D61'
          pattern='squares'
          homeTeam={homeTeam}
          awayTeam={awayTeam}
        />
    );
}

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
orientationstringNo'horizontal'The pitch orientation. Supported values: horizontal, vertical
homeTeamTeamNo-The home team
awayTeamTeamNo-The away 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
colorstringNo#ffffff #ffffff (home) / #333333 #333333 (away)The team color
borderColorstringNo#ffffff #ffffff (home) / #333333 #333333 (away)The team border color
numberColorstringNo#333333 #333333 (home) / #ffffff #ffffff (away)The team number color
numberBackgroundColorstringNo-The team number background color
patternstringNo'none'The team jersey pattern
patternColorstringNo-The team jersey pattern color
nameColorstringNo#333333 #333333 (home) / #ffffff #ffffff (away)The team players' name color
nameBackgroundColorstringNo-The team players' name background color

Player

AttributeTypeRequiredDefault valueDescription
namestringNo-The displayed player name
numbernumberNo-The displayed player number
styleStyleNoThe team styleThe player style
offsetPlayerOffsetNo-The player position offset
onCLickFunctionNo-Callback to invoke when clicking on the player

PlayerOffset

AttributeTypeRequiredDefault valueDescription
xnumberNo0The horizontal offset
ynumberNo0The vertical offset

Live

Check the playground here.

FAQs

Package last updated on 18 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts