https://github.com/seymoe/react-native-noticebar
NoticeBar component for React Native, works at iOS and Android.
https://github.com/seymoe/react-native-noticebar
notice noticebar react-native react-native-noticebar
Last synced: 5 months ago
JSON representation
NoticeBar component for React Native, works at iOS and Android.
- Host: GitHub
- URL: https://github.com/seymoe/react-native-noticebar
- Owner: seymoe
- License: mit
- Created: 2018-08-30T02:58:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-24T15:49:24.000Z (over 2 years ago)
- Last Synced: 2025-08-09T14:44:02.630Z (11 months ago)
- Topics: notice, noticebar, react-native, react-native-noticebar
- Language: JavaScript
- Size: 265 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-noticebar
NoticeBar component for React Native, works at iOS and Android.

# Install
```
npm install react-native-noticebar --save
```
# Usage
```
import NoticeBar from 'react-native-noticebar'
class Demo extends React.Component {
constructor(props) {
super(props)
this.state = {
noticeList: [
{
id: 1,
title: 'This is Notice Bar!'
},
{
id: 2,
title: 'Notice Bar coming!!'
}
]
}
}
// noticebar change event
handleChange = (index) => {
console.log(`Current index is ${index}.` )
}
// noticebar press event
handlePress = (item) => {
console.log(item)
}
// render item
renderBarItem = (item, index) => {
return (
{item.title}
)
}
render() {
return (
NoticeBar Demo
)
}
}
```
# Props
Prop name
Description
Type
Default
data
You know, the data
PropTypes.string or PropTypes.element
scrollHeight
Height of the single Bar
PropTypes.number
36
renderBarItem
PropTypes.func
scrollBarStyle
Bar wrap's style
PropTypes.object
delay
PropTypes.number
3000
duration
PropTypes.number
500
easing
PropTypes.string, One of the ['step0','step1','linear','ease','quad','cubic','sin','circle','exp',
'bounce']
linear
onChange
Callback when noticebar has changed
PropTypes.func
onPress
Press function
PropTypes.func