rn-marquee-text 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,38 +1,25 @@
1
- Here's a more professional and well-structured version of your README file with improved formatting, organization, and a "Copy All" button:
1
+ # React Native Marquee Text 🏃‍♂️
2
2
 
3
- ```markdown
4
- # React Native Marquee Text 🚀
3
+ [![npm version](https://img.shields.io/npm/v/rn-marquee-text?style=flat-square)](https://www.npmjs.com/package/rn-marquee-text)
4
+ [![license](https://img.shields.io/npm/l/rn-marquee-text?style=flat-square)](https://github.com/yourusername/rn-marquee-text/blob/main/LICENSE)
5
+ [![downloads](https://img.shields.io/npm/dt/rn-marquee-text?style=flat-square)](https://www.npmjs.com/package/rn-marquee-text)
6
+ [![CI Status](https://img.shields.io/github/actions/workflow/status/yourusername/rn-marquee-text/ci.yml?style=flat-square)](https://github.com/yourusername/rn-marquee-text/actions)
5
7
 
6
- [![npm version](https://img.shields.io/npm/v/rn-marquee-text.svg?style=flat-square)](https://www.npmjs.com/package/rn-marquee-text)
7
- [![license](https://img.shields.io/npm/l/rn-marquee-text.svg?style=flat-square)](https://github.com/yourusername/rn-marquee-text/blob/main/LICENSE)
8
- [![downloads](https://img.shields.io/npm/dm/rn-marquee-text.svg?style=flat-square)](https://www.npmjs.com/package/rn-marquee-text)
9
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
8
+ A high-performance, customizable marquee component for React Native with smooth animations and gesture support.
10
9
 
11
- A high-performance, feature-rich marquee component for React Native with smooth animations and flexible configuration.
12
-
13
- ![Horizontal and Vertical Marquee Demo](demo-combined.gif)
14
-
15
- ## Table of Contents
16
- - [Features](#features-)
17
- - [Installation](#installation-)
18
- - [Usage](#usage-)
19
- - [API Reference](#api-reference-)
20
- - [Examples](#examples-)
21
- - [Troubleshooting](#troubleshooting-)
22
- - [Contributing](#contributing-)
23
- - [License](#license-)
10
+ ![Demo](https://github.com/yourusername/rn-marquee-text/blob/main/assets/demo.gif?raw=true)
24
11
 
25
12
  ## Features ✨
26
13
 
27
- - **Multi-directional scrolling**: Horizontal and vertical marquee effects
28
- - **Animation modes**: Loop and bounce animations
29
- - **Performance optimized**: Built with React Native Reanimated 2
30
- - **Customizable**: Control speed, delay, spacing, and more
31
- - **Interactive**: Gesture support for pausing/resuming
32
- - **Flexible content**: Supports both text and custom components
33
- - **TypeScript ready**: Complete type definitions included
14
+ - 🎭 Multiple animation modes (loop, bounce)
15
+ - ↔️ Bidirectional scrolling (horizontal/vertical)
16
+ - Touch gesture interaction
17
+ - Optimized with Reanimated 2
18
+ - 🎨 Customizable speed, spacing, and delays
19
+ - 📱 Supports both iOS and Android
20
+ - 🛠 TypeScript support included
34
21
 
35
- ## Installation 📦
22
+ ## Installation 💻
36
23
 
37
24
  ```bash
38
25
  # Using npm
@@ -40,136 +27,120 @@ npm install rn-marquee-text react-native-reanimated react-native-gesture-handler
40
27
 
41
28
  # Using yarn
42
29
  yarn add rn-marquee-text react-native-reanimated react-native-gesture-handler
43
- ```
30
+ Peer Dependencies Setup
31
+ Follow Reanimated installation guide
44
32
 
45
- ### Peer Dependencies
46
- Ensure you've properly installed and configured:
47
- - [React Native Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation)
48
- - [React Native Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/docs/)
33
+ Configure Gesture Handler
49
34
 
50
- ## Usage 🚀
51
-
52
- ### Basic Implementation
53
- ```jsx
54
- import React from 'react';
55
- import { StyleSheet, View } from 'react-native';
35
+ Basic Usage 🚀
36
+ jsx
56
37
  import MarqueeText from 'rn-marquee-text';
57
38
 
58
- const App = () => (
59
- <View style={styles.container}>
39
+ function App() {
40
+ return (
60
41
  <MarqueeText
61
- style={styles.marquee}
62
- speed={40}
63
- textStyle={styles.text}
42
+ speed={50}
43
+ style={{ height: 40 }}
44
+ textStyle={{ fontSize: 16 }}
64
45
  >
65
- Your scrolling text goes here
46
+ This text will scroll automatically!
66
47
  </MarqueeText>
67
- </View>
68
- );
69
-
70
- const styles = StyleSheet.create({
71
- container: { flex: 1, justifyContent: 'center', padding: 20 },
72
- marquee: { height: 50, backgroundColor: '#f5f5f5', borderRadius: 8 },
73
- text: { fontSize: 16, color: '#333' }
74
- });
75
-
76
- export default App;
77
- ```
78
-
79
- ## API Reference 📚
80
-
81
- ### Props
82
- | Prop | Type | Default | Description |
83
- |------|------|---------|-------------|
84
- | `children` | React.ReactNode | Required | Content to scroll (string or components) |
85
- | `mode` | 'loop' \| 'bounce' | 'loop' | Animation behavior |
86
- | `speed` | number | 30 | Pixels per second |
87
- | `direction` | 'horizontal' \| 'vertical' | 'horizontal' | Scroll direction |
88
- | `enabled` | boolean | true | Animation active state |
89
- | `delay` | number | 1500 | Initial delay (ms) |
90
- | `endPauseDuration` | number | 1000 | Pause at end (bounce mode) |
91
-
92
- ### Methods (via ref)
93
- ```jsx
94
- const marqueeRef = useRef();
95
-
96
- // Start animation
97
- marqueeRef.current?.start();
98
-
99
- // Stop animation
100
- marqueeRef.current?.stop();
101
-
102
- // Check if active
103
- const isActive = marqueeRef.current?.isActive;
104
- ```
105
-
106
- ## Examples 🎨
48
+ );
49
+ }
50
+ Advanced Usage 🧠
51
+ Custom Animation Configuration
52
+ jsx
53
+ <MarqueeText
54
+ mode="bounce"
55
+ direction="vertical"
56
+ speed={30}
57
+ delay={2000}
58
+ endPauseDuration={1500}
59
+ spacing={30}
60
+ >
61
+ {yourCustomComponent}
62
+ </MarqueeText>
63
+ Imperative Control
64
+ jsx
65
+ const marqueeRef = useRef(null);
107
66
 
108
- ### Vertical Bounce Marquee
109
- ```jsx
67
+ // Start/pause programmatically
68
+ <>
69
+ <MarqueeText ref={marqueeRef} />
70
+ <Button
71
+ title="Toggle"
72
+ onPress={() => marqueeRef.current?.isActive
73
+ ? marqueeRef.current.stop()
74
+ : marqueeRef.current.start()
75
+ }
76
+ />
77
+ </>```
78
+
79
+ API Reference 📚
80
+ Props
81
+ Prop Type Default Description
82
+ mode 'loop' | 'bounce' 'loop' Animation behavior
83
+ speed number 30 Scroll speed (px/sec)
84
+ direction 'horizontal' | 'vertical' 'horizontal' Scroll axis
85
+ delay number 1500 Initial delay (ms)
86
+ spacing number 20 Space between clones
87
+ enabled boolean true Animation state
88
+ Methods (via ref)
89
+ typescript
90
+ interface MarqueeRef {
91
+ start: () => void;
92
+ stop: () => void;
93
+ isActive: boolean;
94
+ }
95
+ Examples 🎨
96
+ News Ticker
97
+ jsx
98
+ <MarqueeText
99
+ style={styles.ticker}
100
+ textStyle={styles.tickerText}
101
+ speed={40}
102
+ >
103
+ BREAKING: React Native Marquee Text released! • New version available • Check out the docs
104
+ </MarqueeText>
105
+ Vertical Product Carousel
106
+ jsx
110
107
  <MarqueeText
111
108
  direction="vertical"
112
109
  mode="bounce"
113
110
  speed={20}
114
- endPauseDuration={2000}
115
- style={styles.verticalMarquee}
111
+ style={styles.carousel}
116
112
  >
117
- Line 1{'\n'}Line 2{'\n'}Line 3
113
+ <ProductCard {...item1} />
114
+ <ProductCard {...item2} />
115
+ <ProductCard {...item3} />
118
116
  </MarqueeText>
119
- ```
117
+ Troubleshooting ⚠️
118
+ Animation not smooth?
120
119
 
121
- ### Controlled Marquee with Buttons
122
- ```jsx
123
- const [paused, setPaused] = useState(false);
120
+ Ensure you're using Reanimated 2+
124
121
 
125
- <>
126
- <MarqueeText
127
- ref={marqueeRef}
128
- enabled={!paused}
129
- style={styles.marquee}
130
- >
131
- Controllable marquee text
132
- </MarqueeText>
133
-
134
- <Button
135
- title={paused ? "Resume" : "Pause"}
136
- onPress={() => setPaused(!paused)}
137
- />
138
- </>
139
- ```
122
+ Check for heavy renders in parent components
140
123
 
141
- ## Troubleshooting 🛠️
124
+ Text not visible?
142
125
 
143
- **Animation not working?**
144
- - Verify Reanimated installation
145
- - Check babel.config.js for Reanimated plugin
126
+ Verify container has explicit dimensions
146
127
 
147
- **Text not visible?**
148
- - Ensure container has proper dimensions
149
- - Verify text color contrasts with background
128
+ Check text color contrast
150
129
 
151
- **Performance issues?**
152
- - Reduce animation speed
153
- - Simplify marquee content
154
- - Use `frameRate` prop to limit FPS
130
+ Gesture not working?
155
131
 
156
- ## Contributing 🤝
157
- Contributions are welcome! Please:
158
- 1. Open an issue to discuss changes
159
- 2. Ensure tests are updated
160
- 3. Maintain consistent code style
132
+ Confirm Gesture Handler installation
161
133
 
162
- ## License 📄
163
- MIT © [Your Name](https://github.com/yourusername)
134
+ Wrap root component with GestureHandlerRootView
164
135
 
165
- <button onclick="copyToClipboard()">Copy All README Content</button>
136
+ Contributing 🤝
137
+ We welcome contributions! Please:
166
138
 
167
- <script>
168
- function copyToClipboard() {
169
- const content = document.querySelector('article').innerText;
170
- navigator.clipboard.writeText(content)
171
- .then(() => alert('README copied to clipboard!'))
172
- .catch(err => console.error('Failed to copy:', err));
173
- }
174
- </script>
175
- ```
139
+ Fork the repository
140
+
141
+ Create a feature branch
142
+
143
+ Submit a pull request
144
+
145
+ License 📄
146
+ MIT © PARESH CHAVDA
@@ -15,7 +15,7 @@ import { TextStyle, ViewStyle } from 'react-native';
15
15
  * @prop {boolean} enabled - Whether the scrolling animation is enabled
16
16
  * @prop {'horizontal'|'vertical'} direction - The direction of the scrolling animation
17
17
  */
18
- export declare const AutoScroll: ({ children, mode, speed, delay, endPauseDuration, style, textStyle, enabled, direction, }: {
18
+ declare const AutoScroll: ({ children, mode, speed, delay, endPauseDuration, style, textStyle, enabled, direction, }: {
19
19
  children: React.ReactNode;
20
20
  mode?: "loop" | "bounce";
21
21
  speed?: number;
@@ -26,3 +26,4 @@ export declare const AutoScroll: ({ children, mode, speed, delay, endPauseDurati
26
26
  enabled?: boolean;
27
27
  direction?: "horizontal" | "vertical";
28
28
  }) => React.JSX.Element;
29
+ export default AutoScroll;
@@ -17,7 +17,7 @@ import { AnimationMode } from './constants';
17
17
  * @prop {boolean} enabled - Whether the scrolling animation is enabled
18
18
  * @prop {'horizontal'|'vertical'} direction - The direction of the scrolling animation
19
19
  */
20
- export var AutoScroll = function (_a) {
20
+ var AutoScroll = function (_a) {
21
21
  var children = _a.children, _b = _a.mode, mode = _b === void 0 ? 'loop' : _b, _c = _a.speed, speed = _c === void 0 ? 30 : _c, _d = _a.delay, delay = _d === void 0 ? 1500 : _d, _e = _a.endPauseDuration, endPauseDuration = _e === void 0 ? 1000 : _e, _f = _a.style, style = _f === void 0 ? {} : _f, _g = _a.textStyle, textStyle = _g === void 0 ? {} : _g, _h = _a.enabled, enabled = _h === void 0 ? true : _h, _j = _a.direction, direction = _j === void 0 ? 'vertical' : _j;
22
22
  // References for measurement
23
23
  var containerRef = useRef(null);
@@ -143,3 +143,4 @@ var styles = StyleSheet.create({
143
143
  flexShrink: 0,
144
144
  },
145
145
  });
146
+ export default AutoScroll;
@@ -115,5 +115,6 @@ export interface MarqueeTextRef {
115
115
  * modes, and user interaction via gestures.
116
116
  */
117
117
  declare const MarqueeText: React.ForwardRefExoticComponent<MarqueeTextProps & React.RefAttributes<MarqueeTextRef>>;
118
- export { MarqueeText, AnimationMode };
118
+ export default MarqueeText;
119
+ export { AnimationMode };
119
120
  export type { MarqueeDirection, MarqueeTextProps };
@@ -205,4 +205,5 @@ var styles = StyleSheet.create({
205
205
  position: 'relative',
206
206
  },
207
207
  });
208
- export { MarqueeText, AnimationMode };
208
+ export default MarqueeText;
209
+ export { AnimationMode };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,18 @@
1
- import { AutoScroll } from './AutoScroll';
2
- import { MarqueeText } from './MarqueeText';
3
- import { AnimationMode } from './constants';
4
- export { AutoScroll, AnimationMode, MarqueeText };
5
- export default AutoScroll;
1
+ import { AnimationMode } from './MarqueeText';
2
+ export { AnimationMode } from './constants';
3
+ declare const Marquee: {
4
+ AutoScroll: ({ children, mode, speed, delay, endPauseDuration, style, textStyle, enabled, direction, }: {
5
+ children: React.ReactNode;
6
+ mode?: "loop" | "bounce";
7
+ speed?: number;
8
+ delay?: number;
9
+ endPauseDuration?: number;
10
+ style?: import("react-native").ViewStyle;
11
+ textStyle?: import("react-native").TextStyle;
12
+ enabled?: boolean;
13
+ direction?: "horizontal" | "vertical";
14
+ }) => import("react").JSX.Element;
15
+ MarqueeText: import("react").ForwardRefExoticComponent<import("./MarqueeText").MarqueeTextProps & import("react").RefAttributes<import("./MarqueeText").MarqueeTextRef>>;
16
+ AnimationMode: typeof AnimationMode;
17
+ };
18
+ export default Marquee;
package/dist/index.js CHANGED
@@ -1,5 +1,10 @@
1
- import { AutoScroll } from './AutoScroll';
2
- import { MarqueeText } from './MarqueeText';
3
- import { AnimationMode } from './constants';
4
- export { AutoScroll, AnimationMode, MarqueeText };
5
- export default AutoScroll;
1
+ import AutoScroll from './AutoScroll';
2
+ import MarqueeText, { AnimationMode } from './MarqueeText';
3
+ export { AnimationMode } from './constants';
4
+ // Optional: Default export (choose either AutoScroll or MarqueeText as default)
5
+ var Marquee = {
6
+ AutoScroll: AutoScroll,
7
+ MarqueeText: MarqueeText,
8
+ AnimationMode: AnimationMode
9
+ };
10
+ export default Marquee;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-marquee-text",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "A customizable marquee (scrolling) text component for React Native",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",