in-view (1.0.1)

Published 2026-05-30 15:17:32 +00:00 by melanie in melanie/in-view

Installation

registry=
npm install in-view@1.0.1
"in-view": "1.0.1"

About this package

in-view

A web component for checking if an element is in view using Intersection Observer by wrapping a HTML template tag.

Install

npm install --save @zicklepop/in-view

Resources

Properties

  • data-rootMargin string, optional: CSS margin syntax to expand the outside area considered in view. (mdn)
  • data-threshold float, optional: Sensitivity for how much of the element must be in view, written as a decimal representation of a percentage. (mdn)

Basic Usage

To work it only requires a template element around whatever you want to render when in view.

<in-view>
  <template>I show up when I'm in view!</template>
</in-view>

Keywords

web component intersection observer
Details
npm
2026-05-30 15:17:32 +00:00
2
Melanie Kat
Unlicense
latest
3.5 KiB
Assets (1)
Versions (1) View all
1.0.1 2026-05-30