npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-dms-input

v0.0.5

Published

React component for Degrees, Minutes and Seconds (DMS) coordinates input. Mainly focussed on the maritime industry.

Readme

React DMS input

React component for Degrees, Minutes and Seconds (DMS) coordinates input. Mainly focussed on the maritime industry.

Installation

yarn add react-dms-input
npm install react-dms-input --save

Demo

https://phalkone.github.io/react-dms-input/

Basic usage

import React, { useState } from 'react'
import DMSInput from 'react-dms-input'
import 'react-dms-input/style.css'

function App() {
  const [value, setValue] = useState(0)

  return (
    <DMSInput
      mode="DMS"
      type="lat" // Required property
      value={value}
      locale={'en-US'}
      fractionDigits={1}
      onChange={setValue}
    />
  )
}

Properties

| Property | Type | Default | Description | | -------------- | ------------------------------------- | ------------- | ------------------------------------------------------------------------------------ | | mode | 'DMS' | 'DM' | 'D' | 'DM' | Display mode of input. | | type | 'lat' | 'long' | | Latitude or longitude input. | | fractionDigits | [0-4] | 1 | Fraction digits of degrees (D mode) or minutes (DM mode) input. Ignored in DMS mode. | | locale | string | (host locale) | Locale of input. Affects the decimal separator of the minutes. | | value | number | | Value in degrees. | | onnChange | (val: number | undefined) => void | | Called when the degrees value changes. | | nextFocus | HTMLInputElement | HTMLSelectElement | | UI element to focus on once the sign once the sign has been entered. | | ref | React.RefObject | | Reference to the input component | | classes | DMSInputClasses | | Custom css classes for all containers | | style | React.CSSProperties | | Inline styles for the root container |

Styling Reference

CSS Class Hierarchy

.DMSInput (root container)
├── .input-wrapper (generic input group)
│   ├── input (number input element)
│   └── span (degree symbol)
├── .degrees-wrapper (specific to degrees)
├── .minutes-wrapper (specific to minutes)
├── .seconds-wrapper (specific to seconds)
└── .sign-input (container for N/S/E/W selector)
    └── select (sign dropdown element)

DMSInputClasses

| Class Name | Location | Contains | | ------------------ | ---------------------------- | --------------------------------------- | | root | Root container | All coordinate inputs and sign selector | | inputWrapper | Input group container | Input field + measurement symbol | | degreesWrapper | Degrees-specific container | Degrees input + ° symbol | | minutesWrapper | Minutes-specific container | Minutes input + ' symbol | | secondsWrapper | Seconds-specific container | Seconds input + " symbol | | signInput | Cardinal direction container | N/S/E/W dropdown selector |

CSS variables

| Variable Name | Default Value | Description | | -------------------------- | ------------- | ------------------------------------- | | border-color | #ccc | Border color for input fields | | focus-background-color | #eef6ff | Border color for focused input fields | | symbol-color | #6c757d | Color for measurement symbols |

License

MIT