Fantasy Baseball UI is a React-based user interface for displaying various components related to fantasy baseball, such as top stories, scoreboards, standings, and player stats. This project leverages modern web technologies like TypeScript, Tailwind CSS,
npm install fantasy-baseball-uiFantasy Baseball UI is a React-based user interface for displaying various components related to fantasy baseball, such as top stories, scoreboards, standings, and player stats. This project leverages modern web technologies like TypeScript, Tailwind CSS, and Vite for a seamless development experience.
- Installation
- Components
- Usage
- Building and Publishing
- License
To get started with the project, clone the repository and install the dependencies:
``bash`
git clone https://github.com/yourusername/fantasy-baseball-ui.git
cd fantasy-baseball-ui
npm install
The project includes several reusable components, each with its own stories for Storybook:
- TopStory: Displays a top story with an image, headline, and description.
- Scoreboard: Shows the scoreboard for a match, including team logos, names, records, and scores.
- Standings: Displays the standings of teams in a division.
- LatestNews: Lists the latest news items with images and links.
- PlayerStats: Shows the statistics of players.
- PlayerStats: Shows the statistics of players.
To use the components from the Fantasy Baseball UI library in your project, follow these steps:
1. Install the library: If you haven't already, install the library using npm or yarn.
`bash`
npm install fantasy-baseball-ui
2. Use the components: Use the imported components in your JSX.
`typescript
import React from 'react';
import { TopStory, Scoreboard, Standings, LatestNews, PlayerStats } from 'fantasy-baseball-ui';
const App: React.FC = () => {
return (
export default App;
`
To develop and test the components, use Storybook. Start the Storybook server with:
`bash`
npm run storybook`
orbash`
yarn storybook
To build the library, run:
`bash`
npm run build
or
`bash`
yarn build
This will generate the distribution files in the dist directory.
To publish a new version of the library:
1. Update the version number in package.json.
2. Build the package.
3. Publish to npm.
`bash``
npm version patch # or minor/major
npm run build
npm publish
This project is licensed under the MIT License.