Snapshot của leecade/react-native-swiper: 10.5k★ · JavaScript · Frontend. The best Swiper component for React Native.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Add containerStyle prop to customize the view container.
[1.5.5]
Update: using PropTypes from prop-types and Change View.propTypes to ViewPropTypes
[1.5.4]
Added easily accessible pagination point manipulation: use dotColor / activeDotColor and dotStyle / activeDotStyle (thanks @denizs)
Added scrollEnabled prop to documentation (thanks @ibandominguez)
[1.5.3]
Add loadMinimalLoader prop to customize <ActivityIndicator /> (thanks @Exilz)
Disable autoplay timer when prop changes to false (thanks @dizlexik)
Special thanks to @hypatiah for fixed some grammatical errors in README
[1.5.2]
Add yarn lock
Fix jitter when quickly swiping back and forth between pages (iOS) (thanks @nemophrost)
The first webview always reloaded when injecting the rest of the children (thanks @eosterberg)
see more: CHANGELOG.md
Show Cases
Try these cases by yourself very easy, Just open examples/ios/swiper.xcodeproj in Xcode, then press Cmd + R; you may edit examples/index.ios.js for switch cases.
If true, the scroll view's children are arranged horizontally in a row instead of vertically in a column.
loop
true
bool
Set to false to disable continuous loop mode.
index
0
number
Index number of initial slide.
showsButtons
false
bool
Set to true make control buttons visible.
autoplay
false
bool
Set to true enable auto play mode.
onIndexChanged
(index) => null
func
Called with the new index when the user swiped
Custom basic style & content
Prop
Default
Type
Description
width
-
number
If no specify default enable fullscreen mode by flex: 1.
height
-
number
If no specify default fullscreen mode by flex: 1.
style
{...}
style
See default style in source.
containerStyle
{...}
style
See default container style in source.
loadMinimal
false
bool
Only load current index slide , loadMinimalSize slides before and after.
loadMinimalSize
1
number
see loadMinimal
loadMinimalLoader
<ActivityIndicator />
element
Custom loader to display when slides aren't loaded
Pagination
Prop
Default
Type
Description
showsPagination
true
bool
Set to true make pagination visible.
paginationStyle
{...}
style
Custom styles will merge with the default styles.
renderPagination
-
function
Complete control how to render pagination with three params (index, total, context) ref to this.state.index / this.state.total / this, For example: show numbers instead of dots.
If this parameter is not specified, will not render the title.
Basic props of <ScrollView />
Prop
Default
Type
Description
horizontal
true
bool
If true, the scroll view's children are arranged horizontally in a row instead of vertically in a column.
pagingEnabled
true
bool
If true, the scroll view stops on multiples of the scroll view's size when scrolling. This can be used for horizontal pagination.
showsHorizontalScrollIndicator
false
bool
Set to true if you want to show horizontal scroll bar.
showsVerticalScrollIndicator
false
bool
Set to true if you want to show vertical scroll bar.
bounces
false
bool
If true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction. If false, it disables all bouncing even if the alwaysBounce* props are true.
scrollsToTop
false
bool
If true, the scroll view scrolls to top when the status bar is tapped.
removeClippedSubviews
true
bool
If true, offscreen child views (whose overflow value is hidden) are removed from their native backing superview when offscreen. This canimprove scrolling performance on long lists.
automaticallyAdjustContentInsets
false
bool
Set to true if you need adjust content insets automation.
Makes no sense why this occurs first during bounce
onTouchStartCapture
e / state / context
function
Immediately after onMomentumScrollEnd
onTouchStart
e / state / context
function
Same, but bubble phase
onTouchEnd
e / state / context
function
You could hold the touch start for a long time
onResponderRelease
e / state / context
function
When lifting up - you could pause forever before * lifting
Note: each ScrollResponder be injected with two params: state and context, you can get state and context(ref to swiper's this) from params, for example:
Then launch simulator to preview. Note that you just need to edit the source file src/index.js, the change will auto sync to examples.
After development, you should add test for your modification and make all tests passed to prevent other contributors break the feature in the future accidentally. We use detox + jest for e2e test now, you can read Detox for more detail.
Contribution
@leecade The main author.
@rajkissu The secondary contributor.
Questions
Feel free to contact me or create an issue
Inspired by nolimits4web/Swiper & Design material from Dribbble & made with ♥.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/leecade/react-native-swiper là nguồn chính thức.
leecade/react-native-swiper có bao nhiêu sao?
leecade/react-native-swiper có 10.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/leecade/react-native-swiper. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
leecade/react-native-swiper có phải mã nguồn mở không?
Có — leecade/react-native-swiper phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/leecade/react-native-swiper.
leecade/react-native-swiper còn đang phát triển không?
Commit gần nhất trên leecade/react-native-swiper là 6 tháng trước (theo timestamp GitHub). Repo có 2.3k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
leecade/react-native-swiper là gì?
leecade/react-native-swiper (leecade/react-native-swiper) là dự án JavaScript trên GitHub. Theo mô tả gốc: The best Swiper component for React Native.
leecade/react-native-swiper so với các dự án Frontend khác thế nào?
leecade/react-native-swiper được TopGit xếp vào nhóm Frontend, với 10.5k sao GitHub và viết bằng JavaScript. Xem trang chủ đề Frontend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về react-native-swiper?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về react-native-swiper.