Skip to main content

NoticeBar notice bar component

Below the navigation bar, it is generally used for notifications such as system reminders and event reminders. Use it when you need to attract user attention. The importance level is lower than Modal and higher than Toast.

Effect demonstration

1. Default state

<NoticeBar text="I am a notification" />
noticeBar-ios1.png

2. Can be closed

<NoticeBar text="I am a notification" mode="close" />
noticeBar-ios2

3. Click to jump

<NoticeBar
text="Go to Box Demo"
mode="link"
onPress={() => navigation.navigate('BoxDemo')}
/>
noticeBar-ios3

4. Horizontal scrolling + jumpable

<NoticeBar
text="I am a notification, I am a notification"
mode="link"
onPress={() => navigation.navigate('BoxDemo')}
animated
/>
noticeBar-ios4

5. Horizontal scroll + can be closed

<NoticeBar text="I am a notification I am a notification " mode="close" animated />
noticeBar-ios5

6. Custom icon

<NoticeBar icon={<Icon name="user" />} text="I am a notification " />
noticeBar-ios6

API

PropertiesRequiredDescriptionTypeDefault Value
texttrueNotice board textstring
iconfalseleft iconReactNode
modefalseNotice board typeclose | link | ''''
onPressfalseNotification bar click event() => void
animatedfalseWhether to enable animationbooleanfalse
durationfalseanimation playback durationnumber5000
heightfalseNotice board heightnumber36
activeOpacityfalseOpacity when pressednumber0.6
stylefalseCustom styleStyleProp<ViewStyle>