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

minerva-ui

v9.0.0

Published

Composable, Simple React Base Components

Downloads

104

Readme

npm size license

Documentation

Edit minerva-ui-demo

Get started

Minerva UI is a reusable component library to help build UIs faster. This library aims to be highly composable, declarative and accessible.

Install

npm install --save minerva-ui or yarn add minerva-ui

Goals:

  • Highly Composable
  • Easy to customize

Usage

First add the <ThemeProvider /> and <GlobalStyles /> to the root of your app:

GlobalStyles is optional but highly recommended, it includes the CSS reset and styles from Tailwind CSS.

const App = () => (
  <ThemeProvider>
    {/* optional but recommended */}
    <GlobalStyles />
  </ThemeProvider>
)

Then import components you want into your UI:

import { Checkbox } from 'minerva-ui';

And use them:

() => {
  const [checked, setChecked] = React.useState(false);
  return (
    <Checkbox
      checked={checked}
      onChange={() => setChecked(!checked)}
    >
      Stay Logged In
    </Checkbox>
  )
}

Utility Props

Utility props are provided as aliases for most components. The style is heavily influenced by Tailwind CSS.

For example:

() => (
  <>
    {/* enter a custom pixel value */}
    <Button fontSize="12px">Save</Button>
    {/* or enter the value named "sm" in the theme, which is .875rem by default */}
    <Button fontSize="lg">Save</Button>
  </>
)

Styling Props Example

Here's the "Card" example by Tailwind recreated using this API:

() => (
  <Flex
    flexDirection="column"
    boxShadow="lg"
    borderRadius="md"
    maxWidth="24rem"
    overflow="hidden"
  >
    <img
      src="https://tailwindcss.com/img/card-top.jpg"
      alt="Sunset in the mountains"
    />
    <Flex flexDirection="column" px={6} py={4}>
      <Text fontWeight="bold" fontSize="xl" mb={2} color="gray.700">The Coldest Sunset</Text>
      <Text color="gray.700" lineHeight="normal">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</Text>
    </Flex>
    <Flex px={6} py={4}>
      <Block color="gray.700" bg="gray.200" borderRadius="full" px={3} py={1} mr={2}>
        #photography
      </Block>
      <Block color="gray.700" bg="gray.200" borderRadius="full" px={3} py={1} mr={2}>
        #travel
      </Block>
      <Block color="gray.700" bg="gray.200" borderRadius="full" px={3} py={1}>
        #winter
      </Block>
    </Flex>
  </Flex>
)

Once you've settled on your styles, you can then easily extract components into your own custom components without sacrificing control:

// make sure to pass children and "forward" all props to your component
const Tag = ({ children, ...props }) => (
  <Block color="gray.700" bg="gray.200" borderRadius="full" px={3} py={1} {...props}>
    {children}
  </Block>
)

render(
  <Flex>
    <Tag>High Priority</Tag>
    {/* by passing props down we can still style our custom component */}
    <Tag bg="indigo.600" color="#fff" ml={2}>Customized Tag</Tag>
  </Flex>
);

Local Development

  1. Clone Repo
  2. Run yarn install
  3. Run yarn lerna bootstrap to link dependencies

If you want to run the documentation locally:

  1. Follow the steps above
  2. Run yarn start in the root directory
  3. Go to the docs directory and run yarn start

Influences:

Ryan Florence "Reach UI" Guidelines - Great guidelines for making composable / declarative React APIs Tailwind CSS - Utility-based CSS framework without pre-packaged styles Chakra UI - Batteries-included React Component library

Tools:

Styled Components Styled System Jest Typescript TSDX