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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@momocoder14/layout-builder

v1.0.8

Published

A layout builder package that makes layout easier to build and manage

Readme

Responsive Layout Builder

A utility library for creating responsive container layouts in React. It allows you to easily create flexible, grid-based containers that adapt to different screen sizes with customizable breakpoints.

Features

  • Responsive Containers: Create grids and layouts that automatically adjust based on screen size.
  • Customizable Breakpoints: Define your own breakpoints for responsive designs.
  • Utility Functions: Includes functions for generating CSS grid styles and managing class names.
  • Nested Containers: Easily create nested grid layouts.
  • Flexibility: Supports customizable column counts, gaps, and styling.

Installation

To install this package in your React project, run the following command:

npm install @momocoder14/layout-builder

Usage

  1. ResponsiveContainer Component: The ResponsiveContainer component allows you to create responsive layouts with configurable columns and gaps.
import React from 'react';
import { ResponsiveContainer } from '@momocoder14/layout-builder';

const App = () => {
  return (
    <ResponsiveContainer columns={4} gap="20px">
      <div>Item 1</div>
      <div>Item 2</div>
      <div>Item 3</div>
      <div>Item 4</div>
    </ResponsiveContainer>
  );
};

export default App;
  1. Utility Functions: You can also use the utility functions for more control over your layouts.

generateGridStyles

This function generates the necessary CSS grid styles for a given number of columns and gap.

import { generateGridStyles } from '@momocoder14/layout-builder';

const styles = generateGridStyles(3, '10px');
console.log(styles);
// Output: { display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '10px' }

generateResponsiveGridStyles

This function generates responsive grid styles based on custom breakpoints.

import { generateResponsiveGridStyles, DEFAULT_BREAKPOINTS } from '@momocoder14/layout-builder';

const responsiveStyles = generateResponsiveGridStyles(DEFAULT_BREAKPOINTS);
console.log(responsiveStyles);
  1. Custom Breakpoints You can define your own breakpoints and use them in the responsive grid generation.
Copy code
import { DEFAULT_BREAKPOINTS, generateMediaQuery } from '@momocoder14/layout-builder';

const customBreakpoints = {
  sm: '600px',
  md: '900px',
  lg: '1200px',
};

const query = generateMediaQuery(customBreakpoints.md);
console.log(query); // Output: '@media (min-width: 900px)'

Configuration

The default breakpoints are:

export const DEFAULT_BREAKPOINTS = {
  sm: "640px",
  md: "768px",
  lg: "1024px",
  xl: "1280px",
};

You can easily override these in your project by importing and modifying them as needed.

Development

  1. Setup Clone the repository and install dependencies:
git clone https://github.com/momocoder14/layout-builder.git
cd layout-builder
npm install
  1. Building To build the package, run the following command:
npm run build

This will transpile the TypeScript code and generate the output in the dist/ folder.

  1. Testing Run tests using Jest:
npm run test

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details. License