-
Notifications
You must be signed in to change notification settings - Fork 734
Add docs to TabController #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "TabController.PageCarousel", | ||
"category": "layoutsAndTemplates", | ||
"description": "TabController's PageCarousel component", | ||
"note": "You must pass `asCarousel` flag to TabController and render your TabPages inside a PageCarousel", | ||
"extends": ["ScrollView"], | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx", | ||
"images": [] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "TabController.TabBar", | ||
"category": "layoutsAndTemplates", | ||
"description": "TabController's TabBar component", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx", | ||
"images": [], | ||
"props": [ | ||
{"name": "height", "type": "number", "description": "Tab Bar height", "default": "48"}, | ||
{"name": "enableShadow", "type": "boolean", "description": "Show Tab Bar bottom shadow"}, | ||
{"name": "shadowStyle", "type": "ViewStyle", "description": "Custom shadow style"}, | ||
{"name": "indicatorStyle", "type": "ViewStyle", "description": "Custom style for the selected indicator"}, | ||
{"name": "labelStyle", "type": "TextStyle", "description": "Custom label style"}, | ||
{"name": "selectedLabelStyle", "type": "TextStyle", "description": "Custom selected label style"}, | ||
{"name": "labelColor", "type": "string", "description": "The default label color"}, | ||
{"name": "selectedLabelColor", "type": "string", "description": "The selected label color"}, | ||
{"name": "uppercase", "type": "boolean", "description": "Whether to change the text to uppercase"}, | ||
{"name": "iconColor", "type": "string", "description": "Icon tint color"}, | ||
{"name": "selectedIconColor", "type": "string", "description": "Icon selected tint color"}, | ||
{"name": "activeBackgroundColor", "type": "string", "description": "Apply background color on press for tab item"}, | ||
{"name": "backgroundColor", "type": "string", "description": "The TabBar background Color", "default": "Colors.white"}, | ||
{"name": "containerWidth", "type": "number", "description": "The TabBar container width"}, | ||
{"name": "centerSelected", "type": "boolean", "description": "Pass to center selected item"}, | ||
{"name": "spreadItems", "type": "boolean", "description": "Whether the tabBar should be spread", "default": "true"}, | ||
{"name": "indicatorInsets", "type": "number", "description": "The indicator insets", "default": "Spacings.s4"}, | ||
{"name": "containerStyle", "type": "ViewStyle", "description": "Additional styles for the container"}, | ||
{"name": "testID", "type": "string", "description": "The component test id"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "TabController.TabBarItem", | ||
"category": "layoutsAndTemplates", | ||
"description": "TabController's TabBarItem component", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx", | ||
"images": [], | ||
"props": [ | ||
{"name": "label", "type": "string", "description": "Label of the tab"}, | ||
{"name": "labelStyle;", "type": "TextStyle", "description": "Custom label style"}, | ||
{"name": "selectedLabelStyle", "type": "TextStyle", "description": "Custom selected label style"}, | ||
{"name": "labelColor", "type": "string", "description": "The default label color", "default": "Colors.black"}, | ||
{"name": "selectedLabelColor", "type": "string", "description": "The selected label color", "default": "Colors.primary"}, | ||
{"name": "icon", "type": "number", "description": "Icon of the tab"}, | ||
{"name": "iconColor", "type": "string", "description": "Icon tint color"}, | ||
{"name": "selectedIconColor", "type": "string", "description": "Icon selected tint color"}, | ||
{"name": "badge", "type": "BadgeProps", "description": "Badge component props to display next the item label"}, | ||
{"name": "leadingAccessory", "type": "ReactElement", "description": "Pass to render a leading element"}, | ||
{"name": "trailingAccessory", "type": "ReactElement", "description": "Pass to render a trailing element"}, | ||
{"name": "width", "type": "number", "description": "A fixed width for the item"}, | ||
{"name": "ignore", "type": "boolean", "description": "Ignore tab presses"}, | ||
{"name": "onPress", "type": "(index: number) => void", "description": "Callback for when pressing a tab"}, | ||
{"name": "uppercase", "type": "boolean", "description": "Whether to change the text to uppercase"}, | ||
{"name": "activeOpacity", "type": "number", "description": "The active opacity when pressing a tab"}, | ||
{ | ||
"name": "activeBackgroundColor", | ||
"type": "string", | ||
"description": " Apply background color on press for TouchableOpacity" | ||
}, | ||
{"name": "style", "type": "ViewStyle", "description": "Pass custom style"}, | ||
{"name": "testID", "type": "string", "description": "Used as a testing identifier"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "TabController", | ||
"category": "layoutsAndTemplates", | ||
"description": "A performant solution for a tab controller with lazy load mechanism", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx", | ||
"note": "This component is based on react-native-gesture-handler.\nOn Android, when using react-native-navigation, make sure to wrap your screen with gestureHandlerRootHOC", | ||
Inbal-Tish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"images": [], | ||
Inbal-Tish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"props": [ | ||
{"name": "items", "type": "TabControllerItemProps[]", "description": "The list of tab bar items"}, | ||
{"name": "initialIndex", "type": "number", "description": "Initial selected index", "default": "0"}, | ||
{"name": "selectedIndex", "type": "number", "description": "The current selected index", "deprecated": true}, | ||
{ | ||
"name": "onChangeIndex", | ||
"type": "(index: number, prevIndex: number | null) => void", | ||
"description": "Callback for when index has change (will not be called on ignored items)" | ||
}, | ||
{ | ||
"name": "asCarousel", | ||
"type": "boolean", | ||
"description": "When using TabController.PageCarousel this should be turned on", | ||
"default": "false" | ||
}, | ||
{"name": "carouselPageWidth;", "type": "number", "description": "Pass for custom carousel page width"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "TabController.TabPage", | ||
"category": "layoutsAndTemplates", | ||
"description": "TabController's TabPage component", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx", | ||
"images": [], | ||
Inbal-Tish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"props": [ | ||
{"name": "index", "type": "number", "description": "The index of the the TabPage"}, | ||
{"name": "lazy", "type": "boolean", "description": "Whether this page should be loaded lazily"}, | ||
{ | ||
"name": "lazyLoadTime", | ||
"type": "number", | ||
"description": "How long to wait till lazy load complete (good for showing loader screens)" | ||
}, | ||
{ | ||
"name": "renderLoading", | ||
"type": "() => JSX.Element", | ||
"description": "Render a custom loading page when lazy loading" | ||
}, | ||
{"name": "testID", "type": "string", "description": "The component test id"} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.