0.2.0 • Published 4 years ago

@evanoc/component-library v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Component Library

License

A library of custom UI components. Currently there is:

  • ScrollProgressBar - a scroll bar that fills up as you scroll over an element

Usage

These components were written to be used with Preact and Parcel-bundler.

Before you can use them, you must have postcss-modules installed (See parcel's reference on Post CSS)

  npm install --save-dev preact parcel-bundler postcss postcss-modules

You can import the component in any of these ways:

  import * from "@evanoc/component-library";
  import { Component1, Component2/*, etc... */ } from "@evanoc/component-library";
  import ScrollProgressBar from "@evanoc/component-library/ScrollProgressBar";

Development

Setup

Run the provided setup script (I use zsh, but bash works too):

  zsh ./setup.sh

Examples

To see an example of each component in the library: 1. Install devDependencies (with npm i -D, or npm install --save-dev), 2. Run npm run example

Toubleshooting

Error: Property 'refs' is missing in type '...' but required in type 'ElementClass'.

This is a common problem when using typescript and preact. It is caused by @types/react being installed and superceding the preact type definitions. The solution is to find the @types/react module in node_modules and delete it.


© 2020 Evan O'Connor

0.2.0

4 years ago

0.1.0

4 years ago