@ludum-dare-badges/react

React bindings for ludum-dare-badges

Usage no npm install needed!

<script type="module">
  import ludumDareBadgesReact from 'https://cdn.skypack.dev/@ludum-dare-badges/react';
</script>

README

@ludum-dare-badges/react

img img img img img

Display Ludum Dare Game Jam results in React.

Live Demo

Note: This project is community made and not endorsed by the offical Ludum Dare creator(s).

Installation

Yarn

yarn add @ludum-dare-badges/react

npm

npm install @ludum-dare-badges/react

Usage

import React from 'react'
import Widget from '@ludum-dare-badges/react'

const App = () => (
  <Widget game="44/alien-e-x-p-a-n-s-i-o-n" />
)

Simply add the game widget to the React application using JSX.

The React component will simply call @ludum-dare-badges/api to obtain the results badge.

Props

Game

The namespace of the game on the ldjam site Required

game requires both the Ludum Dare number and the game title (eg. 44/alien-e-x-p-a-n-s-i-o-n for Ludum Dare 44)

Type

The image format type to display the badge as. Default: svg

Can be either svg or png.

svg is recommended for better font rendering.

Type

The host of the API. Default: https://badges.vandoorn.ca

Likely only set in the case that the API is self-hosted.