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-full-height

v1.2.3

Published

React component to make your container view port height

Downloads

344

Readme

CircleCI Issues npm npm MIT License

Getting Started

This component has been built to help you create responsive and customizable full-height sections. You can always have a full-height section or you can adjust FullHeight component easily to achieve full-height effect only in mobile, desktop or in some specific resolution range.

Installation

With npm

npm install --save react-full-height

Or with yarn

yarn add react-full-height

Usage

Basic usage

The very basic usage is to just wrap your content in FullHeight.

import React from "react";
import FullHeight from "react-full-height";

const MySection = () => <FullHeight>My section content</FullHeight>;

Passing className and section default props

<FullHeight /> renders a section, and it will accept any usual div/section props, including className.

import React from "react";
import FullHeight from "react-full-height";

const MyCustomSection = () => (
  <FullHeight className="section-styles">
    <h2>My section title</h2>
    <p>Full-height section content</p>
  </FullHeight>
);

Follow the content height when it exceeds the viewport height

By default <FullHeight /> has a viewport height, so when your content inside will exceed this height, then the section will be scrollable. If you want the <FullHeight /> to follow the content section in this case, then add canExceed prop.

import React from "react";
import FullHeight from "react-full-height";

const MyCustomSection = () => (
  <FullHeight canExceed>
    <h2>My section title</h2>
    <p>A lot of content, that the height of the content exceeds viewport height....</p>
  </FullHeight>
);

Make your full-height section responsive

You can decide about breakpoint by your own

import React from "react";
import FullHeight from "react-full-height";

/*
 * Make full-height section only in the mobile resolution screens (up to 768px)
 */
const MobileFullHeightSection = () => (
  <FullHeight endWidth={768}>My mobile only full-height section</FullHeight>
);

/*
 * Make full-height section only in the desktop resolution screens (from 1024px)
 */
const DesktopFullHeightSection = () => (
  <FullHeight startWidth={1024}>My desktop only full-height section</FullHeight>
);

/*
 * Make full-height section only in the tablet resolution screens (from 768px to 1024px)
 */
const TabletFullHeightSection = () => (
  <FullHeight startWidth={768} endWidth={1024}>
    My tablet only full-height section
  </FullHeight>
);

This component takes following props

| Prop name | Type | Required | Description | | ---------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | className | string | false | The class name provided to the component. It takes CSS modules as well. | | startWidth | number | false | RWD Breakpoint representing (min-width) - By setting it you're telling component from which resolution it should be full-height section. | | endWidth | number | false | RWD Breakpoint representing (max-width) - Decide at which screen resolution your section should no longer be a full-heigh. | | canExceed | boolean | false | By default is false. When you set it as true and your section content will exceed viewport height then the section will follow the content height (by default (without this props) the section will be scrollable) |

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Author: @qmixi

Demo: https://qmixi.github.io/react-full-height

Project Link: https://github.com/qmixi/react-full-height