Registry / web-framework / react-typescript-flight-indicators

react-typescript-flight-indicators

JSON →
library1.0.4jsnpmunverified

A React + TypeScript port of react-flight-indicators providing SVG-based flight instrument gauges including attitude indicator, heading, airspeed, altimeter, vertical speed, and variometer. Ships with TypeScript definitions and requires React 18+. Version 1.0.4 is the current stable release. Unlike the original jQuery or plain React versions, this package is fully typed and optimized for TypeScript projects, leveraging SVGR for scalable vector graphics. Peer dependency is react ^18.0.0, with no other runtime dependencies.

npm install react-typescript-flight-indicators
INSTALL
IMPORT
SIG · REACT-TYPESCRIPT-F
R
react-typescript-flight-indicators
web-frameworkjavascriptv1.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Airspeed
import { Airspeed } from 'react-typescript-flight-indicators'
import Airspeed from 'react-typescript-flight-indicators'
Named export, not default. Must destructure from the package.
Altimeter
import { Altimeter } from 'react-typescript-flight-indicators'
import { Altimeter } from 'react-typescript-flight-indicators/Altimeter'
All components are re-exported from the index; no subpath imports.
AttitudeIndicator
import { AttitudeIndicator } from 'react-typescript-flight-indicators'
const AttitudeIndicator = require('react-typescript-flight-indicators').AttitudeIndicator
Package is ESM-only (type: module or modern bundler); require not supported.
HeadingIndicator
import { HeadingIndicator } from 'react-typescript-flight-indicators'
Named export available.
TurnCoordinator
import { TurnCoordinator } from 'react-typescript-flight-indicators'
import { TurnCoordinator } from 'react-typescript-flight-indicators/build/TurnCoordinator'
Do not use internal build paths; always import from the package root.
Variometer
import { Variometer } from 'react-typescript-flight-indicators'
import Variometer from 'react-typescript-flight-indicators/Variometer'
Named export, not default.

Renders six flight instruments with useState-driven random dummy values, demonstrating all available components in a flex layout.

import React, { useState } from 'react'; import { Airspeed, Altimeter, AttitudeIndicator, HeadingIndicator, TurnCoordinator, Variometer } from 'react-typescript-flight-indicators'; function FlightPanel() { const [heading, setHeading] = useState(0); const [speed, setSpeed] = useState(100); const [altitude, setAltitude] = useState(5000); const [roll, setRoll] = useState(0); const [pitch, setPitch] = useState(0); const [turn, setTurn] = useState(0); const [vario, setVario] = useState(0); return ( <div style={{ display: 'flex', flexWrap: 'wrap', gap: '1rem' }}> <HeadingIndicator heading={heading} showBox={false} /> <Airspeed speed={speed} showBox={false} /> <Altimeter altitude={altitude} showBox={false} /> <AttitudeIndicator roll={roll} pitch={pitch} showBox={false} /> <TurnCoordinator turn={turn} showBox={false} /> <Variometer vario={vario} showBox={false} /> </div> ); } export default FlightPanel;
Debug
Known issues
breakingRequires React 18 as peer dependency. Using with React <18 will cause runtime errors due to dependency resolution.
fix
Upgrade to React 18 or use the original react-flight-indicators (which supports older React).
affects: >=1.0.0
deprecatedThe 'showBox' prop is likely intended for debug styling; its default/behavior may change in future versions.
fix
Set showBox to false for production. If you need a border, use CSS instead.
affects: >=1.0.0
gotchaAll props are required (no defaults) and only accept number values. Passing undefined, null, or strings will cause rendering issues or TypeScript errors.
fix
Always provide a valid number for each instrument's main prop (heading, speed, altitude, etc.). Use fallback: heading={headingValue ?? 0}.
affects: >=1.0.0
gotchaThe package is ESM-only and will not work in CommonJS environments without a bundler that supports ESM (e.g., Webpack, Vite).
fix
Ensure your project uses ESM or a bundler that can transpile ESM imports. For Node.js, set "type": "module" in package.json.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'react-typescript-flight-indicators'
Package not installed or incorrect import path.
fix
Run 'npm install react-typescript-flight-indicators' and import using 'import { ... } from "react-typescript-flight-indicators"'.
TypeError: HeadingIndicator is not a function
Default import used instead of named import.
fix
Change 'import HeadingIndicator from ...' to 'import { HeadingIndicator } from ...'
Module '"react-typescript-flight-indicators"' has no exported member 'AttitudeIndicator'. Did you mean to use 'import AttitudeIndicator from "react-typescript-flight-indicators"' instead?
TypeScript cannot resolve the named export; usually due to incorrect bundler configuration or type resolution.
fix
Ensure bundler is configured for ESM. If using TypeScript, set 'moduleResolution': 'node16' or 'bundler' in tsconfig.json.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
reactrequiredPeer dependency required for rendering components; version ^18.0.0 required.
Agent activity
4 hits · last 30 days
node
4
Resources
react-typescript-flight-indicators — npm install react-typescript-flight-indicators · libregistry