MCPcopy Index your code
hub / github.com/browniefed/react-native-ticker

github.com/browniefed/react-native-ticker @v3.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.0 ↗ · + Follow
12 symbols 22 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

React Native Ticker

Create rotating animations of any number, or character.

Changes from v2 to v3

  • Rebuilt with react-native-reanimated.
  • Rebuilt with TypeScript.
  • The rotateTime is now called duration.
  • Now it measures all widths and heights of items and adjusts accordingly!
  • Supply a children element with the value, we no longer support text prop.

Install

yarn add react-native-ticker
npm install react-native-ticker

As of V3 we only support the children prop now.

import Ticker from "react-native-ticker";

<Ticker textStyle={styles.text} duration={250}>
  12345.44
</Ticker>;

Supply a textStyle, and duration is optional and defaults to 250ms.

If you need more than just numbers you can build and supply your own rotations.

import React, { useState, useEffect } from "react";
import { View, StyleSheet } from "react-native";

import Ticker, { Tick } from "./ticker2";

function getRandom(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

const currencies = ["$", "¥", "€"];

const App = () => {
  const [state, setState] =
    useState <
    any >
    {
      currency: currencies[getRandom(0, 2)],
      value: getRandom(0, 100000)
    };

  useEffect(() => {
    setInterval(() => {
      setState({
        currency: currencies[getRandom(0, 2)],
        value: getRandom(0, 100000)
      });
    }, 500);
  }, []);

  return (
    <View style={styles.container}>
      <Ticker textStyle={styles.text}>
        <Tick rotateItems={currencies}>{state.currency}</Tick>
        {state.value.toLocaleString()}
      </Ticker>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
    backgroundColor: "#333"
  },
  text: {
    fontSize: 40,
    color: "#FFF"
  }
});

export default App;

You must render a Ticker and subsequently at least one Tick. If it is text then it will simply be rendered.

Extension points exported contracts — how you extend this code

Props (Interface)
(no doc)
index.tsx
TickProps (Interface)
(no doc)
index.tsx

Core symbols most depended-on inside this repo

splitText
called by 2
index.tsx
isNumber
called by 2
index.tsx
useInitRef
called by 2
index.tsx
uniq
called by 1
index.tsx
range
called by 1
index.tsx
getPosition
called by 1
index.tsx
handleMeasure
called by 1
index.tsx
Tick
called by 0
index.tsx

Shape

Function 10
Interface 2

Languages

TypeScript100%

Modules by API surface

index.tsx12 symbols

For agents

$ claude mcp add react-native-ticker \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact