npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webbteamet-components

v1.5.0

Published

This is a library of styled and unstyled components we can import and use when we are building WebApps for our projects.

Downloads

9

Readme

Webbteamet Components

This is a library of styled and unstyled components we can import and use when we are building WebApps for our projects.

The goal is that we also easily can create new components for this library, to expand and improve it in the future.

Add component to your project

If you want to use one of the already created component in your project, here's how you install the package and add a component:

  1. Add webbteamet-components to your dependencies:
npm install webbteamet-components
  1. Import the component to your code:
import { DatePicker } from 'webbteamet-components'

const App = () => {
   return <DatePicker />
}

Development

Fork this repo

You can fork this repo by clicking the fork button in the top right corner of this page.

Navigate to project directory

cd webbteamet-components

Create a new Branch

git checkout -b my-new-branch

Create a new Branch

npm install

Run Storybook

Run npm run storybook and the local development server should open on http://localhost:6006 in your browser


Creating new components

If you want to create a new component to expand on this library, we got a script that adds some boilerplate for your convenience.

  1. Run npm run new-component <MyComponent>. This will create a folder in .src/components/MyComponent containing the necessary files: MyComponent.tsx, MyComponent.stories.tsx, MyComponent.css, index.ts,

  2. Work with the component and the related story, see detailed documentation for each file further down in this README

  3. Run npm run build-storybook to build Storybook as a static web application. The static web application of this library can be found in /storybook-static

  4. Run npm run build-rollup to compile the components and ready them for export. The files will be compiled in the folder /lib

  5. Increase the version in package.json and run npm publish to publish the new version to npm using the CLI. For further documentation on publishing with npm, read more at npm-publish | npm Docs


MyComponent.tsx

This is a regular React Component. To read more about React component and the basics: Quick Start - React

MyComponent.stories.tsx

To read more about what a story is, and how it works: What's a story? - Storybook docs

MyComponent.css

This styling is automatically imported to the component. Currently, vanilla CSS is used. In the future, SASS will be supported.

index.ts

This file exports the folder content, so it can be used when installing the npm package containing the components.


Pull request

Create a pull request against the main repository. After that, your pull request containing the new component will be approved or denied. If approved, the component will be added to the npm package and be ready to use.

Roadmap

Here is a roadmap for future improvement for Webbteamet Components:

  • [x] The script npm run new-component automatically adds the file to ./src/index.ts for export
  • [x] The new component name is added to the boilerplate code
  • [ ] Automatic deployment to github-pages
  • [ ] SASS support for components
  • [ ] Add testing
  • [ ] Support for importing individual components