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

axelra-react-utilities

v0.2.3

Published

Axelra React (Web) utilities

Downloads

174

Readme

Axelra React Utilities

This package provides utility components when building React projects with styled-components.

Usage

Use the default ThemeProvider of styled-components to wrap your application (e.g. in _app.js when using Next.js). Create and customize a theme using makeTheme.

import {makeTheme} from 'axelra-react-utilities';

// Check reference config object for all available confiugrattion possibilities.
const theme = makeTheme({spacing: 10});

<ThemeProvider theme={theme}>
    // ...
</ThemeProvider>

Customize Theme

The following object represents a complete list of all possible customizations. All values can be adapted, but it is not possible to add additional keys (e.g. fontSize xxl)

const config = {
    spacing: 8,
    breakPoints: {
        sm: 640,
        md: 768,
        lg: 1024,
        xl: 1280,
        xxl: 1536,
    },
    fontSizes: {
        xs: {
            size: "0.75rem",
            lineHeight: "1rem",
        },
        sm: {
            size: "0.875rem",
            lineHeight: "1.25rem",
        },
        base: {
            size: "1rem",
            lineHeight: "1.5rem",
        },
        lg: {
            size: "1.125rem",
            lineHeight: "1.75rem",
        },
        xl: {
            size: "1.25rem",
            lineHeight: "1.75rem",
        },
        "2xl": {
            size: "1.5rem",
            lineHeight: "2rem",
        },
        "3xl": {
            size: "1.875rem",
            lineHeight: "2.25rem",
        },
        "4xl": {
            size: "2.25rem",
            lineHeight: "2.5rem",
        },
        "5xl": {
            size: "3rem",
            lineHeight: "normal",
        },
        "6xl": {
            size: "3.75rem",
            lineHeight: "normal",
        },
        "7xl": {
            size: "4.5rem",
            lineHeight: "normal",
        },
        "8xl": {
            size: "6rem",
            lineHeight: "normal",
        },
        "9xl": {
            size: "8rem",
            lineHeight: "normal",
        },
    },
}

Components

Responsive Spacer

Use this component to add space. It uses multiplieres of the spacing variable in combination with the defined breakPoints.

<ResponsiveSpacer x={4} sm={6} lg={8}/>

Text

The Text component is a generic component which provides different typography combinations.

    <Text center block size={"7xl"} weight={"Bold"} color={"#ff0000"}>Your Text here</Text>

It is also possible to further adapt the Text component using styled-components

const MyText = styled(Text).attrs({center: true, size: "2xl"})`
    padding-bottom: 8px
`;

Max Width Container

The <MaxWidthContainer/> boxes the layout based on the configured breakpoints. It sets the max-width of an element to match the min-width of the current breakpoint