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-native-svg-dial-control

v0.1.6

Published

dial ui component

Readme

svg-dial-control

The DialControl is a component used for manipulating a circular dial in React Native. Below is an overview of its usage and props.

Installation

npm install react-native-svg-dial-control

Usage

Example:

  • normal dial
import React from 'react';
import { View } from 'react-native';
import { DialControl } from 'react-native-svg-dial-control';

const YourComponent = () => {
  // Define a function to handle rotation change
  const handleRotationChange = (rotateValue) => {
    // Perform actions based on the rotated value
    console.log('Rotated to:', rotateValue);
  };

  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <DialControl
         onChange={handleRotationChange}
        // Additional props as needed
      />
    </View>
  );
};
  • knob dial
import React from "react";
import { View } from "react-native";
import { Circle } from "react-native-svg";
import { DialControl } from "react-native-svg-dial-control";

export default function App() {
  return (
    <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
      <DialControl
        onChange={(val) => console.log(val)}
        tickStartAngle={300}
        tickEndAngle={60}
        tickStep={40}
        tickPosition="outside"
        tickLabelList={["OFF", "low", "mid", "high"]}
        motionRange="inTicks"
        motionSpeed={6}
        pointMark="none"
        snapToTicks
        initalRotateValue={300}
      >
        <Circle
          cx="100"
          cy="100"
          r="45"
          fill="#122232"
          style={{ strokeDasharray: "4,4" }}
          stroke="#021622"
          strokeWidth="2"
        />
        <Rect
          x="85"
          y="25"
          width="30"
          height="150"
          rx="5"
          fill="#021622"
          stroke="#021622"
          strokeWidth="1"
        />
        <Circle cx="100" cy="100" r="6" fill="#828282" />
        <Circle cx="100" cy="40" r="3" fill="white" />
      </DialControl>
    </View>
  );
}

Props

The DialControl component accepts the following props:

| Property Name | Type | Description | Default Value | | ------------------ | -------------------------------- | ------------------------------------------------- | ------------- | | dialColor | string | Color of the dial | "#aaaaaa" | | dialOutLineColor | string | Color of the dial's outer line | "#dddddd" | | dialSize | number | Size of the dial | 200 | | onChange | (rotateValue: number) => void | Callback triggered on dial value change | - | | onRelease | (rotateValue: number) => void | Callback triggered on dial release | - | | pointMark | "triangle" | "circle" | "none" | Shape of the point marker on the dial | "triangle" | | snapToTicks | boolean | Determines if the dial snaps to ticks | false | | tickPosition | "inside" | "outside" | Position of ticks relative to the dial | "inside" | | tickStartAngle | number | Starting angle for ticks | 0 | | tickEndAngle | number | Ending angle for ticks | 360 | | tickStep | number | Step size between ticks | 10 | | tickColor | string | Color of ticks | "#000000" | | tickLineLength | number | Length of tick lines | 8 | | tickLabel | boolean | Determines whether to display tick labels | true | | tickLabelList | string[] | List of tick label strings | [] | | tickLabelFontSize | number | Font size of tick labels | 6 | | motionRange | "inTicks" | Controls the motion range of the dial | - | | motionSpeed | number | Speed of dial motion | 10 | | initialRotateValue | number | Initial value for the dial's rotation | 0 | | children | ReactNode | Additional components or elements within the dial | - |

Use these props to customize the appearance and behavior of the dial according to your requirements.