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

reactjs-layouts

v0.1.1

Published

Easly structure your page using components

Downloads

3

Readme

Layouts

This project is an implementation of css Flexbox & Grid for React library

Install

// npm
npm install reactjs-layouts

// yarn
yarn add reactjs-layouts

Get started

Layouts have three main components: Row, Col (Column) and Grid.

Note: react-layouts support type definitions

Row / Col

    import { Row, Col } from 'reactjs-layouts'

    const Component = ()=>{
        return (
            <>
                // control how elements are positioned horizontally
                <Row justifyContent="space-between"></Row>
                
                <Col></Col>
            </>
        )
    }

| Prop | Type | | -------------- | ------- | | justifyContent | string | | alignItems | string | | alignContent | string | | wrap | string | | inline | boolean | | reverse | boolean | | alignSelf | string | | gap | string | | fluid | string |

Grid

    import { Grid } from 'reactjs-layouts'

    const Component = ()=>{
        return (
            // Define the number & width of rows and columns
            <Grid templateRows="auto" templateCols="20vw 1fr"></Grid>
        )
    }

| Prop | Type | | -------------- | ------- | | templateCols | string | | templateRows | string | | templateAreas | string | | colGap | string | | rowGap | string | | autoCols | string | | autoRows | string | | justifyContent | string | | alignItems | string | | alignContent | string | | alignSelf | string | | wrap | string | | inline | boolean | | reverse | boolean | | fluid | string |

Content

As You can use any HTML element in the content you can also use predefined items which let you have more control over the element directly

import { Row } from 'reactjs-layouts'

const Component = ()=>{
    return (
        <Row>
            // Create div element
            // can't control directly
            <div></div>

            // Create a div item
            // you can use content props only
            <Row.item></Row.item>

            // Create a row item
            // you can use Row props + content props
            <Row.row></Row.row>

            // Create a Col item
            // you can use Column props + content props
            <Row.col></Row.col>

            // Create a grid item
            // you can use Grid props + content props
            <Row.grid></Row.grid>
        </Row>
    )
}

Row/Col Content Props

| Prop | Type | | --------- | ------ | | order | string | | grow | string | | shrink | string | | basis | string | | alignSelf | string |

    import { Grid } from 'reactjs-layouts'

    const Component = ()=>{
        return (
            <Grid>
                // Create div element, can't controls directly
                // can't control directly
                <div></div>
            
                // Create a div item
                // you can use content props only
                <Grid.item></Grid.item>
            
                // Create a row item 
                // you can use Row props + content props
                <Grid.row></Grid.row>
            
                // Create a column item
                // you can use Column props + content props
                <Grid.col></Grid.col>
            
                // Create a grid item 
                // you can use Grid props + content props
                <Grid.grid></Grid.grid>
            </Grid>
        )
    }

Grid Content Props

| Prop | Type | | ----------- | ------- | | justifySelf | string | | alignSelf | string | | colStart | string | | colEnd | boolean | | rowStart | boolean | | rowEnd | string | | col | string | | row | string | | area | string | | fluid | string |

License

svelte-layouts is MIT Licenced

Learn More

if you want to learn more about css flexbox and grid and how they works, you can feel free to check out these useful links: