2.1.5 • Published 8 months ago

react-page-fitter v2.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

react-page-fitter

Release Status Minzip Size License: MIT

This is a React hooks that observe HTML element fits within the current viewport or element.
It's the for building more complex UI.

Installation

npm install react-page-fitter

Usage

import useFitter from 'react-page-fitter'

function MyComponent() {
  const pathname = // useLocation...
  const isFit = useFitter('.class')

  return isFit && <CustomComponents/>
}

API

useFitter (argument, options)
return value boolean | undefined.

Returns undefined if an invalid argument is passed.

Argument

ParameterMeaning
target (required)The judgement target element by tag, className or id

Options(object)

FieldKey
offsetXHorizontal viewport offsetX number when not using parentBox, The default value is 0
offsetYVertical viewport offsetY number when not using parentBox, The default value is 0
parentBoxThe judgement parentBox element by tag, className or id is judged in place of the viewport, default undefined
pathnameThe dynamic pathname to render when placing at layout level

License

The MIT License.

2.1.5

8 months ago

2.1.2

10 months ago

2.0.3

11 months ago

2.1.1

10 months ago

2.0.2

11 months ago

2.1.4

9 months ago

2.0.5

11 months ago

2.1.3

10 months ago

2.0.4

11 months ago

2.0.11

11 months ago

2.0.7

11 months ago

2.0.6

11 months ago

2.0.9

11 months ago

2.0.10

11 months ago

2.0.8

11 months ago

2.1.0

10 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago