# jaredpalmer/the-platform

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/jaredpalmer-the-platform).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

4,368 stars · 105 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/jaredpalmer/the-platform
- awesome-repositories: https://awesome-repositories.com/repository/jaredpalmer-the-platform.md

## Topics

`hooks` `react` `react-hooks` `react-suspense` `suspense`

## Description

The Platform is a TypeScript library that exposes web platform APIs to React as hooks and declarative components. Hooks return current browser values and re-render the component when those values change. Components for loading resources pause rendering through Suspense until the resource is ready, so loading states are handled by the surrounding component tree.

On the hooks side, it covers window size and scroll position, media query matching, element visibility detection through the browser's intersection observation, and network status with connection details. It also reads geolocation, device motion, and device orientation. Resource components load images, scripts, stylesheets, audio, and video, and forward standard attributes directly to the underlying native elements. A separate utility wraps a promise-returning function in a cache keyed by its input, so repeated renders read resolved data synchronously inside a Suspense boundary.

Preload components emit link hints so the browser can start fetching scripts, styles, and fonts before the component that uses them renders.

## Tags

### Web Development

- [Browser API Hooks](https://awesome-repositories.com/f/web-development/browser-api-hooks.md) — Collects React hooks for scroll, resize, media queries, geolocation, device motion, and network status that return current values and re-render on change.
- [Browser API Wrappers](https://awesome-repositories.com/f/web-development/api-bridges/browser-api-wrappers.md) — Wraps imperative browser APIs as thin hooks and components that pass standard attributes straight through to native elements.
- [Browser API Integrations](https://awesome-repositories.com/f/web-development/browser-api-integrations.md) — Exposes browser capabilities such as scroll, resize, media queries, geolocation, and device sensors to React components as hooks that re-render on change.
- [Declarative Resource Components](https://awesome-repositories.com/f/web-development/declarative-resource-components.md) — Expresses loading of images, scripts, stylesheets, and preload hints as renderable components instead of imperative DOM code.
- [Asynchronous Script Loading](https://awesome-repositories.com/f/web-development/asynchronous-script-loading.md) — Loads an external script through a component that suspends until loading finishes and can run a callback afterward. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))
- [Browser Geolocation Interfaces](https://awesome-repositories.com/f/web-development/browser-geolocation-interfaces.md) — Provides a hook wrapping the browser Geolocation API that returns the user's position and updates components as it changes. ([source](https://github.com/jaredpalmer/the-platform/tree/master/src))
- [Motion and Orientation Hooks](https://awesome-repositories.com/f/web-development/device-orientation-apis/motion-and-orientation-hooks.md) — Provides a hook that returns the device's current motion and orientation readings and re-renders components as the device moves. ([source](https://github.com/jaredpalmer/the-platform#readme))
- [Orientation Monitors](https://awesome-repositories.com/f/web-development/device-orientation-apis/orientation-monitors.md) — Ships a hook that returns the device's current physical orientation and updates components when it changes. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))
- [Image Loading Optimization](https://awesome-repositories.com/f/web-development/image-loading-optimization.md) — Ships an image component that holds rendering via Suspense until the image loads and forwards standard image attributes. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))
- [Intersection Observer Wrappers](https://awesome-repositories.com/f/web-development/intersection-observer-wrappers.md) — Wraps the native Intersection Observer API in a hook that reports when an element enters or leaves the visible area.
- [Network Connectivity Monitoring](https://awesome-repositories.com/f/web-development/network-connectivity-monitoring.md) — Reports whether the browser is online along with connection details and updates components when connectivity changes. ([source](https://github.com/jaredpalmer/the-platform#readme))
- [Promise-Keyed Resource Caches](https://awesome-repositories.com/f/web-development/promise-keyed-resource-caches.md) — Wraps promise-returning functions in an input-keyed cache so repeated renders read resolved data synchronously without refetching.
- [Promise Resource Caches](https://awesome-repositories.com/f/web-development/promise-resource-caches.md) — Wraps a promise-returning function in an input-keyed cache so repeated renders read resolved data synchronously inside a Suspense boundary.
- [Resource Preloading](https://awesome-repositories.com/f/web-development/resource-preloading.md) — Ships preload components that emit link hints so the browser fetches scripts, styles, and fonts before the consuming component renders.
- [Responsive Layout Adaptation](https://awesome-repositories.com/f/web-development/responsive-layout-adaptation.md) — Offers hooks for window size, scroll position, and media query matching so layouts adapt automatically as the viewport changes.
- [Window Size Hooks](https://awesome-repositories.com/f/web-development/window-size-hooks.md) — Provides a hook returning the current window dimensions and re-rendering the component when the window is resized. ([source](https://github.com/jaredpalmer/the-platform/tree/master/tests))

### Hardware & IoT

- [Device Sensors](https://awesome-repositories.com/f/hardware-iot/integration-performance/hardware-interfacing-integration/hardware-integration/device-sensors.md) — Reads the user's geographic position, motion, and physical orientation so apps can react to where the device is and how it moves.

### User Interface & Experience

- [Suspenseful Data Loading](https://awesome-repositories.com/f/user-interface-experience/asynchronous-data-fetching/suspenseful-data-loading.md) — Turns a promise-returning function into a cached resource that suspends rendering until data arrives. ([source](https://github.com/jaredpalmer/the-platform/tree/master/src))
- [Resource Loading](https://awesome-repositories.com/f/user-interface-experience/links/resource-loading.md) — Provides components for images, scripts, stylesheets, audio, video, and preload hints that suspend rendering until each resource has loaded.
- [Media Loading Managers](https://awesome-repositories.com/f/user-interface-experience/media-loading-managers.md) — Image, audio, and video components hold rendering until the media has loaded so surrounding components handle loading states. ([source](https://github.com/jaredpalmer/the-platform/tree/master/src))
- [Loading Suspension](https://awesome-repositories.com/f/user-interface-experience/stylesheet-management/loading-suspension.md) — Resource components pause React rendering until images, scripts, stylesheets, and media finish loading, leaving loading states to the surrounding Suspense boundary.
- [Suspense Boundaries](https://awesome-repositories.com/f/user-interface-experience/component-architectures/suspense-boundaries.md) — Resource components throw pending promises so Suspense boundaries show fallback UI until media, scripts, or data finish loading.
- [DOM Visibility Detectors](https://awesome-repositories.com/f/user-interface-experience/dom-visibility-detectors.md) — Provides a hook built on the browser's intersection observation that reports when an element enters or leaves the visible area without scroll polling.
- [Element Visibility Detection](https://awesome-repositories.com/f/user-interface-experience/element-visibility-detection.md) — Ships a hook using the browser's intersection observation to report when an element enters or leaves the visible area. ([source](https://github.com/jaredpalmer/the-platform/tree/master/src))
- [Scroll Position Hooks](https://awesome-repositories.com/f/user-interface-experience/horizontal-scrolling-utilities/scroll-position-hooks.md) — Provides a hook returning the page's horizontal and vertical scroll offsets in pixels and re-rendering as the user scrolls. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))
- [Scroll-State Tracking](https://awesome-repositories.com/f/user-interface-experience/scroll-state-tracking.md) — Provides a hook that reads window scroll offsets and re-renders the component as the user scrolls. ([source](https://github.com/jaredpalmer/the-platform/tree/master/tests))
- [Stylesheet Load Detection](https://awesome-repositories.com/f/user-interface-experience/stylesheet-management/loading-suspension/stylesheet-load-detection.md) — Injects external scripts and stylesheets and pauses rendering until each finishes loading, avoiding unstyled or half-initialized content. ([source](https://github.com/jaredpalmer/the-platform#readme))
- [JavaScript Media Query Evaluation](https://awesome-repositories.com/f/user-interface-experience/styling-theming-systems/content-styling/css-utility-libraries/css-utilities/conditional-style-queries/document-media-queries/media-query-observers/javascript-media-query-evaluation.md) — Evaluates a media query given as text or object and reports whether it matches, with a default fallback value. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))
- [Viewport Size Trackers](https://awesome-repositories.com/f/user-interface-experience/window-management/recent-window-switchers/window-state-controls/viewport-size-trackers.md) — Provides a hook returning the current window width and height that updates components when the window is resized. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))

### Part of an Awesome List

- [Media and Embeds](https://awesome-repositories.com/f/awesome-lists/media/media-and-embeds.md) — Ships video and audio components that wait for media to load and pass standard attributes through to native elements. ([source](https://github.com/jaredpalmer/the-platform/blob/master/README.md))
