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

react-botw-grid-menu

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-botw-grid-menu

Zelda: Breath of the wild inventory components

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

react-botw-grid-menu

A react component for rendering a Breath of the Wild style inventory menu.

NPM JavaScript Style Guide

Contents


Install

npm install --save react-botw-grid-menu

Peer Dependencies;

  • React v16 +

Usage

import React, { Component } from 'react'

import { BotwGridMenu } from 'react-botw-grid-menu'

class Example extends Component {
  render() {
    return (
      <BotwGridMenu 
        items={[
          {
            id: "apple",
            name: "Apple",
            quantity: 159,
            icon: <i className="fa fa-apple" />,
            note: "A scrumptious apple.\r\nEat it to restore some hearts.",
          },
          {
            id: "bug",
            name: "Bug",
            quantity: 2,
            icon: <i className="fa fa-bug" />,
            note: "Yum"
          }
        ]}
      />
    )
  }
}

Example usage at https://darylbuckle.github.io/react-botw-menu-components.

Props

BotwGridMenu

PropertyTypeDefaultMandatoryDescription
itemsbotwItem[]trueThe data to display in the grid. View the props for botwItem below.
pageSizenumber20falseThe maximum number of items per page.
pagenumberfalseThe current page number. Specify if you wish to control pagination, otherwise it'll be handled automatically.
loadingbooleanfalsefalseIf true a loading indicator will be displayed. Use when loading ASynchronously.
fillPageWithEmptiesbooleantruefalseWhen this is true the page will be filled with empties.
columnCountnumber?undefinedfalseWhen specified, this number of columns will show. Otherwise the columns will fit the container.
onPageChanged(page) => voidfalseA callback for when navigating to a different page.
onItemActive(item) => voidfalseA callback for when hovering over an item.
onItemInactive(item) => voidfalseA callback for when exiting hover.
onItemSelected(item) => voidfalseA callback for clicking on an item.

botwItem class

PropertyTypeDefaultMandatoryDescription
idstringtrueUnique identifier for the item.
namestringtrueThe name of the item.
quantitynumberfalseQuantity of the item.
imgSrcstringfalseSrc of the image.
iconanyfalseAlternative to ImgSrc. Allows JSX to be used for the image (e.g )
emptybooleanfalsefalseWhether to show an empty item.

License

MIT © DarylBuckle 2020

FAQs

Package last updated on 11 Dec 2020

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