New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

highwall

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highwall

HighWall is a React component which fits viewport's height. Mobile browser compatible 100vh.

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

HighWall - A React Component

Since version 0.4.0, this is an ES module (bundled with Rollup), which should work fine with Vite and others.

Summary

CSS height: 100vh is useful when trying to implement native-app-like mobile web application. However, on mobile Safari for example, it does not work as expected.

This "HighWall" is a React component which realizes height: 100vh by measuring viewport's height every window size change.

React version

Since this component uses hook internally, React version has to be greater than 16.8.0.

How to use

Green will fill up the viewport. Of course, you can set your own class like <HighWall className="myClass">.

import {HighWall} from 'HighWall';

const Page: React.FC = () => {
  return (
    <HighWall style={{backgroundColor: 'green'}}>
      <div>Child component</div>
    </HighWall>  
  );
};

These settings will show debug information on head-up display.

<HighWall debug={true}> // show in default position, leftBottom.
<HighWall debug={{ position: HudPosition.rightTop }}>

image

Advanced

Maybe sometimes you want to set viewport's height to min-height or other properties. This can be realized by setting Fitter function in props.

This sample will set the height to min-height instead of height.

import {HighWall, Fitter} from 'HighWall';

const fitter: Fitter = viewportHeight => ({minHeight: viewportHeight});
<HighWall fitter={fitter}>
</HighWall>

Thanks

This component is inspired by great repos and articles, especially:

Keywords

typescript

FAQs

Package last updated on 17 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts