1.0.2 • Published 3 years ago

react-librarything-shelf v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

react-librarything-shelf

build CodeQL Maintainability Rating Coverage

This React component allows you to display a user's LibraryThing books in a React application. It's a lot like the LibraryThing JavaScript widget, but allows for more customization, and React-like usage.

Demo

Storybook demo page

Example image

Installation

npm install --save react-librarything-shelf

or

yarn add react-librarything-shelf

Usage

import React from "react";
import { LibrarythingBookshelf } from "react-librarything-shelf";

export default function App() {
	return (
		<LibrarythingBookshelf userId="USER_ID_HERE" apiKey="API_KEY_HERE" />
	);
}

Customization

You can also set some options as supported by the Goodreads API:

OptionTypeDescriptionDefault
sortstringThe order in which to sort the results returnedentry_REV
maxnumberThe maximum number of books to be returned10
showDetailsbooleanShow the author and titlefalse
reviewsOnlybooleanShow only books with reviewfalse
tagListstringComma-separated tags to filter by""
widthnumberMinimum width allowed for each book100
detailsbooleanWhether to show book details like book title, author, and summaryfalse

Development

  • yarn start to watch changes and build
  • yarn storybook to launch storybook for testing