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

@domparty/fe

v0.0.81

Published

Our white-label front-end component library. Filled with functional components to help you kick-start your project πŸš€

Downloads

25

Readme

Domparty - Component library

A white label component library, ready for you to style. Unbiased on how styling should look on your website, while giving you the handles to kick-start you application with some helpful functional components.

Instructions

Install the component library using npm i @domparty/fe. This will make the library available for your project. Because @domparty/fe uses Goober internally to provide all neat CSS tricks, first implement our provider into your application.

Using Preact?

If you're more into speedy apps, we have also implemented a provider for you! Instead of importing the provider from @domparty/fe/core, import the provider from @domparty/fe/core/preact. This way your application is using the Pragma from Preact, instead of React.

Default React apps

For default React apps, the following snippet can be used.
use import { Provider } from '@domparty/fe/core/preact'; for Preact

import React from 'react';
import { Provider } from '@domparty/fe/core';

export default () => (
  <Provider value={{}}>
    <App />
  </Provider>
);

Next.js apps

To implement @domparty/fe into Next.js make sure the _app.js file implements the component.

import React from 'react';
import { Provider } from '@domparty/fe/core';

export default ({ Component, pageProps }) => (
  <Provider value={{}}>
    <Component {...pageProps} />
  </Provider>
);

SSR (server-side rendering)

To make sure all styles are rendered correctly on the server. The component library exports Goobers' extractCss function for you to implement.

To use this feature in Next.js apps, make sure the getInitialProps in your _document file uses this function.

import Document, { Head, Main, NextScript } from 'next/document';
import { extractCss } from '@domparty/fe/core';

export default class MyDocument extends Document {
  static getInitialProps({ renderPage }) {
    const page = renderPage();

    // Extrach the css for each page render
    const css = extractCss();
    return { ...page, css };
  }

  render() {
    return (
      <html>
        <Head>
          <style
            id={'_goober'}
            // And defined it in here
            dangerouslySetInnerHTML={{ __html: this.props.css }}
          />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </html>
    );
  }
}

License

MIT