@rendr-view/use-fill-available
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.3 • Public • Published

@rendr-view/use-fill-available

A React hook that creates a --vh CSS variable that automatically represents 1% of the available height of the screen (to account for iOS Safari toolbars, for example).

Installation

yarn add @rendr-view/use-fill-available

Example usage

// tailwind.config.js
module.exports = {
  ...config,
  theme: {
    extend: {
      spacing: {
        "fill-available": "calc(var(--vh, 1vh) * 100)"
      }
    }
  }
}

// _app.tsx
const App = () => {
  useFillAvailable();
  return <div>
    <div className="h-fill-available">This adapts to the available height of the screen</div>
  </div>
}

Readme

Keywords

none

Package Sidebar

Install

npm i @rendr-view/use-fill-available

Weekly Downloads

3

Version

0.0.1-alpha.3

License

MIT

Unpacked Size

9.82 kB

Total Files

14

Last publish

Collaborators

  • fiveid