JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q38700F
  • License

A React component to render LEGO bricks

Package Exports

  • react-legos

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-legos) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-legos

screen shot 2017-12-19 at 11 57 11 pm

Try it out in Storybook.

Make a LEGO brick!

import Brick, { shapes } from 'react-legos'

...

<Brick shape=shapes['twoByFour'] />

Props

Prop Default Description
shape The shape of the brick. A grid of true/false values to determine if the index is a space or filled.
size medium The size of the brick: small, medium, large or xLarge.
style Optional style param, useful for z-indexing and placing bricks on top of one another.
placement Style params to set on the brick, specific to the location of the brick on the page.
color random The color of the brick, chosen from lib/colors.js. If not specified, will render a random color from said list. Colors taken from this list.

Issues

If you find any issues with this component, please report them!

Note

LEGO and the LEGO logo are trademarks and/or copyrights of the LEGO Group. This is not at all affiliated with The LEGO Group, and was simply a project of mine using the LEGO name as a proprietary eponym.