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

react-bootstrap-grid-component

v0.2.5

Published

React Bootstrap Grid

Downloads

10

Readme

React Bootstrap Grid Component

React Bootstrap Grid is a made to make your life easier while using Bootstrap Grid inside your React project. Main concepts of the grid have been transformed into react components such as Container, Row and Column. By adding attributes that are defined bellow you can easily implement the grid to your liking or given specification.

Installation

Install react-bootstrap-grid-component npm install react-bootstrap-grid-component

Components

Container

A Container should always wrap Rows as children.

Usage

import 'bootstrap/scss/bootstrap.scss';
import 'react-bootstrap-grid-component/dist/sizingbreakpoints.scss';
import { Container } from "react-bootstrap-grid-component/dist/Container";
import { Column } from "react-bootstrap-grid-component/dist/Column";
import { Row } from "react-bootstrap-grid-component/dist/Row";

<Container>
    <Row>
        <Column />
    </Row>
</Container>

Properties

The only property that this component support is the isFlud which when is defined sets the .container-fuild class on the wrapping tag

/**
 *  https://getbootstrap.com/docs/4.1/layout/grid/#how-it-works
 */
isFluid?: boolean

Row

Usage

import 'bootstrap/scss/bootstrap.scss';
import 'react-bootstrap-grid-component/dist/sizingbreakpoints.scss';
import { Container } from "react-bootstrap-grid-component/dist/Container";
import { Column } from "react-bootstrap-grid-component/dist/Column";
import { Row } from "react-bootstrap-grid-component/dist/Row";

<Container>
    <Row>
        <Column />
    </Row>
</Container>

Properties

/**
 * https://getbootstrap.com/docs/4.0/layout/grid/#vertical-alignment
 */
verticalAlignment?: "center" | "baseline";
/**
 * https://getbootstrap.com/docs/4.0/layout/grid/#horizontal-alignment
 */
horizontalAlignment?: "start" | "center" | "between" | "end";
/**
   * https://getbootstrap.com/docs/4.0/layout/grid/#no-gutters
   */
  noGutters?: boolean;
/**
  * Rows must contain only columns to prevent negative margin issues
  */
children: Array<React.ReactElement<Column>> | React.ReactElement<Column>;

Column

import 'bootstrap/scss/bootstrap.scss';
import 'react-bootstrap-grid-component/dist/sizingbreakpoints.scss';
import { Container } from "react-bootstrap-grid-component/dist/Container";
import { Column } from "react-bootstrap-grid-component/dist/Column";
import { Row } from "react-bootstrap-grid-component/dist/Row";

<Container>
    <Row>
    <Column size="6">
        <div>Content</div>
    </Column>
    <Column size={xs:12,md:6}>
        <div>Content</div>
    </Column>
    </Row>
</Container>

Properties

direction?: "row" | "col";

size?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;

verticalAlignment?: "top" | "center" | "bottom" | "justify";

horizontalAlignment?: "left" | "right" | "center" | "stretch";

offset?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;

order?:  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "first" | "last";

Note: If you set size to be equal to 0 the column will disappear

Additional CSS

./src/components/sizingbreakpoints.scss

This SCSS-File extending the Bootstrap default width declaration (h-w-25, h-w-50, h-w-75, h-w-100) with breakpoints.

Prefixes

If you want to override some of the default classes of the bootstrap grid, use prefixes. There are prefixes for container, rows and columns

Depending if you want to apply changes globaly or only in one/couple of components then define the prefix on top of desired page

import prefixes from 'react-bootstrap-grid-component/dist/PrefixManager';

prefixes.container | prefixes.column | prefixes.row = 'h-';
$helper-css-prefix: "h-";