diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index d6eb089477..4aa9b15e2d 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -24,10 +24,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 - name: Setup uses: ./.github/actions/setup + - name: Generate 5.x component docs + run: node scripts/generate-component-docs.ts origin/5.0 docs/src/data/componentDocs5x.json + - name: Build docs run: yarn --cwd docs build diff --git a/docs/component-docs-plugin/useDocs.tsx b/docs/component-docs-plugin/useDocs.tsx index 9c6fcda0f8..5747fafb5c 100644 --- a/docs/component-docs-plugin/useDocs.tsx +++ b/docs/component-docs-plugin/useDocs.tsx @@ -1,7 +1,10 @@ +import { useActiveDocContext } from '@docusaurus/plugin-content-docs/client'; // @ts-ignore // eslint-disable-next-line import/no-unresolved import { usePluginData } from '@docusaurus/useGlobalData'; +import componentDocs5x from '../src/data/componentDocs5x.json'; + const pluginName = 'component-docs-plugin'; export interface ComponentDocsPluginData { @@ -27,19 +30,29 @@ export interface Data { export interface Prop { required: boolean; - tsType: { + tsType?: { name: string; raw?: string; - }; + } | null; description: string; - defaultValue: { + defaultValue?: { value: string; - }; + } | null; } +const versionedDocs: { [versionName: string]: ComponentDocsPluginData } = { + '5.x': componentDocs5x, +}; + function useDoc(withPath: string) { + const activeDocContext = useActiveDocContext(undefined); const pluginData = usePluginData(pluginName) as ComponentDocsPluginData; - return pluginData?.docs?.[withPath]; + const versionName = activeDocContext.activeVersion?.name; + const versionedDoc = versionName + ? versionedDocs[versionName]?.docs?.[withPath] + : undefined; + + return versionedDoc ?? pluginData?.docs?.[withPath]; } export default useDoc; diff --git a/docs/docs/guides/07-contributing.mdx b/docs/docs/guides/07-contributing.mdx deleted file mode 100644 index 211e8f4b8c..0000000000 --- a/docs/docs/guides/07-contributing.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Contributing ---- - -import Contributing from '../../../CONTRIBUTING.md'; - - diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index a4b672640c..ee54135042 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -60,7 +60,12 @@ const config = { [ './component-docs-plugin', { - docsRootDir: path.join(__dirname, 'docs', 'components'), + docsRootDir: path.join( + __dirname, + 'versioned_docs', + 'version-6.x', + 'components' + ), libsRootDir: path.join(__dirname, '..', 'src', 'components'), pages: { ActivityIndicator: 'ActivityIndicator', @@ -195,12 +200,24 @@ const config = { ({ docs: { sidebarPath: require.resolve('./sidebars.js'), + includeCurrentVersion: false, + lastVersion: '5.x', + versions: { + '6.x': { + label: '6.x', + banner: 'unreleased', + }, + '5.x': { + label: '5.x', + banner: 'none', + }, + }, editUrl: (params) => { const urlToMain = 'https://github.com/callstack/react-native-paper/tree/main'; if (params.docPath.includes('guides')) { - return `${urlToMain}/docs/docs/${params.docPath}`; + return `${urlToMain}/docs/${params.versionDocsDirPath}/${params.docPath}`; } const customUrls = { @@ -260,24 +277,23 @@ const config = { label: 'Showcase', }, { - type: 'dropdown', - label: 'v5.x', + type: 'docsVersionDropdown', position: 'right', - items: [ + dropdownItemsAfter: [ { - label: 'v4.x', + label: '4.x', href: `${publicUrl}4.0/`, }, { - label: 'v3.x', + label: '3.x', href: `${publicUrl}3.0/`, }, { - label: 'v2.x', + label: '2.x', href: `${publicUrl}2.0/`, }, { - label: 'v1.x', + label: '1.x', href: `${publicUrl}1.0/`, }, ], diff --git a/docs/src/data/componentDocs5x.json b/docs/src/data/componentDocs5x.json new file mode 100644 index 0000000000..5aa299568c --- /dev/null +++ b/docs/src/data/componentDocs5x.json @@ -0,0 +1,12185 @@ +{ + "docs": { + "ActivityIndicator": { + "filepath": "ActivityIndicator.tsx", + "title": "ActivityIndicator", + "description": "Activity indicator is used to present progress of some activity in the app.\nIt can be used as a drop-in replacement for the ActivityIndicator shipped with React Native.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ActivityIndicator, MD2Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "link": "activity-indicator", + "data": { + "description": "Activity indicator is used to present progress of some activity in the app.\nIt can be used as a drop-in replacement for the ActivityIndicator shipped with React Native.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ActivityIndicator, MD2Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "displayName": "ActivityIndicator", + "methods": [], + "statics": [], + "props": { + "animating": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show the indicator or hide it.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "The color of the spinner." + }, + "size": { + "required": false, + "tsType": { + "name": "union", + "raw": "'small' | 'large' | number", + "elements": [ + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'large'" + }, + { + "name": "number" + } + ] + }, + "description": "Size of the indicator.", + "defaultValue": { + "value": "'small'", + "computed": false + } + }, + "hidesWhenStopped": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the indicator should hide when not animating.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/ActivityIndicator.tsx" + ] + }, + "Appbar/Appbar": { + "filepath": "Appbar/Appbar.tsx", + "title": "Appbar", + "description": "A component to display action items in a bar. It can be placed at the top or bottom.\nThe top bar usually contains the screen title, controls such as navigation buttons, menu button etc.\nThe bottom bar usually provides access to a drawer and up to four actions.\n\nBy default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead.\nSee [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more informations\n\n## Usage\n### Top bar\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} />\n \n {}} />\n {}} />\n \n);\n\nexport default MyComponent;\n```\n\n### Bottom bar\n```js\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { Appbar, FAB, useTheme } from 'react-native-paper';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nconst BOTTOM_APPBAR_HEIGHT = 80;\nconst MEDIUM_FAB_HEIGHT = 56;\n\nconst MyComponent = () => {\n const { bottom } = useSafeAreaInsets();\n const theme = useTheme();\n\n return (\n \n {}} />\n {}} />\n {}} />\n {}} />\n {}}\n style={[\n styles.fab,\n { top: (BOTTOM_APPBAR_HEIGHT - MEDIUM_FAB_HEIGHT) / 2 },\n ]}\n />\n \n );\n};\n\nconst styles = StyleSheet.create({\n bottom: {\n backgroundColor: 'aquamarine',\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n },\n fab: {\n position: 'absolute',\n right: 16,\n },\n});\n\nexport default MyComponent;\n```", + "link": "appbar", + "data": { + "description": "A component to display action items in a bar. It can be placed at the top or bottom.\nThe top bar usually contains the screen title, controls such as navigation buttons, menu button etc.\nThe bottom bar usually provides access to a drawer and up to four actions.\n\nBy default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead.\nSee [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more informations\n\n## Usage\n### Top bar\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} />\n \n {}} />\n {}} />\n \n);\n\nexport default MyComponent;\n```\n\n### Bottom bar\n```js\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { Appbar, FAB, useTheme } from 'react-native-paper';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nconst BOTTOM_APPBAR_HEIGHT = 80;\nconst MEDIUM_FAB_HEIGHT = 56;\n\nconst MyComponent = () => {\n const { bottom } = useSafeAreaInsets();\n const theme = useTheme();\n\n return (\n \n {}} />\n {}} />\n {}} />\n {}} />\n {}}\n style={[\n styles.fab,\n { top: (BOTTOM_APPBAR_HEIGHT - MEDIUM_FAB_HEIGHT) / 2 },\n ]}\n />\n \n );\n};\n\nconst styles = StyleSheet.create({\n bottom: {\n backgroundColor: 'aquamarine',\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n },\n fab: {\n position: 'absolute',\n right: 16,\n },\n});\n\nexport default MyComponent;\n```", + "displayName": "Appbar", + "methods": [], + "statics": [], + "props": { + "dark": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the background color is a dark color. A dark appbar will render light text and vice-versa." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Appbar`." + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'small' | 'medium' | 'large' | 'center-aligned'", + "elements": [ + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'medium'" + }, + { + "name": "literal", + "value": "'large'" + }, + { + "name": "literal", + "value": "'center-aligned'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nMode of the Appbar.\n- `small` - Appbar with default height (64).\n- `medium` - Appbar with medium height (112).\n- `large` - Appbar with large height (152).\n- `center-aligned` - Appbar with default height and center-aligned title.", + "defaultValue": { + "value": "'small'", + "computed": false + } + }, + "elevated": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nWhether Appbar background should have the elevation along with primary color pigment." + }, + "safeAreaInsets": { + "required": false, + "tsType": { + "name": "signature", + "type": "object", + "raw": "{\n bottom?: number;\n top?: number;\n left?: number;\n right?: number;\n}", + "signature": { + "properties": [ + { + "key": "bottom", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "top", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "left", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "right", + "value": { + "name": "number", + "required": false + } + } + ] + } + }, + "description": "Safe area insets for the Appbar. This can be used to avoid elements like the navigation bar on Android and bottom safe area on iOS." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Appbar/Appbar.tsx" + ] + }, + "Appbar/AppbarAction": { + "filepath": "Appbar/AppbarAction.tsx", + "title": "Appbar.Action", + "description": "A component used to display an action item in the appbar.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\nimport { Platform } from 'react-native';\n\nconst MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';\n\nconst MyComponent = () => (\n \n \n {}} />\n {}} />\n \n);\n\nexport default MyComponent;\n```", + "link": "appbar-action", + "data": { + "description": "A component used to display an action item in the appbar.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\nimport { Platform } from 'react-native';\n\nconst MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';\n\nconst MyComponent = () => (\n \n \n {}} />\n {}} />\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Appbar.Action", + "methods": [], + "statics": [], + "props": { + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for action icon." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Name of the icon to show." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Optional icon size.", + "defaultValue": { + "value": "24", + "computed": false + } + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "isLeading": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\n\nWhether it's the leading button. Note: If `Appbar.BackAction` is present, it will be rendered before any `isLeading` icons." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Appbar/AppbarAction.tsx" + ], + "group": "Appbar" + }, + "Appbar/AppbarBackAction": { + "filepath": "Appbar/AppbarBackAction.tsx", + "title": "Appbar.BackAction", + "description": "A component used to display a back button in the appbar.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} />\n \n);\n\nexport default MyComponent;\n```", + "link": "appbar-back-action", + "data": { + "description": "A component used to display a back button in the appbar.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} />\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Appbar.BackAction", + "methods": [], + "statics": [], + "props": { + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for back icon." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Optional icon size." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button.", + "defaultValue": { + "value": "'Back'", + "computed": false + } + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Appbar/AppbarBackAction.tsx" + ], + "group": "Appbar" + }, + "Appbar/AppbarContent": { + "filepath": "Appbar/AppbarContent.tsx", + "title": "Appbar.Content", + "description": "A component used to display a title and optional subtitle in an appbar.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n);\n\nexport default MyComponent;\n```", + "link": "appbar-content", + "data": { + "description": "A component used to display a title and optional subtitle in an appbar.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "Appbar.Content", + "methods": [], + "statics": [], + "props": { + "title": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text or component for the title." + }, + "titleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the title, if `title` is a string." + }, + "titleRef": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "TextRef" + } + ] + }, + "description": "Reference for the title." + }, + "subtitle": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "@deprecated Deprecated in v5.x\nText for the subtitle." + }, + "subtitleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "@deprecated Deprecated in v5.x\nStyle for the subtitle." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "If true, disable all interactions for this component." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for the text." + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach." + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'small' | 'medium' | 'large' | 'center-aligned'", + "elements": [ + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'medium'" + }, + { + "name": "literal", + "value": "'large'" + }, + { + "name": "literal", + "value": "'center-aligned'" + } + ] + }, + "description": "@internal", + "defaultValue": { + "value": "'small'", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests.", + "defaultValue": { + "value": "'appbar-content'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Appbar/AppbarContent.tsx" + ], + "group": "Appbar" + }, + "Appbar/AppbarHeader": { + "filepath": "Appbar/AppbarHeader.tsx", + "title": "Appbar.Header", + "description": "A component to use as a header at the top of the screen.\nIt can contain the screen title, controls such as navigation buttons, menu button etc.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => {\n const _goBack = () => console.log('Went back');\n\n const _handleSearch = () => console.log('Searching');\n\n const _handleMore = () => console.log('Shown more');\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "appbar-header", + "data": { + "description": "A component to use as a header at the top of the screen.\nIt can contain the screen title, controls such as navigation buttons, menu button etc.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Appbar } from 'react-native-paper';\n\nconst MyComponent = () => {\n const _goBack = () => console.log('Went back');\n\n const _handleSearch = () => console.log('Searching');\n\n const _handleMore = () => console.log('Shown more');\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Appbar.Header", + "methods": [], + "statics": [], + "props": { + "dark": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the background color is a dark color. A dark header will render light text and vice-versa." + }, + "statusBarHeight": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Extra padding to add at the top of header to account for translucent status bar.\nThis is automatically handled on iOS >= 11 including iPhone X using `SafeAreaView`.\nIf you are using Expo, we assume translucent status bar and set a height for status bar automatically.\nPass `0` or a custom value to disable the default behaviour, and customize the height." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the header." + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'small' | 'medium' | 'large' | 'center-aligned'", + "elements": [ + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'medium'" + }, + { + "name": "literal", + "value": "'large'" + }, + { + "name": "literal", + "value": "'center-aligned'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nMode of the Appbar.\n- `small` - Appbar with default height (64).\n- `medium` - Appbar with medium height (112).\n- `large` - Appbar with large height (152).\n- `center-aligned` - Appbar with default height and center-aligned title.", + "defaultValue": { + "value": "Platform.OS === 'ios' ? 'center-aligned' : 'small'", + "computed": false + } + }, + "elevated": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nWhether Appbar background should have the elevation along with primary color pigment.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "testID": { + "defaultValue": { + "value": "'appbar-header'", + "computed": false + }, + "required": false, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Appbar/AppbarHeader.tsx" + ], + "group": "Appbar" + }, + "Avatar/AvatarIcon": { + "filepath": "Avatar/AvatarIcon.tsx", + "title": "Avatar.Icon", + "description": "Avatars can be used to represent people in a graphical way.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n```", + "link": "avatar-icon", + "data": { + "description": "Avatars can be used to represent people in a graphical way.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n```", + "displayName": "Avatar.Icon", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `Avatar`." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Size of the avatar.", + "defaultValue": { + "value": "64", + "computed": false + } + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for the icon." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Avatar/AvatarIcon.tsx" + ], + "group": "Avatar" + }, + "Avatar/AvatarImage": { + "filepath": "Avatar/AvatarImage.tsx", + "title": "Avatar.Image", + "description": "Avatars can be used to represent people in a graphical way.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\nexport default MyComponent\n```", + "link": "avatar-image", + "data": { + "description": "Avatars can be used to represent people in a graphical way.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\nexport default MyComponent\n```", + "displayName": "Avatar.Image", + "methods": [], + "statics": [], + "props": { + "source": { + "required": true, + "tsType": { + "name": "union", + "raw": "| ImageSourcePropType\n| ((props: { size: number }) => React.ReactNode)", + "elements": [ + { + "name": "ImageSourcePropType" + }, + { + "name": "unknown" + } + ] + }, + "description": "Image to display for the `Avatar`.\nIt accepts a standard React Native Image `source` prop\nOr a function that returns an `Image`." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Size of the avatar.", + "defaultValue": { + "value": "64", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "onError": { + "required": false, + "tsType": { + "name": "ImageProps['onError']", + "raw": "ImageProps['onError']" + }, + "description": "Invoked on load error." + }, + "onLayout": { + "required": false, + "tsType": { + "name": "ImageProps['onLayout']", + "raw": "ImageProps['onLayout']" + }, + "description": "Invoked on mount and on layout changes." + }, + "onLoad": { + "required": false, + "tsType": { + "name": "ImageProps['onLoad']", + "raw": "ImageProps['onLoad']" + }, + "description": "Invoked when load completes successfully." + }, + "onLoadEnd": { + "required": false, + "tsType": { + "name": "ImageProps['onLoadEnd']", + "raw": "ImageProps['onLoadEnd']" + }, + "description": "Invoked when load either succeeds or fails." + }, + "onLoadStart": { + "required": false, + "tsType": { + "name": "ImageProps['onLoadStart']", + "raw": "ImageProps['onLoadStart']" + }, + "description": "Invoked on load start." + }, + "onProgress": { + "required": false, + "tsType": { + "name": "ImageProps['onProgress']", + "raw": "ImageProps['onProgress']" + }, + "description": "Invoked on download progress." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Avatar/AvatarImage.tsx" + ], + "group": "Avatar" + }, + "Avatar/AvatarText": { + "filepath": "Avatar/AvatarText.tsx", + "title": "Avatar.Text", + "description": "Avatars can be used to represent people in a graphical way.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n```", + "link": "avatar-text", + "data": { + "description": "Avatars can be used to represent people in a graphical way.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n```", + "displayName": "Avatar.Text", + "methods": [], + "statics": [], + "props": { + "label": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Initials to show as the text in the `Avatar`." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Size of the avatar.", + "defaultValue": { + "value": "64", + "computed": false + } + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for the text." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for text container" + }, + "labelStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the title." + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Avatar/AvatarText.tsx" + ], + "group": "Avatar" + }, + "Badge": { + "filepath": "Badge.tsx", + "title": "Badge", + "description": "Badges are small status descriptors for UI elements.\nA badge consists of a small circle, typically containing a number or other short set of characters, that appears in proximity to another object.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Badge } from 'react-native-paper';\n\nconst MyComponent = () => (\n 3\n);\n\nexport default MyComponent;\n```", + "link": "badge", + "data": { + "description": "Badges are small status descriptors for UI elements.\nA badge consists of a small circle, typically containing a number or other short set of characters, that appears in proximity to another object.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Badge } from 'react-native-paper';\n\nconst MyComponent = () => (\n 3\n);\n\nexport default MyComponent;\n```", + "displayName": "Badge", + "methods": [], + "statics": [], + "props": { + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the badge is visible", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "children": { + "required": false, + "tsType": { + "name": "union", + "raw": "string | number", + "elements": [ + { + "name": "string" + }, + { + "name": "number" + } + ] + }, + "description": "Content of the `Badge`." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Size of the `Badge`.", + "defaultValue": { + "value": "20", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + {} + ] + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Badge.tsx" + ] + }, + "Banner": { + "filepath": "Banner.tsx", + "title": "Banner", + "description": "Banner displays a prominent message and related actions.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Image } from 'react-native';\nimport { Banner } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(true);\n\n return (\n setVisible(false),\n },\n {\n label: 'Learn more',\n onPress: () => setVisible(false),\n },\n ]}\n icon={({size}) => (\n \n )}>\n There was a problem processing a transaction on your credit card.\n \n );\n};\n\nexport default MyComponent;\n```", + "link": "banner", + "data": { + "description": "Banner displays a prominent message and related actions.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Image } from 'react-native';\nimport { Banner } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(true);\n\n return (\n setVisible(false),\n },\n {\n label: 'Learn more',\n onPress: () => setVisible(false),\n },\n ]}\n icon={({size}) => (\n \n )}>\n There was a problem processing a transaction on your credit card.\n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Banner", + "methods": [], + "statics": [], + "props": { + "visible": { + "required": true, + "tsType": { + "name": "boolean" + }, + "description": "Whether banner is currently visible." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content that will be displayed inside banner." + }, + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `Banner`. Can be an image." + }, + "actions": { + "required": false, + "tsType": { + "name": "Array", + "elements": [ + { + "name": "intersection", + "raw": "{\n label: string;\n} & $RemoveChildren", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{\n label: string;\n}", + "signature": { + "properties": [ + { + "key": "label", + "value": { + "name": "string", + "required": true + } + } + ] + } + }, + { + "name": "$RemoveChildren", + "elements": [ + { + "name": "Button" + } + ], + "raw": "$RemoveChildren" + } + ] + } + ], + "raw": "Array<\n {\n label: string;\n } & $RemoveChildren\n>" + }, + "description": "Action items to shown in the banner.\nAn action item should contain the following properties:\n\n- `label`: label of the action button (required)\n- `onPress`: callback that is called when button is pressed (required)\n\nTo customize button you can pass other props that button component takes.", + "defaultValue": { + "value": "[]", + "computed": false + } + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style of banner's inner content.\nUse this prop to apply custom width for wide layouts." + }, + "elevation": { + "required": false, + "tsType": { + "name": "union", + "raw": "0 | 1 | 2 | 3 | 4 | 5 | Animated.Value", + "elements": [ + { + "name": "literal", + "value": "0" + }, + { + "name": "literal", + "value": "1" + }, + { + "name": "literal", + "value": "2" + }, + { + "name": "literal", + "value": "3" + }, + { + "name": "literal", + "value": "4" + }, + { + "name": "literal", + "value": "5" + }, + { + "name": "Animated.Value" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nChanges Banner shadow and background on iOS and Android.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "onShowAnimationFinished": { + "required": false, + "tsType": { + "name": "Animated.EndCallback" + }, + "description": "\nOptional callback that will be called after the opening animation finished running normally", + "defaultValue": { + "value": "() => {}", + "computed": false + } + }, + "onHideAnimationFinished": { + "required": false, + "tsType": { + "name": "Animated.EndCallback" + }, + "description": "\nOptional callback that will be called after the closing animation finished running normally", + "defaultValue": { + "value": "() => {}", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Banner.tsx" + ] + }, + "BottomNavigation/BottomNavigation": { + "filepath": "BottomNavigation/BottomNavigation.tsx", + "title": "BottomNavigation", + "description": "BottomNavigation provides quick navigation between top-level views of an app with a bottom navigation bar.\nIt is primarily designed for use on mobile. If you want to use the navigation bar only see [`BottomNavigation.Bar`](BottomNavigationBar).\n\nBy default BottomNavigation uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead.\nSee [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { BottomNavigation, Text } from 'react-native-paper';\n\nconst MusicRoute = () => Music;\n\nconst AlbumsRoute = () => Albums;\n\nconst RecentsRoute = () => Recents;\n\nconst NotificationsRoute = () => Notifications;\n\nconst MyComponent = () => {\n const [index, setIndex] = React.useState(0);\n const [routes] = React.useState([\n { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'},\n { key: 'albums', title: 'Albums', focusedIcon: 'album' },\n { key: 'recents', title: 'Recents', focusedIcon: 'history' },\n { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' },\n ]);\n\n const renderScene = BottomNavigation.SceneMap({\n music: MusicRoute,\n albums: AlbumsRoute,\n recents: RecentsRoute,\n notifications: NotificationsRoute,\n });\n\n return (\n \n );\n};\n\nexport default MyComponent;\n```", + "link": "bottom-navigation", + "data": { + "description": "BottomNavigation provides quick navigation between top-level views of an app with a bottom navigation bar.\nIt is primarily designed for use on mobile. If you want to use the navigation bar only see [`BottomNavigation.Bar`](BottomNavigationBar).\n\nBy default BottomNavigation uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead.\nSee [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { BottomNavigation, Text } from 'react-native-paper';\n\nconst MusicRoute = () => Music;\n\nconst AlbumsRoute = () => Albums;\n\nconst RecentsRoute = () => Recents;\n\nconst NotificationsRoute = () => Notifications;\n\nconst MyComponent = () => {\n const [index, setIndex] = React.useState(0);\n const [routes] = React.useState([\n { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'},\n { key: 'albums', title: 'Albums', focusedIcon: 'album' },\n { key: 'recents', title: 'Recents', focusedIcon: 'history' },\n { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' },\n ]);\n\n const renderScene = BottomNavigation.SceneMap({\n music: MusicRoute,\n albums: AlbumsRoute,\n recents: RecentsRoute,\n notifications: NotificationsRoute,\n });\n\n return (\n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "BottomNavigation", + "methods": [ + { + "name": "SceneMap", + "docblock": "Function which takes a map of route keys to components.\nPure components are used to minimize re-rendering of the pages.\nThis drastically improves the animation performance.", + "modifiers": [ + "static" + ], + "params": [ + { + "name": "scenes", + "optional": false, + "type": { + "name": "signature", + "type": "object", + "raw": "{\n [key: string]: React.ComponentType<{\n route: Route;\n jumpTo: (key: string) => void;\n }>;\n}", + "signature": { + "properties": [ + { + "key": { + "name": "string" + }, + "value": { + "name": "ReactComponentType", + "raw": "React.ComponentType<{\n route: Route;\n jumpTo: (key: string) => void;\n}>", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{\n route: Route;\n jumpTo: (key: string) => void;\n}", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "jumpTo", + "value": { + "name": "signature", + "type": "function", + "raw": "(key: string) => void", + "signature": { + "arguments": [ + { + "name": "key", + "type": { + "name": "string" + } + } + ], + "return": { + "name": "void" + } + }, + "required": true + } + } + ] + } + } + ], + "required": true + } + } + ] + } + } + } + ], + "returns": null, + "description": "Function which takes a map of route keys to components.\nPure components are used to minimize re-rendering of the pages.\nThis drastically improves the animation performance." + } + ], + "statics": [], + "props": { + "shifting": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the shifting style is used, the active tab icon shifts up to show the label and the inactive tabs won't have a label.\n\nBy default, this is `false` with theme version 3 and `true` when you have more than 3 tabs.\nPass `shifting={false}` to explicitly disable this animation, or `shifting={true}` to always use this animation.\nNote that you need at least 2 tabs be able to run this animation." + }, + "labeled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show labels in tabs. When `false`, only icons will be displayed.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "compact": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether tabs should be spread across the entire width." + }, + "navigationState": { + "required": true, + "tsType": { + "name": "signature", + "type": "object", + "raw": "{\n index: number;\n routes: Route[];\n}", + "signature": { + "properties": [ + { + "key": "index", + "value": { + "name": "number", + "required": true + } + }, + { + "key": "routes", + "value": { + "name": "Array", + "elements": [ + { + "name": "Route" + } + ], + "raw": "Route[]", + "required": true + } + } + ] + } + }, + "description": "State for the bottom navigation. The state should contain the following properties:\n\n- `index`: a number representing the index of the active route in the `routes` array\n- `routes`: an array containing a list of route objects used for rendering the tabs\n\nEach route object should contain the following properties:\n\n- `key`: a unique key to identify the route (required)\n- `title`: title of the route to use as the tab label\n- `focusedIcon`: icon to use as the focused tab icon, can be a string, an image source or a react component @renamed Renamed from 'icon' to 'focusedIcon' in v5.x\n- `unfocusedIcon`: icon to use as the unfocused tab icon, can be a string, an image source or a react component @supported Available in v5.x with theme version 3\n- `color`: color to use as background color for shifting bottom navigation @deprecatedProperty In v5.x works only with theme version 2.\n- `badge`: badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text.\n- `accessibilityLabel`: accessibility label for the tab button\n- `testID`: test id for the tab button\n\nExample:\n\n```js\n{\n index: 1,\n routes: [\n { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'},\n { key: 'albums', title: 'Albums', focusedIcon: 'album' },\n { key: 'recents', title: 'Recents', focusedIcon: 'history' },\n { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' },\n ]\n}\n```\n\n`BottomNavigation` is a controlled component, which means the `index` needs to be updated via the `onIndexChange` callback." + }, + "onIndexChange": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(index: number) => void", + "signature": { + "arguments": [ + { + "name": "index", + "type": { + "name": "number" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback which is called on tab change, receives the index of the new tab as argument.\nThe navigation state needs to be updated when it's called, otherwise the change is dropped." + }, + "renderScene": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: {\n route: Route;\n jumpTo: (key: string) => void;\n}) => React.ReactNode | null", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{\n route: Route;\n jumpTo: (key: string) => void;\n}", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "jumpTo", + "value": { + "name": "signature", + "type": "function", + "raw": "(key: string) => void", + "signature": { + "arguments": [ + { + "name": "key", + "type": { + "name": "string" + } + } + ], + "return": { + "name": "void" + } + }, + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "React.ReactNode | null", + "elements": [ + { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + { + "name": "null" + } + ] + } + } + }, + "description": "Callback which returns a react element to render as the page for the tab. Receives an object containing the route as the argument:\n\n```js\nrenderScene = ({ route, jumpTo }) => {\n switch (route.key) {\n case 'music':\n return ;\n case 'albums':\n return ;\n }\n}\n```\n\nPages are lazily rendered, which means that a page will be rendered the first time you navigate to it.\nAfter initial render, all the pages stay rendered to preserve their state.\n\nYou need to make sure that your individual routes implement a `shouldComponentUpdate` to improve the performance.\nTo make it easier to specify the components, you can use the `SceneMap` helper:\n\n```js\nrenderScene = BottomNavigation.SceneMap({\n music: MusicRoute,\n albums: AlbumsRoute,\n});\n```\n\nSpecifying the components this way is easier and takes care of implementing a `shouldComponentUpdate` method.\nEach component will receive the current route and a `jumpTo` method as it's props.\nThe `jumpTo` method can be used to navigate to other tabs programmatically:\n\n```js\nthis.props.jumpTo('albums')\n```" + }, + "renderIcon": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: {\n route: Route;\n focused: boolean;\n color: string;\n}) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{\n route: Route;\n focused: boolean;\n color: string;\n}", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "focused", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "color", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React Element to be used as tab icon." + }, + "renderLabel": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: {\n route: Route;\n focused: boolean;\n color: string;\n}) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{\n route: Route;\n focused: boolean;\n color: string;\n}", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "focused", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "color", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which React Element to be used as tab label." + }, + "renderTouchable": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: TouchableProps) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "intersection", + "raw": "TouchableRippleProps & {\n key: string;\n route: Route;\n children: React.ReactNode;\n borderless?: boolean;\n centered?: boolean;\n rippleColor?: ColorValue;\n}", + "elements": [ + { + "name": "TouchableRippleProps" + }, + { + "name": "signature", + "type": "object", + "raw": "{\n key: string;\n route: Route;\n children: React.ReactNode;\n borderless?: boolean;\n centered?: boolean;\n rippleColor?: ColorValue;\n}", + "signature": { + "properties": [ + { + "key": "key", + "value": { + "name": "string", + "required": true + } + }, + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "children", + "value": { + "name": "ReactReactNode", + "raw": "React.ReactNode", + "required": true + } + }, + { + "key": "borderless", + "value": { + "name": "boolean", + "required": false + } + }, + { + "key": "centered", + "value": { + "name": "boolean", + "required": false + } + }, + { + "key": "rippleColor", + "value": { + "name": "ColorValue", + "required": false + } + } + ] + } + } + ] + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to be used as the touchable for the tab item.\nRenders a `TouchableRipple` on Android and `Pressable` on iOS." + }, + "getAccessibilityLabel": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get accessibility label for the tab button. This is read by the screen reader when the user taps the tab.\nUses `route.accessibilityLabel` by default." + }, + "getBadge": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => boolean | number | string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "boolean | number | string | undefined", + "elements": [ + { + "name": "boolean" + }, + { + "name": "number" + }, + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get badge for the tab, uses `route.badge` by default." + }, + "getColor": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get color for the tab, uses `route.color` by default." + }, + "getLabelText": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get label text for the tab, uses `route.title` by default. Use `renderLabel` to replace label component." + }, + "getLazy": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => boolean | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "boolean | undefined", + "elements": [ + { + "name": "boolean" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get lazy for the current screen. Uses true by default.", + "defaultValue": { + "value": "({ route }: { route: Route }) => route.lazy", + "computed": false + } + }, + "getTestID": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get the id to locate this tab button in tests, uses `route.testID` by default." + }, + "onTabPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route } & TabPressEvent) => void", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "intersection", + "raw": "{ route: Route } & TabPressEvent", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + }, + { + "name": "signature", + "type": "object", + "raw": "{\n defaultPrevented: boolean;\n preventDefault(): void;\n}", + "signature": { + "properties": [ + { + "key": "defaultPrevented", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "preventDefault", + "value": { + "name": "void", + "required": true + } + } + ] + } + } + ] + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on tab press. It receives the route for the pressed tab, useful for things like scroll to top." + }, + "onTabLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route } & TabPressEvent) => void", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "intersection", + "raw": "{ route: Route } & TabPressEvent", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + }, + { + "name": "signature", + "type": "object", + "raw": "{\n defaultPrevented: boolean;\n preventDefault(): void;\n}", + "signature": { + "properties": [ + { + "key": "defaultPrevented", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "preventDefault", + "value": { + "name": "void", + "required": true + } + } + ] + } + } + ] + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on tab long press. It receives the route for the pressed tab, useful for things like custom action when longed pressed." + }, + "activeColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for icon and label in the active tab." + }, + "inactiveColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for icon and label in the inactive tab." + }, + "sceneAnimationEnabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether animation is enabled for scenes transitions in `shifting` mode.\nBy default, the scenes cross-fade during tab change when `shifting` is enabled.\nSpecify `sceneAnimationEnabled` as `false` to disable the animation.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "sceneAnimationType": { + "required": false, + "tsType": { + "name": "union", + "raw": "'opacity' | 'shifting'", + "elements": [ + { + "name": "literal", + "value": "'opacity'" + }, + { + "name": "literal", + "value": "'shifting'" + } + ] + }, + "description": "The scene animation effect. Specify `'shifting'` for a different effect.\nBy default, 'opacity' will be used.", + "defaultValue": { + "value": "'opacity'", + "computed": false + } + }, + "sceneAnimationEasing": { + "required": false, + "tsType": { + "name": "union", + "raw": "EasingFunction | undefined", + "elements": [ + { + "name": "EasingFunction" + }, + { + "name": "undefined" + } + ] + }, + "description": "The scene animation Easing." + }, + "keyboardHidesNavigationBar": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the bottom navigation bar is hidden when keyboard is shown.\nOn Android, this works best when [`windowSoftInputMode`](https://developer.android.com/guide/topics/manifest/activity-element#wsoft) is set to `adjustResize`.", + "defaultValue": { + "value": "Platform.OS === 'android'", + "computed": false + } + }, + "safeAreaInsets": { + "required": false, + "tsType": { + "name": "signature", + "type": "object", + "raw": "{\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n}", + "signature": { + "properties": [ + { + "key": "top", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "right", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "bottom", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "left", + "value": { + "name": "number", + "required": false + } + } + ] + } + }, + "description": "Safe area insets for the tab bar. This can be used to avoid elements like the navigation bar on Android and bottom safe area on iOS.\nThe bottom insets for iOS is added by default. You can override the behavior with this option." + }, + "barStyle": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "Style for the bottom navigation bar. You can pass a custom background color here:\n\n```js\nbarStyle={{ backgroundColor: '#694fad' }}\n```" + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "activeIndicatorStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'bottom-navigation'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/BottomNavigation/BottomNavigation.tsx" + ] + }, + "BottomNavigation/BottomNavigationBar": { + "filepath": "BottomNavigation/BottomNavigationBar.tsx", + "title": "BottomNavigation.Bar", + "description": "A navigation bar which can easily be integrated with [React Navigation's Bottom Tabs Navigator](https://reactnavigation.org/docs/bottom-tab-navigator/).\n\n## Usage\n### without React Navigation\n```js\nimport React from 'react';\nimport { useState } from 'react';\nimport { View } from 'react-native';\nimport { BottomNavigation, Text, Provider } from 'react-native-paper';\nimport MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n\nfunction HomeScreen() {\n return (\n \n Home!\n \n );\n}\n\nfunction SettingsScreen() {\n return (\n \n Settings!\n \n );\n}\n\nexport default function MyComponent() {\n const [index, setIndex] = useState(0);\n\n const routes = [\n { key: 'home', title: 'Home', icon: 'home' },\n { key: 'settings', title: 'Settings', icon: 'cog' },\n ];\n\n const renderScene = ({ route }) => {\n switch (route.key) {\n case 'home':\n return ;\n case 'settings':\n return ;\n default:\n return null;\n }\n };\n\n return (\n \n {renderScene({ route: routes[index] })}\n {\n const newIndex = routes.findIndex((r) => r.key === route.key);\n if (newIndex !== -1) {\n setIndex(newIndex);\n }\n }}\n renderIcon={({ route, color }) => (\n \n )}\n getLabelText={({ route }) => route.title}\n />\n \n );\n}\n```", + "link": "bottom-navigation-bar", + "data": { + "description": "A navigation bar which can easily be integrated with [React Navigation's Bottom Tabs Navigator](https://reactnavigation.org/docs/bottom-tab-navigator/).\n\n## Usage\n### without React Navigation\n```js\nimport React from 'react';\nimport { useState } from 'react';\nimport { View } from 'react-native';\nimport { BottomNavigation, Text, Provider } from 'react-native-paper';\nimport MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n\nfunction HomeScreen() {\n return (\n \n Home!\n \n );\n}\n\nfunction SettingsScreen() {\n return (\n \n Settings!\n \n );\n}\n\nexport default function MyComponent() {\n const [index, setIndex] = useState(0);\n\n const routes = [\n { key: 'home', title: 'Home', icon: 'home' },\n { key: 'settings', title: 'Settings', icon: 'cog' },\n ];\n\n const renderScene = ({ route }) => {\n switch (route.key) {\n case 'home':\n return ;\n case 'settings':\n return ;\n default:\n return null;\n }\n };\n\n return (\n \n {renderScene({ route: routes[index] })}\n {\n const newIndex = routes.findIndex((r) => r.key === route.key);\n if (newIndex !== -1) {\n setIndex(newIndex);\n }\n }}\n renderIcon={({ route, color }) => (\n \n )}\n getLabelText={({ route }) => route.title}\n />\n \n );\n}\n```", + "displayName": "BottomNavigation.Bar", + "methods": [], + "statics": [], + "props": { + "shifting": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the shifting style is used, the active tab icon shifts up to show the label and the inactive tabs won't have a label.\n\nBy default, this is `false` with theme version 3 and `true` when you have more than 3 tabs.\nPass `shifting={false}` to explicitly disable this animation, or `shifting={true}` to always use this animation.\nNote that you need at least 2 tabs be able to run this animation." + }, + "labeled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show labels in tabs. When `false`, only icons will be displayed.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "compact": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether tabs should be spread across the entire width." + }, + "navigationState": { + "required": true, + "tsType": { + "name": "signature", + "type": "object", + "raw": "{\n index: number;\n routes: Route[];\n}", + "signature": { + "properties": [ + { + "key": "index", + "value": { + "name": "number", + "required": true + } + }, + { + "key": "routes", + "value": { + "name": "Array", + "elements": [ + { + "name": "Route" + } + ], + "raw": "Route[]", + "required": true + } + } + ] + } + }, + "description": "State for the bottom navigation. The state should contain the following properties:\n\n- `index`: a number representing the index of the active route in the `routes` array\n- `routes`: an array containing a list of route objects used for rendering the tabs\n\nEach route object should contain the following properties:\n\n- `key`: a unique key to identify the route (required)\n- `title`: title of the route to use as the tab label\n- `focusedIcon`: icon to use as the focused tab icon, can be a string, an image source or a react component @renamed Renamed from 'icon' to 'focusedIcon' in v5.x\n- `unfocusedIcon`: icon to use as the unfocused tab icon, can be a string, an image source or a react component @supported Available in v5.x with theme version 3\n- `color`: color to use as background color for shifting bottom navigation @deprecatedProperty In v5.x works only with theme version 2.\n- `badge`: badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text.\n- `accessibilityLabel`: accessibility label for the tab button\n- `testID`: test id for the tab button\n\nExample:\n\n```js\n{\n index: 1,\n routes: [\n { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'},\n { key: 'albums', title: 'Albums', focusedIcon: 'album' },\n { key: 'recents', title: 'Recents', focusedIcon: 'history' },\n { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' },\n ]\n}\n```\n\n`BottomNavigation.Bar` is a controlled component, which means the `index` needs to be updated via the `onTabPress` callback." + }, + "renderIcon": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: {\n route: Route;\n focused: boolean;\n color: string;\n}) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{\n route: Route;\n focused: boolean;\n color: string;\n}", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "focused", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "color", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React Element to be used as tab icon." + }, + "renderLabel": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: {\n route: Route;\n focused: boolean;\n color: string;\n}) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{\n route: Route;\n focused: boolean;\n color: string;\n}", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "focused", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "color", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which React Element to be used as tab label." + }, + "renderTouchable": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: TouchableProps) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "intersection", + "raw": "TouchableRippleProps & {\n key: string;\n route: Route;\n children: React.ReactNode;\n borderless?: boolean;\n centered?: boolean;\n rippleColor?: ColorValue;\n}", + "elements": [ + { + "name": "TouchableRippleProps" + }, + { + "name": "signature", + "type": "object", + "raw": "{\n key: string;\n route: Route;\n children: React.ReactNode;\n borderless?: boolean;\n centered?: boolean;\n rippleColor?: ColorValue;\n}", + "signature": { + "properties": [ + { + "key": "key", + "value": { + "name": "string", + "required": true + } + }, + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + }, + { + "key": "children", + "value": { + "name": "ReactReactNode", + "raw": "React.ReactNode", + "required": true + } + }, + { + "key": "borderless", + "value": { + "name": "boolean", + "required": false + } + }, + { + "key": "centered", + "value": { + "name": "boolean", + "required": false + } + }, + { + "key": "rippleColor", + "value": { + "name": "ColorValue", + "required": false + } + } + ] + } + } + ] + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to be used as the touchable for the tab item.\nRenders a `TouchableRipple` on Android and `Pressable` on iOS.", + "defaultValue": { + "value": "({ key, ...props }: TouchableProps) => (\n \n)", + "computed": false + } + }, + "getAccessibilityLabel": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get accessibility label for the tab button. This is read by the screen reader when the user taps the tab.\nUses `route.accessibilityLabel` by default.", + "defaultValue": { + "value": "({ route }: { route: Route }) =>\nroute.accessibilityLabel", + "computed": false + } + }, + "getBadge": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => boolean | number | string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "boolean | number | string | undefined", + "elements": [ + { + "name": "boolean" + }, + { + "name": "number" + }, + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get badge for the tab, uses `route.badge` by default.", + "defaultValue": { + "value": "({ route }: { route: Route }) => route.badge", + "computed": false + } + }, + "getColor": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get color for the tab, uses `route.color` by default.", + "defaultValue": { + "value": "({ route }: { route: Route }) => route.color", + "computed": false + } + }, + "getLabelText": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get label text for the tab, uses `route.title` by default. Use `renderLabel` to replace label component.", + "defaultValue": { + "value": "({ route }: { route: Route }) => route.title", + "computed": false + } + }, + "getTestID": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route }) => string | undefined", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "union", + "raw": "string | undefined", + "elements": [ + { + "name": "string" + }, + { + "name": "undefined" + } + ] + } + } + }, + "description": "Get the id to locate this tab button in tests, uses `route.testID` by default.", + "defaultValue": { + "value": "({ route }: { route: Route }) => route.testID", + "computed": false + } + }, + "onTabPress": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route } & TabPressEvent) => void", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "intersection", + "raw": "{ route: Route } & TabPressEvent", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + }, + { + "name": "signature", + "type": "object", + "raw": "{\n defaultPrevented: boolean;\n preventDefault(): void;\n}", + "signature": { + "properties": [ + { + "key": "defaultPrevented", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "preventDefault", + "value": { + "name": "void", + "required": true + } + } + ] + } + } + ] + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on tab press. It receives the route for the pressed tab. Use this to update the navigation state." + }, + "onTabLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { route: Route } & TabPressEvent) => void", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "intersection", + "raw": "{ route: Route } & TabPressEvent", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{ route: Route }", + "signature": { + "properties": [ + { + "key": "route", + "value": { + "name": "Route", + "required": true + } + } + ] + } + }, + { + "name": "signature", + "type": "object", + "raw": "{\n defaultPrevented: boolean;\n preventDefault(): void;\n}", + "signature": { + "properties": [ + { + "key": "defaultPrevented", + "value": { + "name": "boolean", + "required": true + } + }, + { + "key": "preventDefault", + "value": { + "name": "void", + "required": true + } + } + ] + } + } + ] + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on tab long press. It receives the route for the pressed tab" + }, + "activeColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for icon and label in the active tab." + }, + "inactiveColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for icon and label in the inactive tab." + }, + "animationEasing": { + "required": false, + "tsType": { + "name": "union", + "raw": "EasingFunction | undefined", + "elements": [ + { + "name": "EasingFunction" + }, + { + "name": "undefined" + } + ] + }, + "description": "The scene animation Easing." + }, + "keyboardHidesNavigationBar": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the bottom navigation bar is hidden when keyboard is shown.\nOn Android, this works best when [`windowSoftInputMode`](https://developer.android.com/guide/topics/manifest/activity-element#wsoft) is set to `adjustResize`.", + "defaultValue": { + "value": "Platform.OS === 'android'", + "computed": false + } + }, + "safeAreaInsets": { + "required": false, + "tsType": { + "name": "signature", + "type": "object", + "raw": "{\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n}", + "signature": { + "properties": [ + { + "key": "top", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "right", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "bottom", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "left", + "value": { + "name": "number", + "required": false + } + } + ] + } + }, + "description": "Safe area insets for the tab bar. This can be used to avoid elements like the navigation bar on Android and bottom safe area on iOS.\nThe bottom insets for iOS is added by default. You can override the behavior with this option." + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "activeIndicatorStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'bottom-navigation-bar'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/BottomNavigation/BottomNavigationBar.tsx" + ], + "group": "BottomNavigation" + }, + "Button/Button": { + "filepath": "Button/Button.tsx", + "title": "Button", + "description": "A button is component that the user can press to trigger an action.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Button } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "link": "button", + "data": { + "description": "A button is component that the user can press to trigger an action.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Button } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Button", + "methods": [], + "statics": [], + "props": { + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'text' | 'outlined' | 'contained' | 'elevated' | 'contained-tonal'", + "elements": [ + { + "name": "literal", + "value": "'text'" + }, + { + "name": "literal", + "value": "'outlined'" + }, + { + "name": "literal", + "value": "'contained'" + }, + { + "name": "literal", + "value": "'elevated'" + }, + { + "name": "literal", + "value": "'contained-tonal'" + } + ] + }, + "description": "Mode of the button. You can change the mode to adjust the styling to give it desired emphasis.\n- `text` - flat button without background or outline, used for the lowest priority actions, especially when presenting multiple options.\n- `outlined` - button with an outline without background, typically used for important, but not primary action – represents medium emphasis.\n- `contained` - button with a background color, used for important action, have the most visual impact and high emphasis.\n- `elevated` - button with a background color and elevation, used when absolutely necessary e.g. button requires visual separation from a patterned background. @supported Available in v5.x with theme version 3\n- `contained-tonal` - button with a secondary background color, an alternative middle ground between contained and outlined buttons. @supported Available in v5.x with theme version 3", + "defaultValue": { + "value": "'text'", + "computed": false + } + }, + "dark": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the color is a dark color. A dark button will render light text and vice-versa. Only applicable for:\n * `contained` mode for theme version 2\n * `contained`, `contained-tonal` and `elevated` modes for theme version 3." + }, + "compact": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Use a compact look, useful for `text` buttons in a row." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "@deprecated Deprecated in v5.x - use `buttonColor` or `textColor` instead.\nCustom text color for flat button, or background color for contained button." + }, + "buttonColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom button's background color." + }, + "textColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom button's text color." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "loading": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show a loading indicator." + }, + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `Button`." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Label text of the button." + }, + "uppercase": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Make the label text uppercased. Note that this won't work if you pass React elements as children." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button." + }, + "accessibilityHint": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility hint for the button. This is read by the screen reader when the user taps the button." + }, + "accessibilityRole": { + "required": false, + "tsType": { + "name": "AccessibilityRole" + }, + "description": "Accessibility role for the button. The \"button\" role is set by default.", + "defaultValue": { + "value": "'button'", + "computed": false + } + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onPressIn": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute as soon as the touchable element is pressed and invoked even before onPress." + }, + "onPressOut": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute as soon as the touch is released even before onPress." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before executing `onLongPress`." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style of button's inner content.\nUse this prop to apply custom height and width, to set a custom padding or to set the icon on the right with `flexDirection: 'row-reverse'`." + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "labelStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the button text." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "touchableRef": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "Reference for the touchable" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests.", + "defaultValue": { + "value": "'button'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Button/Button.tsx" + ] + }, + "Card/Card": { + "filepath": "Card/Card.tsx", + "title": "Card", + "description": "A card is a sheet of material that serves as an entry point to more detailed information.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar, Button, Card, Text } from 'react-native-paper';\n\nconst LeftContent = props => \n\nconst MyComponent = () => (\n \n \n \n Card title\n Card content\n \n \n \n \n \n \n \n);\n\nexport default MyComponent;\n```", + "link": "card", + "data": { + "description": "A card is a sheet of material that serves as an entry point to more detailed information.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar, Button, Card, Text } from 'react-native-paper';\n\nconst LeftContent = props => \n\nconst MyComponent = () => (\n \n \n \n Card title\n Card content\n \n \n \n \n \n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "Card", + "methods": [], + "statics": [], + "props": { + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'elevated' | 'outlined' | 'contained'", + "elements": [ + { + "name": "literal", + "value": "'elevated'" + }, + { + "name": "literal", + "value": "'outlined'" + }, + { + "name": "literal", + "value": "'contained'" + } + ] + }, + "description": "Mode of the Card.\n- `elevated` - Card with elevation.\n- `contained` - Card without outline and elevation @supported Available in v5.x with theme version 3\n- `outlined` - Card with an outline.", + "defaultValue": { + "value": "'elevated'", + "computed": false + } + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Card`." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onPressIn": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute as soon as the touchable element is pressed and invoked even before onPress." + }, + "onPressOut": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute as soon as the touch is released even before onPress." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before executing `onLongPress`." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "If true, disable all interactions for this component." + }, + "elevation": { + "required": false, + "tsType": { + "name": "union", + "raw": "0 | 1 | 2 | 3 | 4 | 5 | Animated.Value", + "elements": [ + { + "name": "literal", + "value": "0" + }, + { + "name": "literal", + "value": "1" + }, + { + "name": "literal", + "value": "2" + }, + { + "name": "literal", + "value": "3" + }, + { + "name": "literal", + "value": "4" + }, + { + "name": "literal", + "value": "5" + }, + { + "name": "Animated.Value" + } + ] + }, + "description": "Changes Card shadow and background on iOS and Android.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style of card's inner content." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Pass down testID from card props to touchable", + "defaultValue": { + "value": "'card'", + "computed": false + } + }, + "accessible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Pass down accessible from card props to touchable" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Card/Card.tsx" + ] + }, + "Card/CardActions": { + "filepath": "Card/CardActions.tsx", + "title": "Card.Actions", + "description": "A component to show a list of actions inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Card, Button } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n \n \n \n);\n\nexport default MyComponent;\n```", + "link": "card-actions", + "data": { + "description": "A component to show a list of actions inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Card, Button } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n \n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "Card.Actions", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Items inside the `CardActions`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Card/CardActions.tsx" + ], + "group": "Card" + }, + "Card/CardContent": { + "filepath": "Card/CardContent.tsx", + "title": "Card.Content", + "description": "A component to show content inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Card, Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n Card title\n Card content\n \n \n);\n\nexport default MyComponent;\n```", + "link": "card-content", + "data": { + "description": "A component to show content inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Card, Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n Card title\n Card content\n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "Card.Content", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Items inside the `Card.Content`." + }, + "index": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@internal" + }, + "total": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@internal" + }, + "siblings": { + "required": false, + "tsType": { + "name": "Array", + "elements": [ + { + "name": "string" + } + ], + "raw": "Array" + }, + "description": "@internal" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Card/CardContent.tsx" + ], + "group": "Card" + }, + "Card/CardCover": { + "filepath": "Card/CardCover.tsx", + "title": "Card.Cover", + "description": "A component to show a cover image inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Card } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n);\n\nexport default MyComponent;\n```\n\n@extends Image props https://reactnative.dev/docs/image#props", + "link": "card-cover", + "data": { + "description": "A component to show a cover image inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Card } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n);\n\nexport default MyComponent;\n```\n\n@extends Image props https://reactnative.dev/docs/image#props", + "displayName": "Card.Cover", + "methods": [], + "statics": [], + "props": { + "index": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@internal" + }, + "total": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@internal" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Card/CardCover.tsx" + ], + "group": "Card" + }, + "Card/CardTitle": { + "filepath": "Card/CardTitle.tsx", + "title": "Card.Title", + "description": "A component to show a title, subtitle and an avatar inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar, Card, IconButton } from 'react-native-paper';\n\nconst MyComponent = () => (\n }\n right={(props) => {}} />}\n />\n);\n\nexport default MyComponent;\n```", + "link": "card-title", + "data": { + "description": "A component to show a title, subtitle and an avatar inside a Card.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Avatar, Card, IconButton } from 'react-native-paper';\n\nconst MyComponent = () => (\n }\n right={(props) => {}} />}\n />\n);\n\nexport default MyComponent;\n```", + "displayName": "Card.Title", + "methods": [], + "statics": [], + "props": { + "title": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text for the title. Note that this will only accept a string or ``-based node." + }, + "titleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the title." + }, + "titleNumberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Number of lines for the title.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "titleVariant": { + "required": false, + "tsType": { + "name": "unknown" + }, + "description": "@supported Available in v5.x with theme version 3\n\nTitle text variant defines appropriate text styles for type role and its size.\nAvailable variants:\n\n Display: `displayLarge`, `displayMedium`, `displaySmall`\n\n Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`\n\n Title: `titleLarge`, `titleMedium`, `titleSmall`\n\n Label: `labelLarge`, `labelMedium`, `labelSmall`\n\n Body: `bodyLarge`, `bodyMedium`, `bodySmall`", + "defaultValue": { + "value": "'bodyLarge'", + "computed": false + } + }, + "subtitle": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text for the subtitle. Note that this will only accept a string or ``-based node." + }, + "subtitleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the subtitle." + }, + "subtitleNumberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Number of lines for the subtitle.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "subtitleVariant": { + "required": false, + "tsType": { + "name": "unknown" + }, + "description": "@supported Available in v5.x with theme version 3\n\nSubtitle text variant defines appropriate text styles for type role and its size.\nAvailable variants:\n\n Display: `displayLarge`, `displayMedium`, `displaySmall`\n\n Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`\n\n Title: `titleLarge`, `titleMedium`, `titleSmall`\n\n Label: `labelLarge`, `labelMedium`, `labelSmall`\n\n Body: `bodyLarge`, `bodyMedium`, `bodySmall`", + "defaultValue": { + "value": "'bodyMedium'", + "computed": false + } + }, + "left": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { size: number }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ size: number }", + "signature": { + "properties": [ + { + "key": "size", + "value": { + "name": "number", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the left side." + }, + "leftStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the left element wrapper." + }, + "right": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { size: number }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ size: number }", + "signature": { + "properties": [ + { + "key": "size", + "value": { + "name": "number", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the right side." + }, + "rightStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the right element wrapper." + }, + "index": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@internal" + }, + "total": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@internal" + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach." + }, + "subtitleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a subtitle font can reach." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Card/CardTitle.tsx" + ], + "group": "Card" + }, + "Checkbox/Checkbox": { + "filepath": "Checkbox/Checkbox.tsx", + "title": "Checkbox", + "description": "Checkboxes allow the selection of multiple options from a set.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Checkbox } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [checked, setChecked] = React.useState(false);\n\n return (\n {\n setChecked(!checked);\n }}\n />\n );\n};\n\nexport default MyComponent;\n```", + "link": "checkbox", + "data": { + "description": "Checkboxes allow the selection of multiple options from a set.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Checkbox } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [checked, setChecked] = React.useState(false);\n\n return (\n {\n setChecked(!checked);\n }}\n />\n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Checkbox", + "methods": [], + "statics": [], + "props": { + "status": { + "required": true, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked' | 'indeterminate'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + }, + { + "name": "literal", + "value": "'indeterminate'" + } + ] + }, + "description": "Status of checkbox." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether checkbox is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "uncheckedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for unchecked checkbox." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for checkbox." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Checkbox/Checkbox.tsx" + ] + }, + "Checkbox/CheckboxAndroid": { + "filepath": "Checkbox/CheckboxAndroid.tsx", + "title": "Checkbox.Android", + "description": "Checkboxes allow the selection of multiple options from a set.\nThis component follows platform guidelines for Android, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "checkbox-android", + "data": { + "description": "Checkboxes allow the selection of multiple options from a set.\nThis component follows platform guidelines for Android, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "Checkbox.Android", + "methods": [], + "statics": [], + "props": { + "status": { + "required": true, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked' | 'indeterminate'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + }, + { + "name": "literal", + "value": "'indeterminate'" + } + ] + }, + "description": "Status of checkbox." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether checkbox is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "uncheckedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for unchecked checkbox." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for checkbox." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Checkbox/CheckboxAndroid.tsx" + ], + "group": "Checkbox" + }, + "Checkbox/CheckboxIOS": { + "filepath": "Checkbox/CheckboxIOS.tsx", + "title": "Checkbox.IOS", + "description": "Checkboxes allow the selection of multiple options from a set.\nThis component follows platform guidelines for iOS, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "checkbox-ios", + "data": { + "description": "Checkboxes allow the selection of multiple options from a set.\nThis component follows platform guidelines for iOS, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "Checkbox.IOS", + "methods": [], + "statics": [], + "props": { + "status": { + "required": true, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked' | 'indeterminate'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + }, + { + "name": "literal", + "value": "'indeterminate'" + } + ] + }, + "description": "Status of checkbox." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether checkbox is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for checkbox." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Checkbox/CheckboxIOS.tsx" + ], + "group": "Checkbox" + }, + "Checkbox/CheckboxItem": { + "filepath": "Checkbox/CheckboxItem.tsx", + "title": "Checkbox.Item", + "description": "Checkbox.Item allows you to press the whole row (item) instead of only the Checkbox.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Checkbox } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n);\n\nexport default MyComponent;\n```", + "link": "checkbox-item", + "data": { + "description": "Checkbox.Item allows you to press the whole row (item) instead of only the Checkbox.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Checkbox } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "Checkbox.Item", + "methods": [], + "statics": [], + "props": { + "status": { + "required": true, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked' | 'indeterminate'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + }, + { + "name": "literal", + "value": "'indeterminate'" + } + ] + }, + "description": "Status of checkbox." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether checkbox is disabled." + }, + "label": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Label to be displayed on the item." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the touchable. This is read by the screen reader when the user taps the touchable.", + "defaultValue": { + "value": "label", + "computed": true + } + }, + "uncheckedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for unchecked checkbox." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for checkbox." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Additional styles for container View." + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach.", + "defaultValue": { + "value": "1.5", + "computed": false + } + }, + "labelStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Label element." + }, + "labelVariant": { + "required": false, + "tsType": { + "name": "unknown" + }, + "description": "@supported Available in v5.x with theme version 3\n\nLabel text variant defines appropriate text styles for type role and its size.\nAvailable variants:\n\n Display: `displayLarge`, `displayMedium`, `displaySmall`\n\n Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`\n\n Title: `titleLarge`, `titleMedium`, `titleSmall`\n\n Label: `labelLarge`, `labelMedium`, `labelSmall`\n\n Body: `bodyLarge`, `bodyMedium`, `bodySmall`", + "defaultValue": { + "value": "'bodyLarge'", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + }, + "position": { + "required": false, + "tsType": { + "name": "union", + "raw": "'leading' | 'trailing'", + "elements": [ + { + "name": "literal", + "value": "'leading'" + }, + { + "name": "literal", + "value": "'trailing'" + } + ] + }, + "description": "Checkbox control position.", + "defaultValue": { + "value": "'trailing'", + "computed": false + } + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'android' | 'ios'", + "elements": [ + { + "name": "literal", + "value": "'android'" + }, + { + "name": "literal", + "value": "'ios'" + } + ] + }, + "description": "Whether `` or `` should be used.\nLeft undefined `` will be used." + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Checkbox/CheckboxItem.tsx" + ], + "group": "Checkbox" + }, + "Chip/Chip": { + "filepath": "Chip/Chip.tsx", + "title": "Chip", + "description": "Chips are compact elements that can represent inputs, attributes, or actions.\nThey can have an icon or avatar on the left, and a close button icon on the right.\nThey are typically used to:\n
    \n
  • Present multiple options
  • \n
  • Represent attributes active or chosen
  • \n
  • Present filter options
  • \n
  • Trigger actions related to primary content
  • \n
\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Chip } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}>Example Chip\n);\n\nexport default MyComponent;\n```", + "link": "chip", + "data": { + "description": "Chips are compact elements that can represent inputs, attributes, or actions.\nThey can have an icon or avatar on the left, and a close button icon on the right.\nThey are typically used to:\n
    \n
  • Present multiple options
  • \n
  • Represent attributes active or chosen
  • \n
  • Present filter options
  • \n
  • Trigger actions related to primary content
  • \n
\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Chip } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}>Example Chip\n);\n\nexport default MyComponent;\n```", + "displayName": "Chip", + "methods": [], + "statics": [], + "props": { + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'flat' | 'outlined'", + "elements": [ + { + "name": "literal", + "value": "'flat'" + }, + { + "name": "literal", + "value": "'outlined'" + } + ] + }, + "description": "Mode of the chip.\n- `flat` - flat chip without outline.\n- `outlined` - chip with an outline.", + "defaultValue": { + "value": "'flat'", + "computed": false + } + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text content of the `Chip`." + }, + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `Chip`. Both icon and avatar cannot be specified." + }, + "avatar": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Avatar to display for the `Chip`. Both icon and avatar cannot be specified." + }, + "closeIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display as the close button for the `Chip`. The icon appears only when the onClose prop is specified." + }, + "selected": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether chip is selected.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "selectedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Whether to style the chip color as selected.\nNote: With theme version 3 `selectedColor` doesn't apply to the `icon`.\n If you want specify custom color for the `icon`, render your own `Icon` component." + }, + "showSelectedOverlay": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nWhether to display overlay on selected chip", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "showSelectedCheck": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to display default check icon on selected chip.\nNote: Check will not be shown if `icon` is specified. If specified, `icon` will be shown regardless of `selected`.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the chip is disabled. A disabled chip is greyed out and `onPress` is not called on touch.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the chip. This is read by the screen reader when the user taps the chip." + }, + "closeIconAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the close icon. This is read by the screen reader when the user taps the close icon.", + "defaultValue": { + "value": "'Close'", + "computed": false + } + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "onPressIn": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute as soon as the touchable element is pressed and invoked even before onPress." + }, + "onPressOut": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute as soon as the touch is released even before onPress." + }, + "onClose": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on close button press. The close button appears only when this prop is specified." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before executing `onLongPress`." + }, + "compact": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nSets smaller horizontal paddings `12dp` around label, when there is only label." + }, + "elevated": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nWhether chip should have the elevation.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "textStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style of chip's text" + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Pass down testID from chip props to touchable for Detox tests.", + "defaultValue": { + "value": "'chip'", + "computed": false + } + }, + "ellipsizeMode": { + "required": false, + "tsType": { + "name": "EllipsizeProp" + }, + "description": "Ellipsize Mode for the children text" + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "accessibilityRole": { + "defaultValue": { + "value": "'button'", + "computed": false + }, + "required": false, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Chip/Chip.tsx" + ] + }, + "DataTable/DataTable": { + "filepath": "DataTable/DataTable.tsx", + "title": "DataTable", + "description": "Data tables allow displaying sets of data.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [page, setPage] = React.useState(0);\n const [numberOfItemsPerPageList] = React.useState([2, 3, 4]);\n const [itemsPerPage, onItemsPerPageChange] = React.useState(\n numberOfItemsPerPageList[0]\n );\n\n const [items] = React.useState([\n {\n key: 1,\n name: 'Cupcake',\n calories: 356,\n fat: 16,\n },\n {\n key: 2,\n name: 'Eclair',\n calories: 262,\n fat: 16,\n },\n {\n key: 3,\n name: 'Frozen yogurt',\n calories: 159,\n fat: 6,\n },\n {\n key: 4,\n name: 'Gingerbread',\n calories: 305,\n fat: 3.7,\n },\n ]);\n\n const from = page * itemsPerPage;\n const to = Math.min((page + 1) * itemsPerPage, items.length);\n\n React.useEffect(() => {\n setPage(0);\n }, [itemsPerPage]);\n\n return (\n \n \n Dessert\n Calories\n Fat\n \n\n {items.slice(from, to).map((item) => (\n \n {item.name}\n {item.calories}\n {item.fat}\n \n ))}\n\n setPage(page)}\n label={`${from + 1}-${to} of ${items.length}`}\n numberOfItemsPerPageList={numberOfItemsPerPageList}\n numberOfItemsPerPage={itemsPerPage}\n onItemsPerPageChange={onItemsPerPageChange}\n showFastPaginationControls\n selectPageDropdownLabel={'Rows per page'}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "link": "data-table", + "data": { + "description": "Data tables allow displaying sets of data.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [page, setPage] = React.useState(0);\n const [numberOfItemsPerPageList] = React.useState([2, 3, 4]);\n const [itemsPerPage, onItemsPerPageChange] = React.useState(\n numberOfItemsPerPageList[0]\n );\n\n const [items] = React.useState([\n {\n key: 1,\n name: 'Cupcake',\n calories: 356,\n fat: 16,\n },\n {\n key: 2,\n name: 'Eclair',\n calories: 262,\n fat: 16,\n },\n {\n key: 3,\n name: 'Frozen yogurt',\n calories: 159,\n fat: 6,\n },\n {\n key: 4,\n name: 'Gingerbread',\n calories: 305,\n fat: 3.7,\n },\n ]);\n\n const from = page * itemsPerPage;\n const to = Math.min((page + 1) * itemsPerPage, items.length);\n\n React.useEffect(() => {\n setPage(0);\n }, [itemsPerPage]);\n\n return (\n \n \n Dessert\n Calories\n Fat\n \n\n {items.slice(from, to).map((item) => (\n \n {item.name}\n {item.calories}\n {item.fat}\n \n ))}\n\n setPage(page)}\n label={`${from + 1}-${to} of ${items.length}`}\n numberOfItemsPerPageList={numberOfItemsPerPageList}\n numberOfItemsPerPage={itemsPerPage}\n onItemsPerPageChange={onItemsPerPageChange}\n showFastPaginationControls\n selectPageDropdownLabel={'Rows per page'}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "DataTable", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DataTable`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/DataTable/DataTable.tsx" + ] + }, + "DataTable/DataTableCell": { + "filepath": "DataTable/DataTableCell.tsx", + "title": "DataTable.Cell", + "description": "A component to show a single cell inside of a table.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n 1\n 2\n 3\n 4\n \n);\n\nexport default MyComponent;\n```\n\nIf you want to support multiline text, please use View instead, as multiline text doesn't comply with\nMD Guidelines (https://github.com/callstack/react-native-paper/issues/2381).\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "data-table-cell", + "data": { + "description": "A component to show a single cell inside of a table.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n 1\n 2\n 3\n 4\n \n);\n\nexport default MyComponent;\n```\n\nIf you want to support multiline text, please use View instead, as multiline text doesn't comply with\nMD Guidelines (https://github.com/callstack/react-native-paper/issues/2381).\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "DataTable.Cell", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DataTableCell`." + }, + "numeric": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Align the text to the right. Generally monetary or number fields are aligned to right." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "textStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Text content style of the `DataTableCell`." + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/DataTable/DataTableCell.tsx" + ], + "group": "DataTable" + }, + "DataTable/DataTableHeader": { + "filepath": "DataTable/DataTableHeader.tsx", + "title": "DataTable.Header", + "description": "A component to display title in table header.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n Dessert\n \n Calories\n Fat (g)\n \n \n);\n\nexport default MyComponent;\n```", + "link": "data-table-header", + "data": { + "description": "A component to display title in table header.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n Dessert\n \n Calories\n Fat (g)\n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "DataTable.Header", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DataTableHeader`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/DataTable/DataTableHeader.tsx" + ], + "group": "DataTable" + }, + "DataTable/DataTablePagination": { + "filepath": "DataTable/DataTablePagination.tsx", + "title": "DataTable.Pagination", + "description": "A component to show pagination for data table.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst numberOfItemsPerPageList = [2, 3, 4];\n\nconst items = [\n {\n key: 1,\n name: 'Page 1',\n },\n {\n key: 2,\n name: 'Page 2',\n },\n {\n key: 3,\n name: 'Page 3',\n },\n];\n\nconst MyComponent = () => {\n const [page, setPage] = React.useState(0);\n const [numberOfItemsPerPage, onItemsPerPageChange] = React.useState(numberOfItemsPerPageList[0]);\n const from = page * numberOfItemsPerPage;\n const to = Math.min((page + 1) * numberOfItemsPerPage, items.length);\n\n React.useEffect(() => {\n setPage(0);\n }, [numberOfItemsPerPage]);\n\n return (\n \n setPage(page)}\n label={`${from + 1}-${to} of ${items.length}`}\n showFastPaginationControls\n numberOfItemsPerPageList={numberOfItemsPerPageList}\n numberOfItemsPerPage={numberOfItemsPerPage}\n onItemsPerPageChange={onItemsPerPageChange}\n selectPageDropdownLabel={'Rows per page'}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "link": "data-table-pagination", + "data": { + "description": "A component to show pagination for data table.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst numberOfItemsPerPageList = [2, 3, 4];\n\nconst items = [\n {\n key: 1,\n name: 'Page 1',\n },\n {\n key: 2,\n name: 'Page 2',\n },\n {\n key: 3,\n name: 'Page 3',\n },\n];\n\nconst MyComponent = () => {\n const [page, setPage] = React.useState(0);\n const [numberOfItemsPerPage, onItemsPerPageChange] = React.useState(numberOfItemsPerPageList[0]);\n const from = page * numberOfItemsPerPage;\n const to = Math.min((page + 1) * numberOfItemsPerPage, items.length);\n\n React.useEffect(() => {\n setPage(0);\n }, [numberOfItemsPerPage]);\n\n return (\n \n setPage(page)}\n label={`${from + 1}-${to} of ${items.length}`}\n showFastPaginationControls\n numberOfItemsPerPageList={numberOfItemsPerPageList}\n numberOfItemsPerPage={numberOfItemsPerPage}\n onItemsPerPageChange={onItemsPerPageChange}\n selectPageDropdownLabel={'Rows per page'}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "DataTable.Pagination", + "methods": [], + "statics": [], + "props": { + "page": { + "required": true, + "tsType": { + "name": "number" + }, + "description": "The currently visible page (starting with 0)." + }, + "numberOfPages": { + "required": true, + "tsType": { + "name": "number" + }, + "description": "The total number of pages." + }, + "onPageChange": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(page: number) => void", + "signature": { + "arguments": [ + { + "name": "page", + "type": { + "name": "number" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on page change." + }, + "showFastPaginationControls": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show fast forward and fast rewind buttons in pagination. False by default.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "paginationControlRippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the pagination control ripple effect." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "numberOfItemsPerPage": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The current number of rows per page." + }, + "numberOfItemsPerPageList": { + "required": false, + "tsType": { + "name": "Array", + "elements": [ + { + "name": "number" + } + ], + "raw": "Array" + }, + "description": "Options for a number of rows per page to choose from." + }, + "onItemsPerPageChange": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(numberOfItemsPerPage: number) => void", + "signature": { + "arguments": [ + { + "name": "numberOfItemsPerPage", + "type": { + "name": "number" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "The function to set the number of rows per page." + }, + "dropdownItemRippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the dropdown item ripple effect." + }, + "selectPageDropdownRippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the select page dropdown ripple effect." + }, + "selectPageDropdownLabel": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Label text for select page dropdown to display." + }, + "selectPageDropdownAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "AccessibilityLabel for `selectPageDropdownLabel`." + }, + "label": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Label text to display which indicates current pagination." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "AccessibilityLabel for `label`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/DataTable/DataTablePagination.tsx" + ], + "group": "DataTable" + }, + "DataTable/DataTableRow": { + "filepath": "DataTable/DataTableRow.tsx", + "title": "DataTable.Row", + "description": "A component to show a single row inside of a table.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n 1\n 2\n 3\n 4\n \n);\n\nexport default MyComponent;\n```\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "data-table-row", + "data": { + "description": "A component to show a single row inside of a table.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n 1\n 2\n 3\n 4\n \n);\n\nexport default MyComponent;\n```\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "DataTable.Row", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DataTableRow`." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "pointerEvents": { + "required": false, + "tsType": { + "name": "ViewProps['pointerEvents']", + "raw": "ViewProps['pointerEvents']" + }, + "description": "`pointerEvents` passed to the `View` container, which is wrapping children within `TouchableRipple`." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/DataTable/DataTableRow.tsx" + ], + "group": "DataTable" + }, + "DataTable/DataTableTitle": { + "filepath": "DataTable/DataTableTitle.tsx", + "title": "DataTable.Title", + "description": "A component to display title in table header.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n Dessert\n \n Calories\n Fat (g)\n \n \n);\n\nexport default MyComponent;\n```", + "link": "data-table-title", + "data": { + "description": "A component to display title in table header.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { DataTable } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n Dessert\n \n Calories\n Fat (g)\n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "DataTable.Title", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text content of the `DataTableTitle`." + }, + "numeric": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Align the text to the right. Generally monetary or number fields are aligned to right." + }, + "sortDirection": { + "required": false, + "tsType": { + "name": "union", + "raw": "'ascending' | 'descending'", + "elements": [ + { + "name": "literal", + "value": "'ascending'" + }, + { + "name": "literal", + "value": "'descending'" + } + ] + }, + "description": "Direction of sorting. An arrow indicating the direction is displayed when this is given." + }, + "numberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of lines to show.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "textStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Text content style of the `DataTableTitle`." + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/DataTable/DataTableTitle.tsx" + ], + "group": "DataTable" + }, + "Dialog/Dialog": { + "filepath": "Dialog/Dialog.tsx", + "title": "Dialog", + "description": "Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks.\nTo render the `Dialog` above other components, you'll need to wrap it with the [`Portal`](../../Portal) component.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Button, Dialog, Portal, PaperProvider, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const showDialog = () => setVisible(true);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n \n \n Alert\n \n This is simple dialog\n \n \n \n \n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "dialog", + "data": { + "description": "Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks.\nTo render the `Dialog` above other components, you'll need to wrap it with the [`Portal`](../../Portal) component.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Button, Dialog, Portal, PaperProvider, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const showDialog = () => setVisible(true);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n \n \n Alert\n \n This is simple dialog\n \n \n \n \n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Dialog", + "methods": [], + "statics": [], + "props": { + "dismissable": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Determines whether clicking outside the dialog dismiss it.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "dismissableBackButton": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Determines whether clicking Android hardware back button dismiss dialog.", + "defaultValue": { + "value": "dismissable", + "computed": true + } + }, + "onDismiss": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Callback that is called when the user dismisses the dialog." + }, + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Determines Whether the dialog is visible.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Dialog`." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Dialog/Dialog.tsx" + ] + }, + "Dialog/DialogActions": { + "filepath": "Dialog/DialogActions.tsx", + "title": "Dialog.Actions", + "description": "A component to show a list of actions in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Button, Dialog, Portal } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "dialog-actions", + "data": { + "description": "A component to show a list of actions in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Button, Dialog, Portal } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Dialog.Actions", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DialogActions`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Dialog/DialogActions.tsx" + ], + "group": "Dialog" + }, + "Dialog/DialogContent": { + "filepath": "Dialog/DialogContent.tsx", + "title": "Dialog.Content", + "description": "A component to show content in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n This is simple dialog\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "dialog-content", + "data": { + "description": "A component to show content in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n This is simple dialog\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Dialog.Content", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DialogContent`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Dialog/DialogContent.tsx" + ], + "group": "Dialog" + }, + "Dialog/DialogIcon": { + "filepath": "Dialog/DialogIcon.tsx", + "title": "Dialog.Icon", + "description": "@supported Available in v5.x with theme version 3\nA component to show an icon in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n This is a title\n \n This is simple dialog\n \n \n \n );\n};\n\nconst styles = StyleSheet.create({\n title: {\n textAlign: 'center',\n },\n})\n\nexport default MyComponent;\n```", + "link": "dialog-icon", + "data": { + "description": "@supported Available in v5.x with theme version 3\nA component to show an icon in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n This is a title\n \n This is simple dialog\n \n \n \n );\n};\n\nconst styles = StyleSheet.create({\n title: {\n textAlign: 'center',\n },\n})\n\nexport default MyComponent;\n```", + "displayName": "Dialog.Icon", + "methods": [], + "statics": [], + "props": { + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for action icon." + }, + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Name of the icon to show." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Optional icon size.", + "defaultValue": { + "value": "24", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Dialog/DialogIcon.tsx" + ], + "group": "Dialog" + }, + "Dialog/DialogScrollArea": { + "filepath": "Dialog/DialogScrollArea.tsx", + "title": "Dialog.ScrollArea", + "description": "A component to show a scrollable content in a Dialog. The component only provides appropriate styling.\nFor the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ScrollView } from 'react-native';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n \n This is a scrollable area\n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "dialog-scroll-area", + "data": { + "description": "A component to show a scrollable content in a Dialog. The component only provides appropriate styling.\nFor the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ScrollView } from 'react-native';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n \n \n This is a scrollable area\n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Dialog.ScrollArea", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `DialogScrollArea`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Dialog/DialogScrollArea.tsx" + ], + "group": "Dialog" + }, + "Dialog/DialogTitle": { + "filepath": "Dialog/DialogTitle.tsx", + "title": "Dialog.Title", + "description": "A component to show a title in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n This is a title\n \n This is simple dialog\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "dialog-title", + "data": { + "description": "A component to show a title in a Dialog.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Dialog, Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const hideDialog = () => setVisible(false);\n\n return (\n \n \n This is a title\n \n This is simple dialog\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Dialog.Title", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Title text for the `DialogTitle`." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Dialog/DialogTitle.tsx" + ], + "group": "Dialog" + }, + "Divider": { + "filepath": "Divider.tsx", + "title": "Divider", + "description": "A divider is a thin, lightweight separator that groups content in lists and page layouts.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Divider, Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n Lemon\n \n Mango\n \n \n);\n\nexport default MyComponent;\n```", + "link": "divider", + "data": { + "description": "A divider is a thin, lightweight separator that groups content in lists and page layouts.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Divider, Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n Lemon\n \n Mango\n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "Divider", + "methods": [], + "statics": [], + "props": { + "leftInset": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@renamed Renamed from 'inset' to 'leftInset` in v5.x\nWhether divider has a left inset." + }, + "horizontalInset": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\n Whether divider has a horizontal inset on both sides.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "bold": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\n Whether divider should be bolded.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Divider.tsx" + ] + }, + "Drawer/DrawerCollapsedItem": { + "filepath": "Drawer/DrawerCollapsedItem.tsx", + "title": "Drawer.CollapsedItem", + "description": "Note: Available in v5.x with theme version 3\n\nCollapsed component used to show an action item with an icon and optionally label in a navigation drawer.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Drawer } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "link": "drawer-collapsed-item", + "data": { + "description": "Note: Available in v5.x with theme version 3\n\nCollapsed component used to show an action item with an icon and optionally label in a navigation drawer.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Drawer } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Drawer.CollapsedItem", + "methods": [], + "statics": [], + "props": { + "label": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "The label text of the item." + }, + "badge": { + "required": false, + "tsType": { + "name": "union", + "raw": "string | number | boolean", + "elements": [ + { + "name": "string" + }, + { + "name": "number" + }, + { + "name": "boolean" + } + ] + }, + "description": "Badge to show on the icon, can be `true` to show a dot, `string` or `number` to show text.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the item is disabled." + }, + "focusedIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "@renamed Renamed from 'icon' to 'focusedIcon' in v5.x\nIcon to use as the focused destination icon, can be a string, an image source or a react component" + }, + "unfocusedIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "@renamed Renamed from 'icon' to 'focusedIcon' in v5.x\nIcon to use as the unfocused destination icon, can be a string, an image source or a react component" + }, + "active": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to highlight the drawer item as active." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'drawer-collapsed-item'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Drawer/DrawerCollapsedItem.tsx" + ], + "group": "Drawer" + }, + "Drawer/DrawerItem": { + "filepath": "Drawer/DrawerItem.tsx", + "title": "Drawer.Item", + "description": "A component used to show an action item with an icon and a label in a navigation drawer.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Drawer } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "link": "drawer-item", + "data": { + "description": "A component used to show an action item with an icon and a label in a navigation drawer.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Drawer } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Drawer.Item", + "methods": [], + "statics": [], + "props": { + "label": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "The label text of the item." + }, + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `DrawerItem`." + }, + "active": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to highlight the drawer item as active." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the item is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button." + }, + "right": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { color: string }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ color: string }", + "signature": { + "properties": [ + { + "key": "color", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the right side. For instance a Badge." + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Drawer/DrawerItem.tsx" + ], + "group": "Drawer" + }, + "Drawer/DrawerSection": { + "filepath": "Drawer/DrawerSection.tsx", + "title": "Drawer.Section", + "description": "A component to group content inside a navigation drawer.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Drawer } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [active, setActive] = React.useState('');\n\n return (\n \n setActive('first')}\n />\n setActive('second')}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "link": "drawer-section", + "data": { + "description": "A component to group content inside a navigation drawer.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Drawer } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [active, setActive] = React.useState('');\n\n return (\n \n setActive('first')}\n />\n setActive('second')}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Drawer.Section", + "methods": [], + "statics": [], + "props": { + "title": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Title to show as the header for the section." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Drawer.Section`." + }, + "showDivider": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show `Divider` at the end of the section. True by default.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Drawer/DrawerSection.tsx" + ], + "group": "Drawer" + }, + "FAB/FAB": { + "filepath": "FAB/FAB.tsx", + "title": "FAB", + "description": "A floating action button represents the primary action on a screen. It appears in front of all screen content.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { FAB } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}\n />\n);\n\nconst styles = StyleSheet.create({\n fab: {\n position: 'absolute',\n margin: 16,\n right: 0,\n bottom: 0,\n },\n})\n\nexport default MyComponent;\n```", + "link": "fab", + "data": { + "description": "A floating action button represents the primary action on a screen. It appears in front of all screen content.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { FAB } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}\n />\n);\n\nconst styles = StyleSheet.create({\n fab: {\n position: 'absolute',\n margin: 16,\n right: 0,\n bottom: 0,\n },\n})\n\nexport default MyComponent;\n```", + "displayName": "FAB", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `FAB`. It's optional only if `label` is defined." + }, + "label": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Optional label for extended `FAB`. It's optional only if `icon` is defined." + }, + "uppercase": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Make the label text uppercased." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the FAB. This is read by the screen reader when the user taps the FAB.\nUses `label` by default if specified.", + "defaultValue": { + "value": "label", + "computed": true + } + }, + "accessibilityState": { + "required": false, + "tsType": { + "name": "AccessibilityState" + }, + "description": "Accessibility state for the FAB. This is read by the screen reader when the user taps the FAB." + }, + "animated": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether an icon change is animated.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "small": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@deprecated Deprecated in v.5x - use prop size=\"small\".\n\n Whether FAB is mini-sized, used to create visual continuity with other elements. This has no effect if `label` is specified." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for the icon and label of the `FAB`." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether `FAB` is disabled. A disabled button is greyed out and `onPress` is not called on touch." + }, + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether `FAB` is currently visible.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "loading": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show a loading indicator." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before executing `onLongPress`." + }, + "size": { + "required": false, + "tsType": { + "name": "union", + "raw": "'small' | 'medium' | 'large'", + "elements": [ + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'medium'" + }, + { + "name": "literal", + "value": "'large'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nSize of the `FAB`.\n- `small` - FAB with small height (40).\n- `medium` - FAB with default medium height (56).\n- `large` - FAB with large height (96).", + "defaultValue": { + "value": "'medium'", + "computed": false + } + }, + "customSize": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Custom size for the `FAB`. This prop takes precedence over size prop" + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'flat' | 'elevated'", + "elements": [ + { + "name": "literal", + "value": "'flat'" + }, + { + "name": "literal", + "value": "'elevated'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nMode of the `FAB`. You can change the mode to adjust the the shadow:\n- `flat` - button without a shadow.\n- `elevated` - button with a shadow.", + "defaultValue": { + "value": "'elevated'", + "computed": false + } + }, + "variant": { + "required": false, + "tsType": { + "name": "union", + "raw": "'primary' | 'secondary' | 'tertiary' | 'surface'", + "elements": [ + { + "name": "literal", + "value": "'primary'" + }, + { + "name": "literal", + "value": "'secondary'" + }, + { + "name": "literal", + "value": "'tertiary'" + }, + { + "name": "literal", + "value": "'surface'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nColor mappings variant for combinations of container and icon colors.", + "defaultValue": { + "value": "'primary'", + "computed": false + } + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'fab'", + "computed": false + } + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/FAB/FAB.tsx" + ] + }, + "FAB/AnimatedFAB": { + "filepath": "FAB/AnimatedFAB.tsx", + "title": "AnimatedFAB", + "description": "An animated, extending horizontally floating action button represents the primary action in an application.\n\n## Usage\n```js\nimport React from 'react';\nimport {\n StyleProp,\n ViewStyle,\n Animated,\n StyleSheet,\n Platform,\n ScrollView,\n Text,\n SafeAreaView,\n I18nManager,\n} from 'react-native';\nimport { AnimatedFAB } from 'react-native-paper';\n\nconst MyComponent = ({\n animatedValue,\n visible,\n extended,\n label,\n animateFrom,\n style,\n iconMode,\n}) => {\n const [isExtended, setIsExtended] = React.useState(true);\n\n const isIOS = Platform.OS === 'ios';\n\n const onScroll = ({ nativeEvent }) => {\n const currentScrollPosition =\n Math.floor(nativeEvent?.contentOffset?.y) ?? 0;\n\n setIsExtended(currentScrollPosition <= 0);\n };\n\n const fabStyle = { [animateFrom]: 16 };\n\n return (\n \n \n {[...new Array(100).keys()].map((_, i) => (\n {i}\n ))}\n \n console.log('Pressed')}\n visible={visible}\n animateFrom={'right'}\n iconMode={'static'}\n style={[styles.fabStyle, style, fabStyle]}\n />\n \n );\n};\n\nexport default MyComponent;\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow: 1,\n },\n fabStyle: {\n bottom: 16,\n right: 16,\n position: 'absolute',\n },\n});\n```", + "link": "animated-fab", + "data": { + "description": "An animated, extending horizontally floating action button represents the primary action in an application.\n\n## Usage\n```js\nimport React from 'react';\nimport {\n StyleProp,\n ViewStyle,\n Animated,\n StyleSheet,\n Platform,\n ScrollView,\n Text,\n SafeAreaView,\n I18nManager,\n} from 'react-native';\nimport { AnimatedFAB } from 'react-native-paper';\n\nconst MyComponent = ({\n animatedValue,\n visible,\n extended,\n label,\n animateFrom,\n style,\n iconMode,\n}) => {\n const [isExtended, setIsExtended] = React.useState(true);\n\n const isIOS = Platform.OS === 'ios';\n\n const onScroll = ({ nativeEvent }) => {\n const currentScrollPosition =\n Math.floor(nativeEvent?.contentOffset?.y) ?? 0;\n\n setIsExtended(currentScrollPosition <= 0);\n };\n\n const fabStyle = { [animateFrom]: 16 };\n\n return (\n \n \n {[...new Array(100).keys()].map((_, i) => (\n {i}\n ))}\n \n console.log('Pressed')}\n visible={visible}\n animateFrom={'right'}\n iconMode={'static'}\n style={[styles.fabStyle, style, fabStyle]}\n />\n \n );\n};\n\nexport default MyComponent;\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow: 1,\n },\n fabStyle: {\n bottom: 16,\n right: 16,\n position: 'absolute',\n },\n});\n```", + "displayName": "AnimatedFAB", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `FAB`." + }, + "label": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Label for extended `FAB`." + }, + "uppercase": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Make the label text uppercased." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the FAB. This is read by the screen reader when the user taps the FAB.\nUses `label` by default if specified.", + "defaultValue": { + "value": "label", + "computed": true + } + }, + "accessibilityState": { + "required": false, + "tsType": { + "name": "AccessibilityState" + }, + "description": "Accessibility state for the FAB. This is read by the screen reader when the user taps the FAB." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for the icon and label of the `FAB`." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether `FAB` is disabled. A disabled button is greyed out and `onPress` is not called on touch." + }, + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether `FAB` is currently visible.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before executing `onLongPress`." + }, + "iconMode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'static' | 'dynamic'", + "elements": [ + { + "name": "literal", + "value": "'static'" + }, + { + "name": "literal", + "value": "'dynamic'" + } + ] + }, + "description": "Whether icon should be translated to the end of extended `FAB` or be static and stay in the same place. The default value is `dynamic`.", + "defaultValue": { + "value": "'dynamic'", + "computed": false + } + }, + "animateFrom": { + "required": false, + "tsType": { + "name": "union", + "raw": "'left' | 'right'", + "elements": [ + { + "name": "literal", + "value": "'left'" + }, + { + "name": "literal", + "value": "'right'" + } + ] + }, + "description": "Indicates from which direction animation should be performed. The default value is `right`.", + "defaultValue": { + "value": "'right'", + "computed": false + } + }, + "extended": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether `FAB` should start animation to extend.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach." + }, + "variant": { + "required": false, + "tsType": { + "name": "union", + "raw": "'primary' | 'secondary' | 'tertiary' | 'surface'", + "elements": [ + { + "name": "literal", + "value": "'primary'" + }, + { + "name": "literal", + "value": "'secondary'" + }, + { + "name": "literal", + "value": "'tertiary'" + }, + { + "name": "literal", + "value": "'surface'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nColor mappings variant for combinations of container and icon colors.", + "defaultValue": { + "value": "'primary'", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'animated-fab'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/FAB/AnimatedFAB.tsx" + ] + }, + "FAB/FABGroup": { + "filepath": "FAB/FABGroup.tsx", + "title": "FAB.Group", + "description": "A component to display a stack of FABs with related actions in a speed dial.\nTo render the group above other components, you'll need to wrap it with the [`Portal`](../Portal) component.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { FAB, Portal, PaperProvider } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [state, setState] = React.useState({ open: false });\n\n const onStateChange = ({ open }) => setState({ open });\n\n const { open } = state;\n\n return (\n \n \n console.log('Pressed add') },\n {\n icon: 'star',\n label: 'Star',\n onPress: () => console.log('Pressed star'),\n },\n {\n icon: 'email',\n label: 'Email',\n onPress: () => console.log('Pressed email'),\n },\n {\n icon: 'bell',\n label: 'Remind',\n onPress: () => console.log('Pressed notifications'),\n },\n ]}\n onStateChange={onStateChange}\n onPress={() => {\n if (open) {\n // do something if the speed dial is open\n }\n }}\n />\n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "fab-group", + "data": { + "description": "A component to display a stack of FABs with related actions in a speed dial.\nTo render the group above other components, you'll need to wrap it with the [`Portal`](../Portal) component.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { FAB, Portal, PaperProvider } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [state, setState] = React.useState({ open: false });\n\n const onStateChange = ({ open }) => setState({ open });\n\n const { open } = state;\n\n return (\n \n \n console.log('Pressed add') },\n {\n icon: 'star',\n label: 'Star',\n onPress: () => console.log('Pressed star'),\n },\n {\n icon: 'email',\n label: 'Email',\n onPress: () => console.log('Pressed email'),\n },\n {\n icon: 'bell',\n label: 'Remind',\n onPress: () => console.log('Pressed notifications'),\n },\n ]}\n onStateChange={onStateChange}\n onPress={() => {\n if (open) {\n // do something if the speed dial is open\n }\n }}\n />\n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "FAB.Group", + "methods": [], + "statics": [], + "props": { + "actions": { + "required": true, + "tsType": { + "name": "Array", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{\n icon: IconSource;\n label?: string;\n color?: string;\n labelTextColor?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n style?: Animated.WithAnimatedValue>;\n containerStyle?: Animated.WithAnimatedValue>;\n wrapperStyle?: StyleProp;\n labelStyle?: StyleProp;\n labelMaxFontSizeMultiplier?: number;\n onPress: (e: GestureResponderEvent) => void;\n size?: 'small' | 'medium';\n testID?: string;\n rippleColor?: ColorValue;\n}", + "signature": { + "properties": [ + { + "key": "icon", + "value": { + "name": "IconSource", + "required": true + } + }, + { + "key": "label", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "color", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "labelTextColor", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "accessibilityLabel", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "accessibilityHint", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "style", + "value": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>", + "required": false + } + }, + { + "key": "containerStyle", + "value": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>", + "required": false + } + }, + { + "key": "wrapperStyle", + "value": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp", + "required": false + } + }, + { + "key": "labelStyle", + "value": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp", + "required": false + } + }, + { + "key": "labelMaxFontSizeMultiplier", + "value": { + "name": "number", + "required": false + } + }, + { + "key": "onPress", + "value": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + }, + "required": true + } + }, + { + "key": "size", + "value": { + "name": "union", + "raw": "'small' | 'medium'", + "elements": [ + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'medium'" + } + ], + "required": false + } + }, + { + "key": "testID", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "rippleColor", + "value": { + "name": "ColorValue", + "required": false + } + } + ] + } + } + ], + "raw": "Array<{\n icon: IconSource;\n label?: string;\n color?: string;\n labelTextColor?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n style?: Animated.WithAnimatedValue>;\n containerStyle?: Animated.WithAnimatedValue>;\n wrapperStyle?: StyleProp;\n labelStyle?: StyleProp;\n labelMaxFontSizeMultiplier?: number;\n onPress: (e: GestureResponderEvent) => void;\n size?: 'small' | 'medium';\n testID?: string;\n rippleColor?: ColorValue;\n}>" + }, + "description": "Action items to display in the form of a speed dial.\nAn action item should contain the following properties:\n- `icon`: icon to display (required)\n- `label`: optional label text\n- `color`: custom icon color of the action item\n- `labelTextColor`: custom label text color of the action item\n- `accessibilityLabel`: accessibility label for the action, uses label by default if specified\n- `accessibilityHint`: accessibility hint for the action\n- `style`: pass additional styles for the fab item, for example, `backgroundColor`\n- `containerStyle`: pass additional styles for the fab item label container, for example, `backgroundColor` @supported Available in 5.x\n- `wrapperStyle`: pass additional styles for the wrapper of the action item.\n- `labelStyle`: pass additional styles for the fab item label, for example, `fontSize`\n- `labelMaxFontSizeMultiplier`: specifies the largest possible scale a title font can reach.\n- `onPress`: callback that is called when `FAB` is pressed (required)\n- `onLongPress`: callback that is called when `FAB` is long pressed\n- `toggleStackOnLongPress`: callback that is called when `FAB` is long pressed\n- `size`: size of action item. Defaults to `small`. @supported Available in v5.x\n- `testID`: testID to be used on tests\n- `rippleColor`: color of the ripple effect." + }, + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `FAB`.\nYou can toggle it based on whether the speed dial is open to display a different icon." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the FAB. This is read by the screen reader when the user taps the FAB." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for the `FAB`." + }, + "backdropColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom backdrop color for opened speed dial background." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on pressing the `FAB`." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long pressing the `FAB`." + }, + "toggleStackOnLongPress": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Makes actions stack appear on long press instead of on press." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Changes the delay for long press reaction.", + "defaultValue": { + "value": "200", + "computed": false + } + }, + "enableLongPressWhenStackOpened": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Allows for onLongPress when stack is opened.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "open": { + "required": true, + "tsType": { + "name": "boolean" + }, + "description": "Whether the speed dial is open." + }, + "onStateChange": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(state: { open: boolean }) => void", + "signature": { + "arguments": [ + { + "name": "state", + "type": { + "name": "signature", + "type": "object", + "raw": "{ open: boolean }", + "signature": { + "properties": [ + { + "key": "open", + "value": { + "name": "boolean", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback which is called on opening and closing the speed dial.\nThe open state needs to be updated when it's called, otherwise the change is dropped." + }, + "visible": { + "required": true, + "tsType": { + "name": "boolean" + }, + "description": "Whether `FAB` is currently visible." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the group. You can use it to pass additional styles if you need.\nFor example, you can set an additional padding if you have a tab bar at the bottom." + }, + "fabStyle": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "Style for the FAB. It allows to pass the FAB button styles, such as backgroundColor." + }, + "variant": { + "required": false, + "tsType": { + "name": "union", + "raw": "'primary' | 'secondary' | 'tertiary' | 'surface'", + "elements": [ + { + "name": "literal", + "value": "'primary'" + }, + { + "name": "literal", + "value": "'secondary'" + }, + { + "name": "literal", + "value": "'tertiary'" + }, + { + "name": "literal", + "value": "'surface'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\n\nColor mappings variant for combinations of container and icon colors.", + "defaultValue": { + "value": "'primary'", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "label": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Optional label for `FAB`." + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Pass down testID from Group props to FAB." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/FAB/FABGroup.tsx" + ], + "group": "FAB" + }, + "HelperText/HelperText": { + "filepath": "HelperText/HelperText.tsx", + "title": "HelperText", + "description": "Helper text is used in conjuction with input elements to provide additional hints for the user.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { HelperText, TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState('');\n\n const onChangeText = text => setText(text);\n\n const hasErrors = () => {\n return !text.includes('@');\n };\n\n return (\n \n \n \n Email address is invalid!\n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "helper-text", + "data": { + "description": "Helper text is used in conjuction with input elements to provide additional hints for the user.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { HelperText, TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState('');\n\n const onChangeText = text => setText(text);\n\n const hasErrors = () => {\n return !text.includes('@');\n };\n\n return (\n \n \n \n Email address is invalid!\n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "HelperText", + "methods": [], + "statics": [], + "props": { + "type": { + "required": false, + "tsType": { + "name": "union", + "raw": "'error' | 'info'", + "elements": [ + { + "name": "literal", + "value": "'error'" + }, + { + "name": "literal", + "value": "'info'" + } + ] + }, + "description": "Type of the helper text.", + "defaultValue": { + "value": "'info'", + "computed": false + } + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text content of the HelperText." + }, + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to display the helper text.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "padding": { + "required": false, + "tsType": { + "name": "union", + "raw": "'none' | 'normal'", + "elements": [ + { + "name": "literal", + "value": "'none'" + }, + { + "name": "literal", + "value": "'normal'" + } + ] + }, + "description": "Whether to apply padding to the helper text.", + "defaultValue": { + "value": "'normal'", + "computed": false + } + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the text input tied with helper text is disabled." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/HelperText/HelperText.tsx" + ] + }, + "IconButton/IconButton": { + "filepath": "IconButton/IconButton.tsx", + "title": "IconButton", + "description": "An icon button is a button which displays only an icon without a label.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { IconButton, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}\n />\n);\n\nexport default MyComponent;\n```\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "icon-button", + "data": { + "description": "An icon button is a button which displays only an icon without a label.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { IconButton, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}\n />\n);\n\nexport default MyComponent;\n```\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "IconButton", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display." + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'outlined' | 'contained' | 'contained-tonal'", + "elements": [ + { + "name": "literal", + "value": "'outlined'" + }, + { + "name": "literal", + "value": "'contained'" + }, + { + "name": "literal", + "value": "'contained-tonal'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nMode of the icon button. By default there is no specified mode - only pressable icon will be rendered." + }, + "iconColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "@renamed Renamed from 'color' to 'iconColor' in v5.x\nColor of the icon." + }, + "containerColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Background color of the icon container." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "selected": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nWhether icon button is selected. A selected button receives alternative combination of icon and container colors.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Size of the icon.", + "defaultValue": { + "value": "24", + "computed": false + } + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch." + }, + "animated": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether an icon change is animated.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style of button's inner content.\nUse this prop to apply custom height and width or to set a custom padding`." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'icon-button'", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "loading": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show a loading indicator.", + "defaultValue": { + "value": "false", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/IconButton/IconButton.tsx" + ] + }, + "Icon": { + "filepath": "Icon.tsx", + "title": "Icon", + "description": "An icon component which renders icon from vector library.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Icon, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "link": "icon", + "data": { + "description": "An icon component which renders icon from vector library.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Icon, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Icon", + "methods": [], + "statics": [], + "props": { + "size": { + "required": true, + "tsType": { + "name": "number" + }, + "description": "Size of icon." + }, + "allowFontScaling": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "" + }, + "source": { + "required": true, + "tsType": { + "name": "any" + }, + "description": "Icon to display." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Color of the icon." + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Icon.tsx" + ] + }, + "List/ListAccordion": { + "filepath": "List/ListAccordion.tsx", + "title": "List.Accordion", + "description": "A component used to display an expandable list item.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [expanded, setExpanded] = React.useState(true);\n\n const handlePress = () => setExpanded(!expanded);\n\n return (\n \n }>\n \n \n \n\n }\n expanded={expanded}\n onPress={handlePress}>\n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "list-accordion", + "data": { + "description": "A component used to display an expandable list item.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [expanded, setExpanded] = React.useState(true);\n\n const handlePress = () => setExpanded(!expanded);\n\n return (\n \n }>\n \n \n \n\n }\n expanded={expanded}\n onPress={handlePress}>\n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "List.Accordion", + "methods": [], + "statics": [], + "props": { + "title": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Title text for the list accordion." + }, + "description": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Description text for the list accordion." + }, + "left": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { color: string; style: Style }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ color: string; style: Style }", + "signature": { + "properties": [ + { + "key": "color", + "value": { + "name": "string", + "required": true + } + }, + { + "key": "style", + "value": { + "name": "Style", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the left side." + }, + "right": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { isExpanded: boolean }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ isExpanded: boolean }", + "signature": { + "properties": [ + { + "key": "isExpanded", + "value": { + "name": "boolean", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the right side." + }, + "expanded": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the accordion is expanded\nIf this prop is provided, the accordion will behave as a \"controlled component\".\nYou'll need to update this prop when you want to toggle the component or on `onPress`." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "delayLongPress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before executing `onLongPress`." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the section." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the root TouchableRipple container." + }, + "containerStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the outermost container that wraps the entire content, including left and right items and both title and description." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the content container, which wraps the title and description." + }, + "titleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Title element." + }, + "descriptionStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Description element." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "titleNumberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Truncate Title text such that the total number of lines does not\nexceed this number.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "descriptionNumberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Truncate Description text such that the total number of lines does not\nexceed this number.", + "defaultValue": { + "value": "2", + "computed": false + } + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach." + }, + "descriptionMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a description font can reach." + }, + "id": { + "required": false, + "tsType": { + "name": "union", + "raw": "string | number", + "elements": [ + { + "name": "string" + }, + { + "name": "number" + } + ] + }, + "description": "Id is used for distinguishing specific accordion when using List.AccordionGroup. Property is required when using List.AccordionGroup and has no impact on behavior when using standalone List.Accordion." + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes" + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the TouchableRipple. This is read by the screen reader when the user taps the touchable." + }, + "pointerEvents": { + "required": false, + "tsType": { + "name": "ViewProps['pointerEvents']", + "raw": "ViewProps['pointerEvents']" + }, + "description": "`pointerEvents` passed to the `View` container", + "defaultValue": { + "value": "'none'", + "computed": false + } + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Amount of space between the touchable area and the edge of the component.\nThis can be used to enlarge the touchable area beyond the visible component." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/List/ListAccordion.tsx" + ], + "group": "List" + }, + "List/ListAccordionGroup": { + "filepath": "List/ListAccordionGroup.tsx", + "title": "List.AccordionGroup", + "description": "List.AccordionGroup allows to control a group of List Accordions. `id` prop for List.Accordion is required in order for group to work.\nList.AccordionGroup can be a controlled or uncontrolled component. The example shows the uncontrolled version.\nAt most one Accordion can be expanded at a given time.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View, Text } from 'react-native';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n \n \n \n \n \n \n List.Accordion can be wrapped because implementation uses React.Context.\n \n \n \n \n \n \n);\n\nexport default MyComponent;\n```", + "link": "list-accordion-group", + "data": { + "description": "List.AccordionGroup allows to control a group of List Accordions. `id` prop for List.Accordion is required in order for group to work.\nList.AccordionGroup can be a controlled or uncontrolled component. The example shows the uncontrolled version.\nAt most one Accordion can be expanded at a given time.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View, Text } from 'react-native';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n \n \n \n \n \n \n \n \n List.Accordion can be wrapped because implementation uses React.Context.\n \n \n \n \n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "List.AccordionGroup", + "methods": [], + "statics": [], + "props": { + "onAccordionPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(expandedId: string | number) => void", + "signature": { + "arguments": [ + { + "name": "expandedId", + "type": { + "name": "union", + "raw": "string | number", + "elements": [ + { + "name": "string" + }, + { + "name": "number" + } + ] + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on selection change." + }, + "expandedId": { + "required": false, + "tsType": { + "name": "union", + "raw": "string | number", + "elements": [ + { + "name": "string" + }, + { + "name": "number" + } + ] + }, + "description": "Id of the currently expanded list accordion" + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "React elements containing list accordions" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/List/ListAccordionGroup.tsx" + ], + "group": "List" + }, + "List/ListIcon": { + "filepath": "List/ListIcon.tsx", + "title": "List.Icon", + "description": "A component to show an icon in a list item.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n <>\n \n \n \n \n);\n\nexport default MyComponent;\n```", + "link": "list-icon", + "data": { + "description": "A component to show an icon in a list item.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n <>\n \n \n \n \n);\n\nexport default MyComponent;\n```", + "displayName": "List.Icon", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to show." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Color for the icon." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/List/ListIcon.tsx" + ], + "group": "List" + }, + "List/ListItem": { + "filepath": "List/ListItem.tsx", + "title": "List.Item", + "description": "A component to show tiles inside a List.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => (\n }\n />\n);\n\nexport default MyComponent;\n```\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "list-item", + "data": { + "description": "A component to show tiles inside a List.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => (\n }\n />\n);\n\nexport default MyComponent;\n```\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "List.Item", + "methods": [], + "statics": [], + "props": { + "title": { + "required": true, + "tsType": { + "name": "union", + "raw": "| React.ReactNode\n| ((props: {\n selectable: boolean;\n ellipsizeMode: EllipsizeProp | undefined;\n color: string;\n fontSize: number;\n }) => React.ReactNode)", + "elements": [ + { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + { + "name": "unknown" + } + ] + }, + "description": "Title text for the list item." + }, + "description": { + "required": false, + "tsType": { + "name": "union", + "raw": "| React.ReactNode\n| ((props: {\n selectable: boolean;\n ellipsizeMode: EllipsizeProp | undefined;\n color: string;\n fontSize: number;\n }) => React.ReactNode)", + "elements": [ + { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + { + "name": "unknown" + } + ] + }, + "description": "Description text for the list item or callback which returns a React element to display the description." + }, + "left": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { color: string; style: Style }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ color: string; style: Style }", + "signature": { + "properties": [ + { + "key": "color", + "value": { + "name": "string", + "required": true + } + }, + { + "key": "style", + "value": { + "name": "Style", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the left side." + }, + "right": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: { color: string; style?: Style }) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{ color: string; style?: Style }", + "signature": { + "properties": [ + { + "key": "color", + "value": { + "name": "string", + "required": true + } + }, + { + "key": "style", + "value": { + "name": "Style", + "required": false + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback which returns a React element to display on the right side." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the root TouchableRipple container." + }, + "containerStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the outermost container that wraps the entire content, including left and right items and both title and description." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the content container, which wraps the title and description." + }, + "titleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Title element." + }, + "descriptionStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Description element." + }, + "titleNumberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Truncate Title text such that the total number of lines does not\nexceed this number.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "descriptionNumberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Truncate Description text such that the total number of lines does not\nexceed this number.", + "defaultValue": { + "value": "2", + "computed": false + } + }, + "titleEllipsizeMode": { + "required": false, + "tsType": { + "name": "EllipsizeProp" + }, + "description": "Ellipsize Mode for the Title. One of `'head'`, `'middle'`, `'tail'`, `'clip'`.\n\nSee [`ellipsizeMode`](https://reactnative.dev/docs/text#ellipsizemode)" + }, + "descriptionEllipsizeMode": { + "required": false, + "tsType": { + "name": "EllipsizeProp" + }, + "description": "Ellipsize Mode for the Description. One of `'head'`, `'middle'`, `'tail'`, `'clip'`.\n\nSee [`ellipsizeMode`](https://reactnative.dev/docs/text#ellipsizemode)" + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach." + }, + "descriptionMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a description font can reach." + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/List/ListItem.tsx" + ], + "group": "List" + }, + "List/ListSection": { + "filepath": "List/ListSection.tsx", + "title": "List.Section", + "description": "A component used to group list items.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n Some title\n } />\n }\n />\n \n);\n\nexport default MyComponent;\n```", + "link": "list-section", + "data": { + "description": "A component used to group list items.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n Some title\n } />\n }\n />\n \n);\n\nexport default MyComponent;\n```", + "displayName": "List.Section", + "methods": [], + "statics": [], + "props": { + "title": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Title text for the section." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the section." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "titleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Title element." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/List/ListSection.tsx" + ], + "group": "List" + }, + "List/ListSubheader": { + "filepath": "List/ListSubheader.tsx", + "title": "List.Subheader", + "description": "A component used to display a header in lists.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => My List Title;\n\nexport default MyComponent;\n```", + "link": "list-subheader", + "data": { + "description": "A component used to display a header in lists.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { List } from 'react-native-paper';\n\nconst MyComponent = () => My List Title;\n\nexport default MyComponent;\n```", + "displayName": "List.Subheader", + "methods": [], + "statics": [], + "props": { + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Text element." + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/List/ListSubheader.tsx" + ], + "group": "List" + }, + "Menu/Menu": { + "filepath": "Menu/Menu.tsx", + "title": "Menu", + "description": "Menus display a list of choices on temporary elevated surfaces. Their placement varies based on the element that opens them.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Button, Menu, Divider, PaperProvider } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const openMenu = () => setVisible(true);\n\n const closeMenu = () => setVisible(false);\n\n return (\n \n \n Show menu}>\n {}} title=\"Item 1\" />\n {}} title=\"Item 2\" />\n \n {}} title=\"Item 3\" />\n \n \n \n );\n};\n\nexport default MyComponent;\n```\n\n### Note\nWhen using `Menu` within a React Native's `Modal` component, you need to wrap all\n`Modal` contents within a `PaperProvider` in order for the menu to show. This\nwrapping is not necessary if you use Paper's `Modal` instead.", + "link": "menu", + "data": { + "description": "Menus display a list of choices on temporary elevated surfaces. Their placement varies based on the element that opens them.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Button, Menu, Divider, PaperProvider } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const openMenu = () => setVisible(true);\n\n const closeMenu = () => setVisible(false);\n\n return (\n \n \n Show menu}>\n {}} title=\"Item 1\" />\n {}} title=\"Item 2\" />\n \n {}} title=\"Item 3\" />\n \n \n \n );\n};\n\nexport default MyComponent;\n```\n\n### Note\nWhen using `Menu` within a React Native's `Modal` component, you need to wrap all\n`Modal` contents within a `PaperProvider` in order for the menu to show. This\nwrapping is not necessary if you use Paper's `Modal` instead.", + "displayName": "Menu", + "methods": [], + "statics": [], + "props": { + "visible": { + "required": true, + "tsType": { + "name": "boolean" + }, + "description": "Whether the Menu is currently visible." + }, + "anchor": { + "required": true, + "tsType": { + "name": "union", + "raw": "React.ReactNode | { x: number; y: number }", + "elements": [ + { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + { + "name": "signature", + "type": "object", + "raw": "{ x: number; y: number }", + "signature": { + "properties": [ + { + "key": "x", + "value": { + "name": "number", + "required": true + } + }, + { + "key": "y", + "value": { + "name": "number", + "required": true + } + } + ] + } + } + ] + }, + "description": "The anchor to open the menu from. In most cases, it will be a button that opens the menu." + }, + "anchorPosition": { + "required": false, + "tsType": { + "name": "union", + "raw": "'top' | 'bottom'", + "elements": [ + { + "name": "literal", + "value": "'top'" + }, + { + "name": "literal", + "value": "'bottom'" + } + ] + }, + "description": "Whether the menu should open at the top of the anchor or at its bottom.\nApplied only when anchor is a node, not an x/y position." + }, + "statusBarHeight": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Extra margin to add at the top of the menu to account for translucent status bar on Android.\nIf you are using Expo, we assume translucent status bar and set a height for status bar automatically.\nPass `0` or a custom value to and customize it.\nThis is automatically handled on iOS." + }, + "onDismiss": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Callback called when Menu is dismissed. The `visible` prop needs to be updated when this is called." + }, + "overlayAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the overlay. This is read by the screen reader when the user taps outside the menu.", + "defaultValue": { + "value": "'Close menu'", + "computed": false + } + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Menu`." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "Style of menu's inner content." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "elevation": { + "required": false, + "tsType": { + "name": "MD3Elevation" + }, + "description": "Elevation level of the menu's content. Shadow styles are calculated based on this value. Default `backgroundColor` is taken from the corresponding `theme.colors.elevation` property. By default equals `2`.\n@supported Available in v5.x with theme version 3", + "defaultValue": { + "value": "2", + "computed": false + } + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'flat' | 'elevated'", + "elements": [ + { + "name": "literal", + "value": "'flat'" + }, + { + "name": "literal", + "value": "'elevated'" + } + ] + }, + "description": "Mode of the menu's content.\n- `elevated` - Surface with a shadow and background color corresponding to set `elevation` value.\n- `flat` - Surface without a shadow, with the background color corresponding to set `elevation` value.\n\n@supported Available in v5.x with theme version 3", + "defaultValue": { + "value": "'elevated'", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "keyboardShouldPersistTaps": { + "required": false, + "tsType": { + "name": "ScrollViewProps['keyboardShouldPersistTaps']", + "raw": "ScrollViewProps['keyboardShouldPersistTaps']" + }, + "description": "Inner ScrollView prop" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests.", + "defaultValue": { + "value": "'menu'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Menu/Menu.tsx" + ] + }, + "Menu/MenuItem": { + "filepath": "Menu/MenuItem.tsx", + "title": "Menu.Item", + "description": "A component to show a single list item inside a Menu.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Menu } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} title=\"Redo\" />\n {}} title=\"Undo\" />\n {}} title=\"Cut\" disabled />\n {}} title=\"Copy\" disabled />\n {}} title=\"Paste\" />\n \n);\n\nexport default MyComponent;\n```", + "link": "menu-item", + "data": { + "description": "A component to show a single list item inside a Menu.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Menu } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} title=\"Redo\" />\n {}} title=\"Undo\" />\n {}} title=\"Cut\" disabled />\n {}} title=\"Copy\" disabled />\n {}} title=\"Paste\" />\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Menu.Item", + "methods": [], + "statics": [], + "props": { + "title": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Title text for the `MenuItem`." + }, + "leadingIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "@renamed Renamed from 'icon' to 'leadingIcon' in v5.x\n\nLeading icon to display for the `MenuItem`." + }, + "trailingIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "@supported Available in v5.x with theme version 3\n\nTrailing icon to display for the `MenuItem`." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the 'item' is disabled. A disabled 'item' is greyed out and `onPress` is not called on touch." + }, + "dense": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\n\nSets min height with densed layout." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach.", + "defaultValue": { + "value": "1.5", + "computed": false + } + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the root TouchableRipple container.\n" + }, + "containerStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the outermost container that wraps the entire content, including leading and trailing icons and title text." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the content container, which wraps the title text." + }, + "titleStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the Title element." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'menu-item'", + "computed": false + } + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the Touchable. This is read by the screen reader when the user taps the component." + }, + "accessibilityState": { + "required": false, + "tsType": { + "name": "AccessibilityState" + }, + "description": "Accessibility state for the Touchable. This is read by the screen reader when the user taps the component." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Menu/MenuItem.tsx" + ], + "group": "Menu" + }, + "Modal": { + "filepath": "Modal.tsx", + "title": "Modal", + "description": "The Modal component is a simple way to present content above an enclosing view.\nTo render the `Modal` above other components, you'll need to wrap it with the [`Portal`](./Portal) component.\nNote that this modal is NOT accessible by default; if you need an accessible modal, please use the React Native Modal.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Modal, Portal, Text, Button, PaperProvider } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const showModal = () => setVisible(true);\n const hideModal = () => setVisible(false);\n const containerStyle = { backgroundColor: 'white', padding: 20 };\n\n return (\n \n \n \n Example Modal. Click outside this area to dismiss.\n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "modal", + "data": { + "description": "The Modal component is a simple way to present content above an enclosing view.\nTo render the `Modal` above other components, you'll need to wrap it with the [`Portal`](./Portal) component.\nNote that this modal is NOT accessible by default; if you need an accessible modal, please use the React Native Modal.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Modal, Portal, Text, Button, PaperProvider } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const showModal = () => setVisible(true);\n const hideModal = () => setVisible(false);\n const containerStyle = { backgroundColor: 'white', padding: 20 };\n\n return (\n \n \n \n Example Modal. Click outside this area to dismiss.\n \n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "Modal", + "methods": [], + "statics": [], + "props": { + "dismissable": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Determines whether clicking outside the modal dismisses it.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "dismissableBackButton": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Determines whether clicking Android hardware back button dismisses the dialog.", + "defaultValue": { + "value": "dismissable", + "computed": true + } + }, + "onDismiss": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Callback that is called when the user dismisses the modal.", + "defaultValue": { + "value": "() => {}", + "computed": false + } + }, + "overlayAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the overlay. This is read by the screen reader when the user taps outside the modal.", + "defaultValue": { + "value": "'Close modal'", + "computed": false + } + }, + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Determines Whether the modal is visible.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Modal`." + }, + "contentContainerStyle": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "Style for the content of the modal" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the wrapper of the modal.\nUse this prop to change the default wrapper style or to override safe area insets with marginTop and marginBottom." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests.", + "defaultValue": { + "value": "'modal'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Modal.tsx" + ] + }, + "Portal/Portal": { + "filepath": "Portal/Portal.tsx", + "title": "Portal", + "description": "Portal allows rendering a component at a different place in the parent tree.\nYou can use it to render content which should appear above other elements, similar to `Modal`.\nIt requires a [`Portal.Host`](PortalHost) component to be rendered somewhere in the parent tree.\nNote that if you're using the `Provider` component, this already includes a `Portal.Host`.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n This is rendered at a different place\n \n);\n\nexport default MyComponent;\n```", + "link": "portal", + "data": { + "description": "Portal allows rendering a component at a different place in the parent tree.\nYou can use it to render content which should appear above other elements, similar to `Modal`.\nIt requires a [`Portal.Host`](PortalHost) component to be rendered somewhere in the parent tree.\nNote that if you're using the `Provider` component, this already includes a `Portal.Host`.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Portal, Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n This is rendered at a different place\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Portal", + "methods": [], + "statics": [ + { + "name": "Host", + "docblock": null, + "type": { + "name": "static", + "raw": "static" + }, + "link": "portal-host.html" + } + ], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Portal`." + }, + "theme": { + "required": true, + "tsType": { + "name": "InternalTheme" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Portal/Portal.tsx" + ] + }, + "Portal/PortalHost": { + "filepath": "Portal/PortalHost.tsx", + "title": "Portal.Host", + "description": "Portal host renders all of its children `Portal` elements.\nFor example, you can wrap a screen in `Portal.Host` to render items above the screen.\nIf you're using the `Provider` component, it already includes `Portal.Host`.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Text } from 'react-native';\nimport { Portal } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n Content of the app\n \n);\n\nexport default MyComponent;\n```\n\nHere any `Portal` elements under `` are rendered alongside `` and will appear above `` like a `Modal`.", + "link": "portal-host", + "data": { + "description": "Portal host renders all of its children `Portal` elements.\nFor example, you can wrap a screen in `Portal.Host` to render items above the screen.\nIf you're using the `Provider` component, it already includes `Portal.Host`.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Text } from 'react-native';\nimport { Portal } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n Content of the app\n \n);\n\nexport default MyComponent;\n```\n\nHere any `Portal` elements under `` are rendered alongside `` and will appear above `` like a `Modal`.", + "displayName": "Portal.Host", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Portal/PortalHost.tsx" + ], + "group": "Portal" + }, + "ProgressBar": { + "filepath": "ProgressBar.tsx", + "title": "ProgressBar", + "description": "Progress bar is an indicator used to present progress of some activity in the app.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ProgressBar, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "link": "progress-bar", + "data": { + "description": "Progress bar is an indicator used to present progress of some activity in the app.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ProgressBar, MD3Colors } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n);\n\nexport default MyComponent;\n```", + "displayName": "ProgressBar", + "methods": [], + "statics": [], + "props": { + "animatedValue": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Animated value (between 0 and 1). This tells the progress bar to rely on this value to animate it.\nNote: It should not be used in parallel with the `progress` prop." + }, + "progress": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Progress value (between 0 and 1).\nNote: It should not be used in parallel with the `animatedValue` prop.", + "defaultValue": { + "value": "0", + "computed": false + } + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Color of the progress bar. The background color will be calculated based on this but you can change it by passing `backgroundColor` to `style` prop." + }, + "indeterminate": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "If the progress bar will show indeterminate progress." + }, + "visible": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to show the ProgressBar (true, the default) or hide it (false).", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "fillStyle": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "Style of filled part of the ProgresBar." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests.", + "defaultValue": { + "value": "'progress-bar'", + "computed": false + } + } + } + }, + "type": "component", + "dependencies": [ + "src/components/ProgressBar.tsx" + ] + }, + "RadioButton/RadioButton": { + "filepath": "RadioButton/RadioButton.tsx", + "title": "RadioButton", + "description": "Radio buttons allow the selection a single option from a set.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { RadioButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [checked, setChecked] = React.useState('first');\n\n return (\n \n setChecked('first')}\n />\n setChecked('second')}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "link": "radio-button", + "data": { + "description": "Radio buttons allow the selection a single option from a set.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { RadioButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [checked, setChecked] = React.useState('first');\n\n return (\n \n setChecked('first')}\n />\n setChecked('second')}\n />\n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "RadioButton", + "methods": [], + "statics": [], + "props": { + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Value of the radio button" + }, + "status": { + "required": false, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + } + ] + }, + "description": "Status of radio button." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether radio is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "uncheckedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for unchecked radio." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for radio." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/RadioButton/RadioButton.tsx" + ] + }, + "RadioButton/RadioButtonAndroid": { + "filepath": "RadioButton/RadioButtonAndroid.tsx", + "title": "RadioButton.Android", + "description": "Radio buttons allow the selection a single option from a set.\nThis component follows platform guidelines for Android, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "radio-button-android", + "data": { + "description": "Radio buttons allow the selection a single option from a set.\nThis component follows platform guidelines for Android, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "RadioButton.Android", + "methods": [], + "statics": [], + "props": { + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Value of the radio button" + }, + "status": { + "required": false, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + } + ] + }, + "description": "Status of radio button." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether radio is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(param?: any) => void", + "signature": { + "arguments": [ + { + "name": "param", + "type": { + "name": "any" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "uncheckedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for unchecked radio." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for radio." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/RadioButton/RadioButtonAndroid.tsx" + ], + "group": "RadioButton" + }, + "RadioButton/RadioButtonGroup": { + "filepath": "RadioButton/RadioButtonGroup.tsx", + "title": "RadioButton.Group", + "description": "Radio button group allows to control a group of radio buttons.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { RadioButton, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('first');\n\n return (\n setValue(newValue)} value={value}>\n \n First\n \n \n \n Second\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "radio-button-group", + "data": { + "description": "Radio button group allows to control a group of radio buttons.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { RadioButton, Text } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('first');\n\n return (\n setValue(newValue)} value={value}>\n \n First\n \n \n \n Second\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "RadioButton.Group", + "methods": [], + "statics": [], + "props": { + "onValueChange": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(value: string) => void", + "signature": { + "arguments": [ + { + "name": "value", + "type": { + "name": "string" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on selection change." + }, + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Value of the currently selected radio button." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "React elements containing radio buttons." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/RadioButton/RadioButtonGroup.tsx" + ], + "group": "RadioButton" + }, + "RadioButton/RadioButtonIOS": { + "filepath": "RadioButton/RadioButtonIOS.tsx", + "title": "RadioButton.IOS", + "description": "Radio buttons allow the selection a single option from a set.\nThis component follows platform guidelines for iOS, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "link": "radio-button-ios", + "data": { + "description": "Radio buttons allow the selection a single option from a set.\nThis component follows platform guidelines for iOS, but can be used\non any platform.\n\n@extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple", + "displayName": "RadioButton.IOS", + "methods": [], + "statics": [], + "props": { + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Value of the radio button" + }, + "status": { + "required": false, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + } + ] + }, + "description": "Status of radio button." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether radio is disabled." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for radio." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/RadioButton/RadioButtonIOS.tsx" + ], + "group": "RadioButton" + }, + "RadioButton/RadioButtonItem": { + "filepath": "RadioButton/RadioButtonItem.tsx", + "title": "RadioButton.Item", + "description": "RadioButton.Item allows you to press the whole row (item) instead of only the RadioButton.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { RadioButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('first');\n\n return (\n setValue(value)} value={value}>\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "radio-button-item", + "data": { + "description": "RadioButton.Item allows you to press the whole row (item) instead of only the RadioButton.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { RadioButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('first');\n\n return (\n setValue(value)} value={value}>\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "RadioButton.Item", + "methods": [], + "statics": [], + "props": { + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Value of the radio button." + }, + "label": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Label to be displayed on the item." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether radio is disabled." + }, + "background": { + "required": false, + "tsType": { + "name": "PressableAndroidRippleConfig" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the touchable. This is read by the screen reader when the user taps the touchable.", + "defaultValue": { + "value": "label", + "computed": true + } + }, + "uncheckedColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for unchecked radio." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for radio." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "status": { + "required": false, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + } + ] + }, + "description": "Status of radio button." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Additional styles for container View." + }, + "labelStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to Label element." + }, + "labelVariant": { + "required": false, + "tsType": { + "name": "unknown" + }, + "description": "@supported Available in v5.x with theme version 3\n\nLabel text variant defines appropriate text styles for type role and its size.\nAvailable variants:\n\n Display: `displayLarge`, `displayMedium`, `displaySmall`\n\n Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`\n\n Title: `titleLarge`, `titleMedium`, `titleSmall`\n\n Label: `labelLarge`, `labelMedium`, `labelSmall`\n\n Body: `bodyLarge`, `bodyMedium`, `bodySmall`", + "defaultValue": { + "value": "'bodyLarge'", + "computed": false + } + }, + "labelMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a label font can reach." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'android' | 'ios'", + "elements": [ + { + "name": "literal", + "value": "'android'" + }, + { + "name": "literal", + "value": "'ios'" + } + ] + }, + "description": "Whether `` or `` should be used.\nLeft undefined `` will be used." + }, + "position": { + "required": false, + "tsType": { + "name": "union", + "raw": "'leading' | 'trailing'", + "elements": [ + { + "name": "literal", + "value": "'leading'" + }, + { + "name": "literal", + "value": "'trailing'" + } + ] + }, + "description": "Radio button control position.", + "defaultValue": { + "value": "'trailing'", + "computed": false + } + }, + "hitSlop": { + "required": false, + "tsType": { + "name": "TouchableRippleProps['hitSlop']", + "raw": "TouchableRippleProps['hitSlop']" + }, + "description": "Sets additional distance outside of element in which a press can be detected." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/RadioButton/RadioButtonItem.tsx" + ], + "group": "RadioButton" + }, + "Searchbar": { + "filepath": "Searchbar.tsx", + "title": "Searchbar", + "description": "Searchbar is a simple input box where users can type search queries.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Searchbar } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [searchQuery, setSearchQuery] = React.useState('');\n\n return (\n \n );\n};\n\nexport default MyComponent;\n\n```", + "link": "searchbar", + "data": { + "description": "Searchbar is a simple input box where users can type search queries.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Searchbar } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [searchQuery, setSearchQuery] = React.useState('');\n\n return (\n \n );\n};\n\nexport default MyComponent;\n\n```", + "displayName": "Searchbar", + "methods": [], + "statics": [], + "props": { + "placeholder": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Hint text shown when the input is empty." + }, + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "The value of the text input." + }, + "onChangeText": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(query: string) => void", + "signature": { + "arguments": [ + { + "name": "query", + "type": { + "name": "string" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback that is called when the text input's text changes." + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'bar' | 'view'", + "elements": [ + { + "name": "literal", + "value": "'bar'" + }, + { + "name": "literal", + "value": "'view'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nSearch layout mode, the default value is \"bar\".", + "defaultValue": { + "value": "'bar'", + "computed": false + } + }, + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Icon name for the left icon button (see `onIconPress`)." + }, + "iconColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for icon, default will be derived from theme" + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "onIconPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback to execute if we want the left icon to act as button." + }, + "onClearIconPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback to execute if we want to add custom behaviour to close icon button." + }, + "searchAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button.", + "defaultValue": { + "value": "'search'", + "computed": false + } + }, + "clearIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "Custom icon for clear button, default will be icon close. It's visible when `loading` is set to `false`.\nIn v5.x with theme version 3, `clearIcon` is visible only if `right` prop is not defined." + }, + "clearAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the button. This is read by the screen reader when the user taps the button.", + "defaultValue": { + "value": "'clear'", + "computed": false + } + }, + "traileringIcon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "@supported Available in v5.x with theme version 3\nIcon name for the right trailering icon button.\nWorks only when `mode` is set to \"bar\". It won't be displayed if `loading` is set to `true`." + }, + "traileringIconColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "@supported Available in v5.x with theme version 3\nCustom color for the right trailering icon, default will be derived from theme" + }, + "traileringRippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "@supported Available in v5.x with theme version 3\nColor of the trailering icon ripple effect." + }, + "onTraileringIconPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "@supported Available in v5.x with theme version 3\nCallback to execute on the right trailering icon button press." + }, + "traileringIconAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the right trailering icon button. This is read by the screen reader when the user taps the button." + }, + "right": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: {\n color: string;\n style: Style;\n testID: string;\n}) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "signature", + "type": "object", + "raw": "{\n color: string;\n style: Style;\n testID: string;\n}", + "signature": { + "properties": [ + { + "key": "color", + "value": { + "name": "string", + "required": true + } + }, + { + "key": "style", + "value": { + "name": "Style", + "required": true + } + }, + { + "key": "testID", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "@supported Available in v5.x with theme version 3\nCallback which returns a React element to display on the right side.\nWorks only when `mode` is set to \"bar\"." + }, + "showDivider": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@supported Available in v5.x with theme version 3\nWhether to show `Divider` at the bottom of the search.\nWorks only when `mode` is set to \"view\". True by default.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "elevation": { + "required": false, + "tsType": { + "name": "union", + "raw": "0 | 1 | 2 | 3 | 4 | 5 | Animated.Value", + "elements": [ + { + "name": "literal", + "value": "0" + }, + { + "name": "literal", + "value": "1" + }, + { + "name": "literal", + "value": "2" + }, + { + "name": "literal", + "value": "3" + }, + { + "name": "literal", + "value": "4" + }, + { + "name": "literal", + "value": "5" + }, + { + "name": "Animated.Value" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nChanges Searchbar shadow and background on iOS and Android.", + "defaultValue": { + "value": "0", + "computed": false + } + }, + "inputStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Set style of the TextInput component inside the searchbar" + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "loading": { + "required": false, + "tsType": { + "name": "Boolean" + }, + "description": "Custom flag for replacing clear button with activity indicator.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'search-bar'", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Searchbar.tsx" + ] + }, + "SegmentedButtons/SegmentedButtons": { + "filepath": "SegmentedButtons/SegmentedButtons.tsx", + "title": "SegmentedButtons", + "description": "Segmented buttons can be used to select options, switch views or sort elements.
\n\n## Usage\n```js\nimport * as React from 'react';\nimport { SafeAreaView, StyleSheet } from 'react-native';\nimport { SegmentedButtons } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('');\n\n return (\n \n \n \n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n },\n});\n\nexport default MyComponent;\n```", + "link": "segmented-buttons", + "data": { + "description": "Segmented buttons can be used to select options, switch views or sort elements.
\n\n## Usage\n```js\nimport * as React from 'react';\nimport { SafeAreaView, StyleSheet } from 'react-native';\nimport { SegmentedButtons } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('');\n\n return (\n \n \n \n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n },\n});\n\nexport default MyComponent;\n```", + "displayName": "SegmentedButtons", + "methods": [], + "statics": [], + "props": { + "buttons": { + "required": true, + "tsType": { + "name": "Array", + "elements": [ + { + "name": "signature", + "type": "object", + "raw": "{\n value: T;\n icon?: IconSource;\n disabled?: boolean;\n accessibilityLabel?: string;\n checkedColor?: string;\n uncheckedColor?: string;\n onPress?: (event: GestureResponderEvent) => void;\n label?: string;\n showSelectedCheck?: boolean;\n style?: StyleProp;\n labelStyle?: StyleProp;\n testID?: string;\n}", + "signature": { + "properties": [ + { + "key": "value", + "value": { + "name": "T", + "required": true + } + }, + { + "key": "icon", + "value": { + "name": "IconSource", + "required": false + } + }, + { + "key": "disabled", + "value": { + "name": "boolean", + "required": false + } + }, + { + "key": "accessibilityLabel", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "checkedColor", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "uncheckedColor", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "onPress", + "value": { + "name": "signature", + "type": "function", + "raw": "(event: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "event", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + }, + "required": false + } + }, + { + "key": "label", + "value": { + "name": "string", + "required": false + } + }, + { + "key": "showSelectedCheck", + "value": { + "name": "boolean", + "required": false + } + }, + { + "key": "style", + "value": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp", + "required": false + } + }, + { + "key": "labelStyle", + "value": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp", + "required": false + } + }, + { + "key": "testID", + "value": { + "name": "string", + "required": false + } + } + ] + } + } + ], + "raw": "{\n value: T;\n icon?: IconSource;\n disabled?: boolean;\n accessibilityLabel?: string;\n checkedColor?: string;\n uncheckedColor?: string;\n onPress?: (event: GestureResponderEvent) => void;\n label?: string;\n showSelectedCheck?: boolean;\n style?: StyleProp;\n labelStyle?: StyleProp;\n testID?: string;\n}[]" + }, + "description": "Buttons to display as options in toggle button.\nButton should contain the following properties:\n- `value`: value of button (required)\n- `icon`: icon to display for the item\n- `disabled`: whether the button is disabled\n- `accessibilityLabel`: acccessibility label for the button. This is read by the screen reader when the user taps the button.\n- `checkedColor`: custom color for checked Text and Icon\n- `uncheckedColor`: custom color for unchecked Text and Icon\n- `onPress`: callback that is called when button is pressed\n- `label`: label text of the button\n- `showSelectedCheck`: show optional check icon to indicate selected state\n- `style`: pass additional styles for the button\n- `testID`: testID to be used on tests" + }, + "density": { + "required": false, + "tsType": { + "name": "union", + "raw": "'regular' | 'small' | 'medium' | 'high'", + "elements": [ + { + "name": "literal", + "value": "'regular'" + }, + { + "name": "literal", + "value": "'small'" + }, + { + "name": "literal", + "value": "'medium'" + }, + { + "name": "literal", + "value": "'high'" + } + ] + }, + "description": "Density is applied to the height, to allow usage in denser UIs" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/SegmentedButtons/SegmentedButtons.tsx" + ] + }, + "Snackbar": { + "filepath": "Snackbar.tsx", + "title": "Snackbar", + "description": "Snackbars provide brief feedback about an operation through a message rendered at the bottom of the container in which it's wrapped.\n\nNote: To display it as a popup, regardless of the parent's position, wrap it with a `Portal` component – refer to the example in the \"More Examples` section.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { Button, Snackbar } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const onToggleSnackBar = () => setVisible(!visible);\n\n const onDismissSnackBar = () => setVisible(false);\n\n return (\n \n \n {\n // Do something\n },\n }}>\n Hey there! I'm a Snackbar.\n \n \n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'space-between',\n },\n});\n\nexport default MyComponent;\n```", + "link": "snackbar", + "data": { + "description": "Snackbars provide brief feedback about an operation through a message rendered at the bottom of the container in which it's wrapped.\n\nNote: To display it as a popup, regardless of the parent's position, wrap it with a `Portal` component – refer to the example in the \"More Examples` section.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { Button, Snackbar } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [visible, setVisible] = React.useState(false);\n\n const onToggleSnackBar = () => setVisible(!visible);\n\n const onDismissSnackBar = () => setVisible(false);\n\n return (\n \n \n {\n // Do something\n },\n }}>\n Hey there! I'm a Snackbar.\n \n \n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'space-between',\n },\n});\n\nexport default MyComponent;\n```", + "displayName": "Snackbar", + "methods": [], + "statics": [], + "props": { + "visible": { + "required": true, + "tsType": { + "name": "boolean" + }, + "description": "Whether the Snackbar is currently visible." + }, + "action": { + "required": false, + "tsType": { + "name": "intersection", + "raw": "$RemoveChildren & {\n label: string;\n}", + "elements": [ + { + "name": "$RemoveChildren", + "elements": [ + { + "name": "Button" + } + ], + "raw": "$RemoveChildren" + }, + { + "name": "signature", + "type": "object", + "raw": "{\n label: string;\n}", + "signature": { + "properties": [ + { + "key": "label", + "value": { + "name": "string", + "required": true + } + } + ] + } + } + ] + }, + "description": "Label and press callback for the action button. It should contain the following properties:\n- `label` - Label of the action button\n- `onPress` - Callback that is called when action button is pressed." + }, + "icon": { + "required": false, + "tsType": { + "name": "IconSource" + }, + "description": "@supported Available in v5.x with theme version 3\nIcon to display when `onIconPress` is defined. Default will be `close` icon." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "@supported Available in v5.x with theme version 3\nColor of the ripple effect." + }, + "onIconPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "@supported Available in v5.x with theme version 3\nFunction to execute on icon button press. The icon button appears only when this prop is specified." + }, + "iconAccessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "@supported Available in v5.x with theme version 3\nAccessibility label for the icon button. This is read by the screen reader when the user taps the button.", + "defaultValue": { + "value": "'Close icon'", + "computed": false + } + }, + "duration": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The duration for which the Snackbar is shown.", + "defaultValue": { + "value": "7000", + "computed": false + } + }, + "onDismiss": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "() => void", + "signature": { + "arguments": [], + "return": { + "name": "void" + } + } + }, + "description": "Callback called when Snackbar is dismissed. The `visible` prop needs to be updated when this is called." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Text content of the Snackbar." + }, + "elevation": { + "required": false, + "tsType": { + "name": "union", + "raw": "0 | 1 | 2 | 3 | 4 | 5 | Animated.Value", + "elements": [ + { + "name": "literal", + "value": "0" + }, + { + "name": "literal", + "value": "1" + }, + { + "name": "literal", + "value": "2" + }, + { + "name": "literal", + "value": "3" + }, + { + "name": "literal", + "value": "4" + }, + { + "name": "literal", + "value": "5" + }, + { + "name": "Animated.Value" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nChanges Snackbar shadow and background on iOS and Android.", + "defaultValue": { + "value": "2", + "computed": false + } + }, + "maxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a text font can reach." + }, + "wrapperStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the wrapper of the snackbar" + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style for the content of the snackbar" + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Snackbar.tsx" + ] + }, + "Surface": { + "filepath": "Surface.tsx", + "title": "Surface", + "description": "Surface is a basic container that can give depth to an element with elevation shadow.\nOn dark theme with `adaptive` mode, surface is constructed by also placing a semi-transparent white overlay over a component surface.\nSee [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information.\nOverlay and shadow can be applied by specifying the `elevation` property both on Android and iOS.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Surface, Text } from 'react-native-paper';\nimport { StyleSheet } from 'react-native';\n\nconst MyComponent = () => (\n \n Surface\n \n);\n\nexport default MyComponent;\n\nconst styles = StyleSheet.create({\n surface: {\n padding: 8,\n height: 80,\n width: 80,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n```", + "link": "surface", + "data": { + "description": "Surface is a basic container that can give depth to an element with elevation shadow.\nOn dark theme with `adaptive` mode, surface is constructed by also placing a semi-transparent white overlay over a component surface.\nSee [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information.\nOverlay and shadow can be applied by specifying the `elevation` property both on Android and iOS.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Surface, Text } from 'react-native-paper';\nimport { StyleSheet } from 'react-native';\n\nconst MyComponent = () => (\n \n Surface\n \n);\n\nexport default MyComponent;\n\nconst styles = StyleSheet.create({\n surface: {\n padding: 8,\n height: 80,\n width: 80,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n```", + "displayName": "Surface", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "Content of the `Surface`." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "elevation": { + "required": false, + "tsType": { + "name": "union", + "raw": "0 | 1 | 2 | 3 | 4 | 5 | Animated.Value", + "elements": [ + { + "name": "literal", + "value": "0" + }, + { + "name": "literal", + "value": "1" + }, + { + "name": "literal", + "value": "2" + }, + { + "name": "literal", + "value": "3" + }, + { + "name": "literal", + "value": "4" + }, + { + "name": "literal", + "value": "5" + }, + { + "name": "Animated.Value" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nChanges shadows and background on iOS and Android.\nUsed to create UI hierarchy between components.\n\nNote: If `mode` is set to `flat`, Surface doesn't have a shadow.\n\nNote: In version 2 the `elevation` prop was accepted via `style` prop i.e. `style={{ elevation: 4 }}`.\nIt's no longer supported with theme version 3 and you should use `elevation` property instead.", + "defaultValue": { + "value": "1", + "computed": false + } + }, + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'flat' | 'elevated'", + "elements": [ + { + "name": "literal", + "value": "'flat'" + }, + { + "name": "literal", + "value": "'elevated'" + } + ] + }, + "description": "@supported Available in v5.x with theme version 3\nMode of the Surface.\n- `elevated` - Surface with a shadow and background color corresponding to set `elevation` value.\n- `flat` - Surface without a shadow, with the background color corresponding to set `elevation` value.", + "defaultValue": { + "value": "'elevated'", + "computed": false + } + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "TestID used for testing purposes", + "defaultValue": { + "value": "'surface'", + "computed": false + } + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + }, + "container": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "@internal" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Surface.tsx" + ] + }, + "Switch/Switch": { + "filepath": "Switch/Switch.tsx", + "title": "Switch", + "description": "Switch is a visual toggle between two mutually exclusive states — on and off.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Switch } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [isSwitchOn, setIsSwitchOn] = React.useState(false);\n\n const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);\n\n return ;\n};\n\nexport default MyComponent;\n```", + "link": "switch", + "data": { + "description": "Switch is a visual toggle between two mutually exclusive states — on and off.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Switch } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [isSwitchOn, setIsSwitchOn] = React.useState(false);\n\n const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);\n\n return ;\n};\n\nexport default MyComponent;\n```", + "displayName": "Switch", + "methods": [], + "statics": [], + "props": { + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Disable toggling the switch." + }, + "value": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Value of the switch, true means 'on', false means 'off'." + }, + "color": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom color for switch." + }, + "onValueChange": { + "required": false, + "tsType": { + "name": "Function" + }, + "description": "Callback called with the new value when it changes." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Switch/Switch.tsx" + ] + }, + "TextInput/TextInput": { + "filepath": "TextInput/TextInput.tsx", + "title": "TextInput", + "description": "A component to allow users to input text.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState(\"\");\n\n return (\n setText(text)}\n />\n );\n};\n\nexport default MyComponent;\n```\n\n@extends TextInput props https://reactnative.dev/docs/textinput#props", + "link": "text-input", + "data": { + "description": "A component to allow users to input text.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState(\"\");\n\n return (\n setText(text)}\n />\n );\n};\n\nexport default MyComponent;\n```\n\n@extends TextInput props https://reactnative.dev/docs/textinput#props", + "displayName": "TextInput", + "methods": [], + "statics": [], + "props": { + "mode": { + "required": false, + "tsType": { + "name": "union", + "raw": "'flat' | 'outlined'", + "elements": [ + { + "name": "literal", + "value": "'flat'" + }, + { + "name": "literal", + "value": "'outlined'" + } + ] + }, + "description": "Mode of the TextInput.\n- `flat` - flat input with an underline.\n- `outlined` - input with an outline.\n\nIn `outlined` mode, the background color of the label is derived from `colors?.background` in theme or the `backgroundColor` style.\nThis component render TextInputOutlined or TextInputFlat based on that props", + "defaultValue": { + "value": "'flat'", + "computed": false + } + }, + "left": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "The adornment placed on the left side of the input. It can be either `TextInput.Icon` or `TextInput.Affix`." + }, + "right": { + "required": false, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "The adornment placed on the right side of the input. It can be either `TextInput.Icon` or `TextInput.Affix`." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "If true, user won't be able to interact with the component.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "label": { + "required": false, + "tsType": { + "name": "TextInputLabelProp" + }, + "description": "The text or component to use for the floating label." + }, + "placeholder": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Placeholder for the input." + }, + "error": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to style the TextInput with error style.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "onChangeText": { + "required": false, + "tsType": { + "name": "Function" + }, + "description": "Callback that is called when the text input's text changes. Changed text is passed as an argument to the callback handler." + }, + "selectionColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Selection color of the input. On iOS, it sets both the selection color and cursor color.\nOn Android, it sets only the selection color." + }, + "cursorColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "@platform Android only\nCursor (or \"caret\") color of the input on Android.\nThis property has no effect on iOS." + }, + "underlineColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Inactive underline color of the input." + }, + "activeUnderlineColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Active underline color of the input." + }, + "outlineColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Inactive outline color of the input." + }, + "activeOutlineColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Active outline color of the input." + }, + "textColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Color of the text in the input." + }, + "dense": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Sets min height with densed layout. For `TextInput` in `flat` mode\nheight is `64dp` or in dense layout - `52dp` with label or `40dp` without label.\nFor `TextInput` in `outlined` mode\nheight is `56dp` or in dense layout - `40dp` regardless of label.\nWhen you apply `height` prop in style the `dense` prop affects only `paddingVertical` inside `TextInput`", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "multiline": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the input can have multiple lines.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "numberOfLines": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "@platform Android only\nThe number of lines to show in the input (Android only)." + }, + "onFocus": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(args: any) => void", + "signature": { + "arguments": [ + { + "name": "args", + "type": { + "name": "any" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback that is called when the text input is focused." + }, + "onBlur": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(args: any) => void", + "signature": { + "arguments": [ + { + "name": "args", + "type": { + "name": "any" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Callback that is called when the text input is blurred." + }, + "render": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(props: RenderProps) => React.ReactNode", + "signature": { + "arguments": [ + { + "name": "props", + "type": { + "name": "RenderProps" + } + } + ], + "return": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + } + }, + "description": "Callback to render a custom input component such as `react-native-text-input-mask`\ninstead of the default `TextInput` component from `react-native`.\n\nExample:\n```js\n\n \n }\n/>\n```", + "defaultValue": { + "value": "(props: RenderProps) => ", + "computed": false + } + }, + "value": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Value of the text input." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Pass `fontSize` prop to modify the font size inside `TextInput`.\nPass `height` prop to set `TextInput` height. When `height` is passed,\n`dense` prop will affect only input's `paddingVertical`.\nPass `paddingHorizontal` to modify horizontal padding.\nThis can be used to get MD Guidelines v1 TextInput look." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + }, + "contentStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Pass custom style directly to the input itself.\nOverrides input style\nExample: `paddingLeft`, `backgroundColor`" + }, + "outlineStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Pass style to override the default style of outlined wrapper.\nOverrides style when mode is set to `outlined`\nExample: `borderRadius`, `borderColor`" + }, + "underlineStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Pass style to override the default style of underlined wrapper.\nOverrides style when mode is set to `flat`\nExample: `borderRadius`, `borderColor`" + }, + "editable": { + "defaultValue": { + "value": "true", + "computed": false + }, + "required": false, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/TextInput/TextInput.tsx" + ] + }, + "TextInput/Adornment/TextInputAffix": { + "filepath": "TextInput/Adornment/TextInputAffix.tsx", + "title": "TextInput.Affix", + "description": "A component to render a leading / trailing text in the TextInput\n\n## Usage\n```js\nimport * as React from 'react';\nimport { TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState('');\n\n return (\n }\n />\n );\n};\n\nexport default MyComponent;\n```", + "link": "text-input-affix", + "data": { + "description": "A component to render a leading / trailing text in the TextInput\n\n## Usage\n```js\nimport * as React from 'react';\nimport { TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState('');\n\n return (\n }\n />\n );\n};\n\nexport default MyComponent;\n```", + "displayName": "TextInput.Affix", + "methods": [], + "statics": [], + "props": { + "text": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Text to show." + }, + "onLayout": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(event: LayoutChangeEvent) => void", + "signature": { + "arguments": [ + { + "name": "event", + "type": { + "name": "LayoutChangeEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "" + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the affix. This is read by the screen reader when the user taps the affix.", + "defaultValue": { + "value": "text", + "computed": true + } + }, + "textStyle": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "Style that is passed to the Text element." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/TextInput/Adornment/TextInputAffix.tsx" + ], + "group": "TextInput" + }, + "TextInput/Adornment/TextInputIcon": { + "filepath": "TextInput/Adornment/TextInputIcon.tsx", + "title": "TextInput.Icon", + "description": "A component to render a leading / trailing icon in the TextInput\n\n## Usage\n```js\nimport * as React from 'react';\nimport { TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState('');\n\n return (\n }\n />\n );\n};\n\nexport default MyComponent;\n```", + "link": "text-input-icon", + "data": { + "description": "A component to render a leading / trailing icon in the TextInput\n\n## Usage\n```js\nimport * as React from 'react';\nimport { TextInput } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [text, setText] = React.useState('');\n\n return (\n }\n />\n );\n};\n\nexport default MyComponent;\n```", + "displayName": "TextInput.Icon", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "@renamed Renamed from 'name' to 'icon` in v5.x\nIcon to show." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "forceTextInputFocus": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the TextInput will focus after onPress.", + "defaultValue": { + "value": "true", + "computed": false + } + }, + "color": { + "required": false, + "tsType": { + "name": "union", + "raw": "((isTextInputFocused: boolean) => string | undefined) | string", + "elements": [ + { + "name": "unknown" + }, + { + "name": "string" + } + ] + }, + "description": "Color of the icon or a function receiving a boolean indicating whether the TextInput is focused and returning the color." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/TextInput/Adornment/TextInputIcon.tsx" + ], + "group": "TextInput" + }, + "ToggleButton/ToggleButton": { + "filepath": "ToggleButton/ToggleButton.tsx", + "title": "ToggleButton", + "description": "Toggle buttons can be used to group related options. To emphasize groups of related toggle buttons,\na group should share a common container.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ToggleButton } from 'react-native-paper';\n\nconst ToggleButtonExample = () => {\n const [status, setStatus] = React.useState('checked');\n\n const onButtonToggle = value => {\n setStatus(status === 'checked' ? 'unchecked' : 'checked');\n };\n\n return (\n \n );\n};\n\nexport default ToggleButtonExample;\n\n```", + "link": "toggle-button", + "data": { + "description": "Toggle buttons can be used to group related options. To emphasize groups of related toggle buttons,\na group should share a common container.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ToggleButton } from 'react-native-paper';\n\nconst ToggleButtonExample = () => {\n const [status, setStatus] = React.useState('checked');\n\n const onButtonToggle = value => {\n setStatus(status === 'checked' ? 'unchecked' : 'checked');\n };\n\n return (\n \n );\n};\n\nexport default ToggleButtonExample;\n\n```", + "displayName": "ToggleButton", + "methods": [], + "statics": [], + "props": { + "icon": { + "required": true, + "tsType": { + "name": "IconSource" + }, + "description": "Icon to display for the `ToggleButton`." + }, + "size": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Size of the icon." + }, + "iconColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Custom text color for button." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether the button is disabled." + }, + "accessibilityLabel": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Accessibility label for the `ToggleButton`. This is read by the screen reader when the user taps the button." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(value?: GestureResponderEvent | string) => void", + "signature": { + "arguments": [ + { + "name": "value", + "type": { + "name": "union", + "raw": "GestureResponderEvent | string", + "elements": [ + { + "name": "GestureResponderEvent" + }, + { + "name": "string" + } + ] + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press." + }, + "value": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Value of button." + }, + "status": { + "required": false, + "tsType": { + "name": "union", + "raw": "'checked' | 'unchecked'", + "elements": [ + { + "name": "literal", + "value": "'checked'" + }, + { + "name": "literal", + "value": "'unchecked'" + } + ] + }, + "description": "Status of button." + }, + "style": { + "required": false, + "tsType": { + "name": "Animated.WithAnimatedValue", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + } + ], + "raw": "Animated.WithAnimatedValue>" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "ref": { + "required": false, + "tsType": { + "name": "ReactRefObject", + "raw": "React.RefObject", + "elements": [ + { + "name": "View" + } + ] + }, + "description": "" + }, + "testID": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "testID to be used on tests." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/ToggleButton/ToggleButton.tsx" + ] + }, + "ToggleButton/ToggleButtonGroup": { + "filepath": "ToggleButton/ToggleButtonGroup.tsx", + "title": "ToggleButton.Group", + "description": "Toggle group allows to control a group of toggle buttons.
\nIt doesn't change the appearance of the toggle buttons. If you want to group them in a row, check out [ToggleButton.Row](ToggleButtonRow).\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ToggleButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('left');\n\n return (\n setValue(value)}\n value={value}\n >\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "link": "toggle-button-group", + "data": { + "description": "Toggle group allows to control a group of toggle buttons.
\nIt doesn't change the appearance of the toggle buttons. If you want to group them in a row, check out [ToggleButton.Row](ToggleButtonRow).\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ToggleButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('left');\n\n return (\n setValue(value)}\n value={value}\n >\n \n \n \n );\n};\n\nexport default MyComponent;\n```", + "displayName": "ToggleButton.Group", + "methods": [], + "statics": [], + "props": { + "onValueChange": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(value: Value) => void", + "signature": { + "arguments": [ + { + "name": "value", + "type": { + "name": "Value" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on selection change." + }, + "value": { + "required": true, + "tsType": { + "name": "union", + "raw": "Value | null", + "elements": [ + { + "name": "Value" + }, + { + "name": "null" + } + ] + }, + "description": "Value of the currently selected toggle button." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "React elements containing toggle buttons." + } + } + }, + "type": "component", + "dependencies": [ + "src/components/ToggleButton/ToggleButtonGroup.tsx" + ], + "group": "ToggleButton" + }, + "ToggleButton/ToggleButtonRow": { + "filepath": "ToggleButton/ToggleButtonRow.tsx", + "title": "ToggleButton.Row", + "description": "Toggle button row renders a group of toggle buttons in a row.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ToggleButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('left');\n\n return (\n setValue(value)} value={value}>\n \n \n \n );\n};\n\nexport default MyComponent;\n\n```", + "link": "toggle-button-row", + "data": { + "description": "Toggle button row renders a group of toggle buttons in a row.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { ToggleButton } from 'react-native-paper';\n\nconst MyComponent = () => {\n const [value, setValue] = React.useState('left');\n\n return (\n setValue(value)} value={value}>\n \n \n \n );\n};\n\nexport default MyComponent;\n\n```", + "displayName": "ToggleButton.Row", + "methods": [], + "statics": [], + "props": { + "onValueChange": { + "required": true, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(value: string) => void", + "signature": { + "arguments": [ + { + "name": "value", + "type": { + "name": "string" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on selection change." + }, + "value": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Value of the currently selected toggle button." + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "React elements containing toggle buttons." + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/ToggleButton/ToggleButtonRow.tsx" + ], + "group": "ToggleButton" + }, + "Tooltip/Tooltip": { + "filepath": "Tooltip/Tooltip.tsx", + "title": "Tooltip", + "description": "Tooltips display informative text when users hover over, focus on, or tap an element.\n\nPlain tooltips, when activated, display a text label identifying an element, such as a description of its function. Tooltips should include only short, descriptive text and avoid restating visible UI text.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { IconButton, Tooltip } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} />\n \n);\n\nexport default MyComponent;\n```", + "link": "tooltip", + "data": { + "description": "Tooltips display informative text when users hover over, focus on, or tap an element.\n\nPlain tooltips, when activated, display a text label identifying an element, such as a description of its function. Tooltips should include only short, descriptive text and avoid restating visible UI text.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { IconButton, Tooltip } from 'react-native-paper';\n\nconst MyComponent = () => (\n \n {}} />\n \n);\n\nexport default MyComponent;\n```", + "displayName": "Tooltip", + "methods": [], + "statics": [], + "props": { + "children": { + "required": true, + "tsType": { + "name": "ReactReactElement", + "raw": "React.ReactElement" + }, + "description": "Tooltip reference element. Needs to be able to hold a ref." + }, + "enterTouchDelay": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds a user must touch the element before showing the tooltip.", + "defaultValue": { + "value": "500", + "computed": false + } + }, + "leaveTouchDelay": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "The number of milliseconds after the user stops touching an element before hiding the tooltip.", + "defaultValue": { + "value": "1500", + "computed": false + } + }, + "title": { + "required": true, + "tsType": { + "name": "string" + }, + "description": "Tooltip title" + }, + "titleMaxFontSizeMultiplier": { + "required": false, + "tsType": { + "name": "number" + }, + "description": "Specifies the largest possible scale a title font can reach." + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Tooltip/Tooltip.tsx" + ] + }, + "TouchableRipple/TouchableRipple": { + "filepath": "TouchableRipple/TouchableRipple.tsx", + "title": "TouchableRipple", + "description": "A wrapper for views that should respond to touches.\nProvides a material \"ink ripple\" interaction effect for supported platforms (>= Android Lollipop).\nOn unsupported platforms, it falls back to a highlight effect.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Text, TouchableRipple } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}\n rippleColor=\"rgba(0, 0, 0, .32)\"\n >\n Press anywhere\n \n);\n\nexport default MyComponent;\n```\n\n@extends Pressable props https://reactnative.dev/docs/Pressable#props", + "link": "touchable-ripple", + "data": { + "description": "A wrapper for views that should respond to touches.\nProvides a material \"ink ripple\" interaction effect for supported platforms (>= Android Lollipop).\nOn unsupported platforms, it falls back to a highlight effect.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Text, TouchableRipple } from 'react-native-paper';\n\nconst MyComponent = () => (\n console.log('Pressed')}\n rippleColor=\"rgba(0, 0, 0, .32)\"\n >\n Press anywhere\n \n);\n\nexport default MyComponent;\n```\n\n@extends Pressable props https://reactnative.dev/docs/Pressable#props", + "displayName": "TouchableRipple", + "methods": [], + "statics": [], + "props": { + "borderless": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to render the ripple outside the view bounds.", + "defaultValue": { + "value": "false", + "computed": false + } + }, + "background": { + "required": false, + "tsType": { + "name": "Object" + }, + "description": "Type of background drawabale to display the feedback (Android).\nhttps://reactnative.dev/docs/pressable#rippleconfig" + }, + "centered": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to start the ripple at the center (Web)." + }, + "disabled": { + "required": false, + "tsType": { + "name": "boolean" + }, + "description": "Whether to prevent interaction with the touchable." + }, + "onPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on press. If not set, will cause the touchable to be disabled." + }, + "onLongPress": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute on long press." + }, + "onPressIn": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute immediately when a touch is engaged, before `onPressOut` and `onPress`." + }, + "onPressOut": { + "required": false, + "tsType": { + "name": "signature", + "type": "function", + "raw": "(e: GestureResponderEvent) => void", + "signature": { + "arguments": [ + { + "name": "e", + "type": { + "name": "GestureResponderEvent" + } + } + ], + "return": { + "name": "void" + } + } + }, + "description": "Function to execute when a touch is released." + }, + "rippleColor": { + "required": false, + "tsType": { + "name": "ColorValue" + }, + "description": "Color of the ripple effect (Android >= 5.0 and Web)." + }, + "underlayColor": { + "required": false, + "tsType": { + "name": "string" + }, + "description": "Color of the underlay for the highlight effect (Android < 5.0 and iOS)." + }, + "children": { + "required": true, + "tsType": { + "name": "union", + "raw": "| ((state: PressableStateCallbackType) => React.ReactNode)\n| React.ReactNode", + "elements": [ + { + "name": "unknown" + }, + { + "name": "ReactReactNode", + "raw": "React.ReactNode" + } + ] + }, + "description": "Content of the `TouchableRipple`." + }, + "style": { + "required": false, + "tsType": { + "name": "union", + "raw": "| StyleProp\n| ((state: PressableStateCallbackType) => StyleProp)\n| undefined", + "elements": [ + { + "name": "StyleProp", + "elements": [ + { + "name": "ViewStyle" + } + ], + "raw": "StyleProp" + }, + { + "name": "unknown" + }, + { + "name": "undefined" + } + ] + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/TouchableRipple/TouchableRipple.tsx" + ] + }, + "Typography/Text": { + "filepath": "Typography/Text.tsx", + "title": "Text", + "description": "Typography component showing styles complied with passed `variant` prop and supported by the type system.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n <>\n Display Large\n Display Medium\n Display small\n\n Headline Large\n Headline Medium\n Headline Small\n\n Title Large\n Title Medium\n Title Small\n\n Body Large\n Body Medium\n Body Small\n\n Label Large\n Label Medium\n Label Small\n \n);\n\nexport default MyComponent;\n```\n\n@extends Text props https://reactnative.dev/docs/text#props", + "link": "text", + "data": { + "description": "Typography component showing styles complied with passed `variant` prop and supported by the type system.\n\n## Usage\n```js\nimport * as React from 'react';\nimport { Text } from 'react-native-paper';\n\nconst MyComponent = () => (\n <>\n Display Large\n Display Medium\n Display small\n\n Headline Large\n Headline Medium\n Headline Small\n\n Title Large\n Title Medium\n Title Small\n\n Body Large\n Body Medium\n Body Small\n\n Label Large\n Label Medium\n Label Small\n \n);\n\nexport default MyComponent;\n```\n\n@extends Text props https://reactnative.dev/docs/text#props", + "displayName": "Text", + "methods": [], + "statics": [], + "props": { + "variant": { + "required": false, + "tsType": { + "name": "VariantProp", + "elements": [ + { + "name": "T" + } + ], + "raw": "VariantProp" + }, + "description": "@supported Available in v5.x with theme version 3\n\nVariant defines appropriate text styles for type role and its size.\nAvailable variants:\n\n Display: `displayLarge`, `displayMedium`, `displaySmall`\n\n Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`\n\n Title: `titleLarge`, `titleMedium`, `titleSmall`\n\n Label: `labelLarge`, `labelMedium`, `labelSmall`\n\n Body: `bodyLarge`, `bodyMedium`, `bodySmall`" + }, + "children": { + "required": true, + "tsType": { + "name": "ReactReactNode", + "raw": "React.ReactNode" + }, + "description": "" + }, + "theme": { + "required": false, + "tsType": { + "name": "ThemeProp" + }, + "description": "" + }, + "style": { + "required": false, + "tsType": { + "name": "StyleProp", + "elements": [ + { + "name": "TextStyle" + } + ], + "raw": "StyleProp" + }, + "description": "" + } + } + }, + "type": "component", + "dependencies": [ + "src/components/Typography/Text.tsx" + ] + } + } +} diff --git a/docs/versioned_docs/version-5.x/components/ActivityIndicator.mdx b/docs/versioned_docs/version-5.x/components/ActivityIndicator.mdx new file mode 100644 index 0000000000..8dcc3efb3c --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/ActivityIndicator.mdx @@ -0,0 +1,96 @@ +--- +title: ActivityIndicator +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Activity indicator is used to present progress of some activity in the app. +It can be used as a drop-in replacement for the ActivityIndicator shipped with React Native. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ActivityIndicator, MD2Colors } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### animating + +
+ + + +
+ +### color + +
+ + + +
+ +### size + +
+ + + +
+ +### hidesWhenStopped + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Appbar/Appbar.mdx b/docs/versioned_docs/version-5.x/components/Appbar/Appbar.mdx new file mode 100644 index 0000000000..fdc1adc079 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Appbar/Appbar.mdx @@ -0,0 +1,174 @@ +--- +title: Appbar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display action items in a bar. It can be placed at the top or bottom. +The top bar usually contains the screen title, controls such as navigation buttons, menu button etc. +The bottom bar usually provides access to a drawer and up to four actions. + +By default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead. +See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more informations + + + + + + + +## Usage +### Top bar +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} /> + + {}} /> + {}} /> + +); + +export default MyComponent; +``` + +### Bottom bar +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { Appbar, FAB, useTheme } from 'react-native-paper'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; + +const BOTTOM_APPBAR_HEIGHT = 80; +const MEDIUM_FAB_HEIGHT = 56; + +const MyComponent = () => { + const { bottom } = useSafeAreaInsets(); + const theme = useTheme(); + + return ( + + {}} /> + {}} /> + {}} /> + {}} /> + {}} + style={[ + styles.fab, + { top: (BOTTOM_APPBAR_HEIGHT - MEDIUM_FAB_HEIGHT) / 2 }, + ]} + /> + + ); +}; + +const styles = StyleSheet.create({ + bottom: { + backgroundColor: 'aquamarine', + position: 'absolute', + left: 0, + right: 0, + bottom: 0, + }, + fab: { + position: 'absolute', + right: 16, + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dark + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### elevated Available in v5.x with theme version 3 + +
+ + + +
+ +### safeAreaInsets + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Appbar/AppbarAction.mdx b/docs/versioned_docs/version-5.x/components/Appbar/AppbarAction.mdx new file mode 100644 index 0000000000..4bece9c7d2 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Appbar/AppbarAction.mdx @@ -0,0 +1,142 @@ +--- +title: Appbar.Action +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display an action item in the appbar. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; +import { Platform } from 'react-native'; + +const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical'; + +const MyComponent = () => ( + + + {}} /> + {}} /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### color + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### disabled + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### isLeading Available in v5.x with theme version 3 + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Appbar/AppbarBackAction.mdx b/docs/versioned_docs/version-5.x/components/Appbar/AppbarBackAction.mdx new file mode 100644 index 0000000000..be22f972e8 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Appbar/AppbarBackAction.mdx @@ -0,0 +1,101 @@ +--- +title: Appbar.BackAction +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display a back button in the appbar. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### color + +
+ + + +
+ +### size + +
+ + + +
+ +### disabled + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Appbar/AppbarContent.mdx b/docs/versioned_docs/version-5.x/components/Appbar/AppbarContent.mdx new file mode 100644 index 0000000000..599f95020c --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Appbar/AppbarContent.mdx @@ -0,0 +1,145 @@ +--- +title: Appbar.Content +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display a title and optional subtitle in an appbar. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => ( + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### titleRef + +
+ + + +
+ +### subtitle Deprecated in v5.x + +
+ + + +
+ +### subtitleStyle Deprecated in v5.x + +
+ + + +
+ +### onPress + +
+ + + +
+ +### disabled + +
+ + + +
+ +### color + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Appbar/AppbarHeader.mdx b/docs/versioned_docs/version-5.x/components/Appbar/AppbarHeader.mdx new file mode 100644 index 0000000000..632bc299c8 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Appbar/AppbarHeader.mdx @@ -0,0 +1,125 @@ +--- +title: Appbar.Header +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to use as a header at the top of the screen. +It can contain the screen title, controls such as navigation buttons, menu button etc. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => { + const _goBack = () => console.log('Went back'); + + const _handleSearch = () => console.log('Searching'); + + const _handleMore = () => console.log('Shown more'); + + return ( + + + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dark + +
+ + + +
+ +### statusBarHeight + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### elevated Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Avatar/AvatarIcon.mdx b/docs/versioned_docs/version-5.x/components/Avatar/AvatarIcon.mdx new file mode 100644 index 0000000000..722ce6929b --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Avatar/AvatarIcon.mdx @@ -0,0 +1,81 @@ +--- +title: Avatar.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Avatars can be used to represent people in a graphical way. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar } from 'react-native-paper'; + +const MyComponent = () => ( + +); +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Avatar/AvatarImage.mdx b/docs/versioned_docs/version-5.x/components/Avatar/AvatarImage.mdx new file mode 100644 index 0000000000..a0e58a6c6d --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Avatar/AvatarImage.mdx @@ -0,0 +1,122 @@ +--- +title: Avatar.Image +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Avatars can be used to represent people in a graphical way. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar } from 'react-native-paper'; + +const MyComponent = () => ( + +); +export default MyComponent +``` + + + ## Props + + + + +
+ +### source (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### style + +
+ + + +
+ +### onError + +
+ + + +
+ +### onLayout + +
+ + + +
+ +### onLoad + +
+ + + +
+ +### onLoadEnd + +
+ + + +
+ +### onLoadStart + +
+ + + +
+ +### onProgress + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Avatar/AvatarText.mdx b/docs/versioned_docs/version-5.x/components/Avatar/AvatarText.mdx new file mode 100644 index 0000000000..372e41d230 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Avatar/AvatarText.mdx @@ -0,0 +1,97 @@ +--- +title: Avatar.Text +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Avatars can be used to represent people in a graphical way. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar } from 'react-native-paper'; + +const MyComponent = () => ( + +); +``` + + + ## Props + + + + +
+ +### label (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Badge.mdx b/docs/versioned_docs/version-5.x/components/Badge.mdx new file mode 100644 index 0000000000..564777604c --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Badge.mdx @@ -0,0 +1,96 @@ +--- +title: Badge +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Badges are small status descriptors for UI elements. +A badge consists of a small circle, typically containing a number or other short set of characters, that appears in proximity to another object. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Badge } from 'react-native-paper'; + +const MyComponent = () => ( + 3 +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### visible + +
+ + + +
+ +### children + +
+ + + +
+ +### size + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Banner.mdx b/docs/versioned_docs/version-5.x/components/Banner.mdx new file mode 100644 index 0000000000..08e79c42a3 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Banner.mdx @@ -0,0 +1,172 @@ +--- +title: Banner +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Banner displays a prominent message and related actions. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Image } from 'react-native'; +import { Banner } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(true); + + return ( + setVisible(false), + }, + { + label: 'Learn more', + onPress: () => setVisible(false), + }, + ]} + icon={({size}) => ( + + )}> + There was a problem processing a transaction on your credit card. + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### visible (required) + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### icon + +
+ + + +
+ +### actions + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + +
+ +### onShowAnimationFinished + +
+ + + +
+ +### onHideAnimationFinished + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/BottomNavigation/BottomNavigation.mdx b/docs/versioned_docs/version-5.x/components/BottomNavigation/BottomNavigation.mdx new file mode 100644 index 0000000000..600ae74fe5 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/BottomNavigation/BottomNavigation.mdx @@ -0,0 +1,316 @@ +--- +title: BottomNavigation +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +BottomNavigation provides quick navigation between top-level views of an app with a bottom navigation bar. +It is primarily designed for use on mobile. If you want to use the navigation bar only see [`BottomNavigation.Bar`](BottomNavigationBar). + +By default BottomNavigation uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead. +See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { BottomNavigation, Text } from 'react-native-paper'; + +const MusicRoute = () => Music; + +const AlbumsRoute = () => Albums; + +const RecentsRoute = () => Recents; + +const NotificationsRoute = () => Notifications; + +const MyComponent = () => { + const [index, setIndex] = React.useState(0); + const [routes] = React.useState([ + { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'}, + { key: 'albums', title: 'Albums', focusedIcon: 'album' }, + { key: 'recents', title: 'Recents', focusedIcon: 'history' }, + { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' }, + ]); + + const renderScene = BottomNavigation.SceneMap({ + music: MusicRoute, + albums: AlbumsRoute, + recents: RecentsRoute, + notifications: NotificationsRoute, + }); + + return ( + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### shifting + +
+ + + +
+ +### labeled + +
+ + + +
+ +### compact + +
+ + + +
+ +### navigationState (required) + +
+ + + +
+ +### onIndexChange (required) + +
+ + + +
+ +### renderScene (required) + +
+ + + +
+ +### renderIcon + +
+ + + +
+ +### renderLabel + +
+ + + +
+ +### renderTouchable + +
+ + + +
+ +### getAccessibilityLabel + +
+ + + +
+ +### getBadge + +
+ + + +
+ +### getColor + +
+ + + +
+ +### getLabelText + +
+ + + +
+ +### getLazy + +
+ + + +
+ +### getTestID + +
+ + + +
+ +### onTabPress + +
+ + + +
+ +### onTabLongPress + +
+ + + +
+ +### activeColor + +
+ + + +
+ +### inactiveColor + +
+ + + +
+ +### sceneAnimationEnabled + +
+ + + +
+ +### sceneAnimationType + +
+ + + +
+ +### sceneAnimationEasing + +
+ + + +
+ +### keyboardHidesNavigationBar + +
+ + + +
+ +### safeAreaInsets + +
+ + + +
+ +### barStyle + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### activeIndicatorStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/BottomNavigation/BottomNavigationBar.mdx b/docs/versioned_docs/version-5.x/components/BottomNavigation/BottomNavigationBar.mdx new file mode 100644 index 0000000000..8859b3cfec --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/BottomNavigation/BottomNavigationBar.mdx @@ -0,0 +1,293 @@ +--- +title: BottomNavigation.Bar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A navigation bar which can easily be integrated with [React Navigation's Bottom Tabs Navigator](https://reactnavigation.org/docs/bottom-tab-navigator/). + + + + + + + + + ## Usage +### without React Navigation +```js +import React from 'react'; +import { useState } from 'react'; +import { View } from 'react-native'; +import { BottomNavigation, Text, Provider } from 'react-native-paper'; +import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons'; + +function HomeScreen() { + return ( + + Home! + + ); +} + +function SettingsScreen() { + return ( + + Settings! + + ); +} + +export default function MyComponent() { + const [index, setIndex] = useState(0); + + const routes = [ + { key: 'home', title: 'Home', icon: 'home' }, + { key: 'settings', title: 'Settings', icon: 'cog' }, + ]; + + const renderScene = ({ route }) => { + switch (route.key) { + case 'home': + return ; + case 'settings': + return ; + default: + return null; + } + }; + + return ( + + {renderScene({ route: routes[index] })} + { + const newIndex = routes.findIndex((r) => r.key === route.key); + if (newIndex !== -1) { + setIndex(newIndex); + } + }} + renderIcon={({ route, color }) => ( + + )} + getLabelText={({ route }) => route.title} + /> + + ); +} +``` + + ### with React Navigation + \n Home!\n
\n );\n}\n\nfunction SettingsScreen() {\n return (\n \n Settings!\n \n );\n}\n\nconst MyTabs = createBottomTabNavigator({\n screenOptions: {\n animation: 'shift',\n },\n tabBar: ({ navigation, state, descriptors, insets }) => (\n {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (event.defaultPrevented) {\n preventDefault();\n } else {\n navigation.dispatch({\n ...CommonActions.navigate(route.name, route.params),\n target: state.key,\n });\n }\n }}\n renderIcon={({ route, focused, color }) =>\n descriptors[route.key].options.tabBarIcon?.({\n focused,\n color,\n size: 24,\n }) || null\n }\n getLabelText={({ route }) => {\n const { options } = descriptors[route.key];\n const label =\n typeof options.tabBarLabel === 'string'\n ? options.tabBarLabel\n : typeof options.title === 'string'\n ? options.title\n : route.name;\n\n return label;\n }}\n />\n ),\n screens: {\n Home: {\n screen: HomeScreen,\n options: {\n tabBarIcon: ({ color }) => (\n \n ),\n },\n },\n Settings: {\n screen: SettingsScreen,\n options: {\n tabBarIcon: ({ color }) => (\n \n ),\n },\n },\n },\n});\n\nconst Navigation = createStaticNavigation(MyTabs);\n\nexport default function App() {\n return (\n \n \n \n \n \n );\n}","dynamic":"import { Text, View } from 'react-native';\nimport { NavigationContainer, CommonActions } from '@react-navigation/native';\nimport { createBottomTabNavigator } from '@react-navigation/bottom-tabs';\nimport { Provider, BottomNavigation } from 'react-native-paper';\nimport MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n\nfunction HomeScreen() {\n return (\n \n Home!\n \n );\n}\n\nfunction SettingsScreen() {\n return (\n \n Settings!\n \n );\n}\n\nconst Tab = createBottomTabNavigator();\n\nexport default function App() {\n return (\n \n \n (\n {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (event.defaultPrevented) {\n preventDefault();\n } else {\n navigation.dispatch({\n ...CommonActions.navigate(route.name, route.params),\n target: state.key,\n });\n }\n }}\n renderIcon={({ route, focused, color }) =>\n descriptors[route.key].options.tabBarIcon?.({\n focused,\n color,\n size: 24,\n }) || null\n }\n getLabelText={({ route }) => {\n const { options } = descriptors[route.key];\n const label =\n typeof options.tabBarLabel === 'string'\n ? options.tabBarLabel\n : typeof options.title === 'string'\n ? options.title\n : route.name;\n\n return label;\n }}\n />\n )}>\n (\n \n ),\n }}\n />\n (\n \n ),\n }}\n />\n \n \n \n );\n}\n"}}} /> + + + + ## Props + + + + +
+ +### shifting + +
+ + + +
+ +### labeled + +
+ + + +
+ +### compact + +
+ + + +
+ +### navigationState (required) + +
+ + + +
+ +### renderIcon + +
+ + + +
+ +### renderLabel + +
+ + + +
+ +### renderTouchable + +
+ + + +
+ +### getAccessibilityLabel + +
+ + + +
+ +### getBadge + +
+ + + +
+ +### getColor + +
+ + + +
+ +### getLabelText + +
+ + + +
+ +### getTestID + +
+ + + +
+ +### onTabPress (required) + +
+ + + +
+ +### onTabLongPress + +
+ + + +
+ +### activeColor + +
+ + + +
+ +### inactiveColor + +
+ + + +
+ +### animationEasing + +
+ + + +
+ +### keyboardHidesNavigationBar + +
+ + + +
+ +### safeAreaInsets + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### activeIndicatorStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Button/Button.mdx b/docs/versioned_docs/version-5.x/components/Button/Button.mdx new file mode 100644 index 0000000000..8d9f7b8be0 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Button/Button.mdx @@ -0,0 +1,281 @@ +--- +title: Button +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A button is component that the user can press to trigger an action. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Button } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### mode + +
+ + + +
+ +### dark + +
+ + + +
+ +### compact + +
+ + + +
+ +### color Deprecated in v5.x - use `buttonColor` or `textColor` instead. + +
+ + + +
+ +### buttonColor + +
+ + + +
+ +### textColor + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### loading + +
+ + + +
+ +### icon + +
+ + + +
+ +### disabled + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### uppercase + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityHint + +
+ + + +
+ +### accessibilityRole + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### style + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### touchableRef + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Card/Card.mdx b/docs/versioned_docs/version-5.x/components/Card/Card.mdx new file mode 100644 index 0000000000..b71067b67f --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Card/Card.mdx @@ -0,0 +1,172 @@ +--- +title: Card +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A card is a sheet of material that serves as an entry point to more detailed information. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar, Button, Card, Text } from 'react-native-paper'; + +const LeftContent = props => + +const MyComponent = () => ( + + + + Card title + Card content + + + + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### mode + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### disabled + +
+ + + +
+ +### elevation + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### accessible + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Card/CardActions.mdx b/docs/versioned_docs/version-5.x/components/Card/CardActions.mdx new file mode 100644 index 0000000000..c4e45b3053 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Card/CardActions.mdx @@ -0,0 +1,72 @@ +--- +title: Card.Actions +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a list of actions inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Card, Button } from 'react-native-paper'; + +const MyComponent = () => ( + + + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Card/CardContent.mdx b/docs/versioned_docs/version-5.x/components/Card/CardContent.mdx new file mode 100644 index 0000000000..360f352698 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Card/CardContent.mdx @@ -0,0 +1,64 @@ +--- +title: Card.Content +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show content inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Card, Text } from 'react-native-paper'; + +const MyComponent = () => ( + + + Card title + Card content + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Card/CardCover.mdx b/docs/versioned_docs/version-5.x/components/Card/CardCover.mdx new file mode 100644 index 0000000000..01c0f5cd08 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Card/CardCover.mdx @@ -0,0 +1,63 @@ +--- +title: Card.Cover +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a cover image inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Card } from 'react-native-paper'; + +const MyComponent = () => ( + + + +); + +export default MyComponent; +``` + + + + + ## Props + ### Image props + + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Card/CardTitle.mdx b/docs/versioned_docs/version-5.x/components/Card/CardTitle.mdx new file mode 100644 index 0000000000..a345dfc22b --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Card/CardTitle.mdx @@ -0,0 +1,176 @@ +--- +title: Card.Title +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a title, subtitle and an avatar inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar, Card, IconButton } from 'react-native-paper'; + +const MyComponent = () => ( + } + right={(props) => {}} />} + /> +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### titleNumberOfLines + +
+ + + +
+ +### titleVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### subtitle + +
+ + + +
+ +### subtitleStyle + +
+ + + +
+ +### subtitleNumberOfLines + +
+ + + +
+ +### subtitleVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### left + +
+ + + +
+ +### leftStyle + +
+ + + +
+ +### right + +
+ + + +
+ +### rightStyle + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### subtitleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Checkbox/Checkbox.mdx b/docs/versioned_docs/version-5.x/components/Checkbox/Checkbox.mdx new file mode 100644 index 0000000000..717b374aae --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Checkbox/Checkbox.mdx @@ -0,0 +1,108 @@ +--- +title: Checkbox +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Checkboxes allow the selection of multiple options from a set. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Checkbox } from 'react-native-paper'; + +const MyComponent = () => { + const [checked, setChecked] = React.useState(false); + + return ( + { + setChecked(!checked); + }} + /> + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### status (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxAndroid.mdx b/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxAndroid.mdx new file mode 100644 index 0000000000..e6ae65e251 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxAndroid.mdx @@ -0,0 +1,91 @@ +--- +title: Checkbox.Android +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + + + + + + + +Checkboxes allow the selection of multiple options from a set. +This component follows platform guidelines for Android, but can be used +on any platform. + + + + + ## Props + ### TouchableRipple props + + + +
+ +### status (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxIOS.mdx b/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxIOS.mdx new file mode 100644 index 0000000000..f3096f3564 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxIOS.mdx @@ -0,0 +1,83 @@ +--- +title: Checkbox.IOS +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + + + + + + + +Checkboxes allow the selection of multiple options from a set. +This component follows platform guidelines for iOS, but can be used +on any platform. + + + + + ## Props + ### TouchableRipple props + + + +
+ +### status (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxItem.mdx b/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxItem.mdx new file mode 100644 index 0000000000..0ea69cde34 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Checkbox/CheckboxItem.mdx @@ -0,0 +1,196 @@ +--- +title: Checkbox.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Checkbox.Item allows you to press the whole row (item) instead of only the Checkbox. + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Checkbox } from 'react-native-paper'; + +const MyComponent = () => ( + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### status (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### label (required) + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### style + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### labelVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### position + +
+ + + +
+ +### mode + +
+ + + +
+ +### hitSlop + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Chip/Chip.mdx b/docs/versioned_docs/version-5.x/components/Chip/Chip.mdx new file mode 100644 index 0000000000..93d34e3b3f --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Chip/Chip.mdx @@ -0,0 +1,291 @@ +--- +title: Chip +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Chips are compact elements that can represent inputs, attributes, or actions. +They can have an icon or avatar on the left, and a close button icon on the right. +They are typically used to: +
    +
  • Present multiple options
  • +
  • Represent attributes active or chosen
  • +
  • Present filter options
  • +
  • Trigger actions related to primary content
  • +
+ + + + + + + +## Usage +```js +import * as React from 'react'; +import { Chip } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')}>Example Chip +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### mode + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### icon + +
+ + + +
+ +### avatar + +
+ + + +
+ +### closeIcon + +
+ + + +
+ +### selected + +
+ + + +
+ +### selectedColor + +
+ + + +
+ +### showSelectedOverlay Available in v5.x with theme version 3 + +
+ + + +
+ +### showSelectedCheck + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### disabled + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### closeIconAccessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### onClose + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### compact Available in v5.x with theme version 3 + +
+ + + +
+ +### elevated Available in v5.x with theme version 3 + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### ellipsizeMode + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### accessibilityRole + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/DataTable/DataTable.mdx b/docs/versioned_docs/version-5.x/components/DataTable/DataTable.mdx new file mode 100644 index 0000000000..5a6442ba4e --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/DataTable/DataTable.mdx @@ -0,0 +1,127 @@ +--- +title: DataTable +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Data tables allow displaying sets of data. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => { + const [page, setPage] = React.useState(0); + const [numberOfItemsPerPageList] = React.useState([2, 3, 4]); + const [itemsPerPage, onItemsPerPageChange] = React.useState( + numberOfItemsPerPageList[0] + ); + + const [items] = React.useState([ + { + key: 1, + name: 'Cupcake', + calories: 356, + fat: 16, + }, + { + key: 2, + name: 'Eclair', + calories: 262, + fat: 16, + }, + { + key: 3, + name: 'Frozen yogurt', + calories: 159, + fat: 6, + }, + { + key: 4, + name: 'Gingerbread', + calories: 305, + fat: 3.7, + }, + ]); + + const from = page * itemsPerPage; + const to = Math.min((page + 1) * itemsPerPage, items.length); + + React.useEffect(() => { + setPage(0); + }, [itemsPerPage]); + + return ( + + + Dessert + Calories + Fat + + + {items.slice(from, to).map((item) => ( + + {item.name} + {item.calories} + {item.fat} + + ))} + + setPage(page)} + label={`${from + 1}-${to} of ${items.length}`} + numberOfItemsPerPageList={numberOfItemsPerPageList} + numberOfItemsPerPage={itemsPerPage} + onItemsPerPageChange={onItemsPerPageChange} + showFastPaginationControls + selectPageDropdownLabel={'Rows per page'} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/DataTable/DataTableCell.mdx b/docs/versioned_docs/version-5.x/components/DataTable/DataTableCell.mdx new file mode 100644 index 0000000000..135b52485a --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/DataTable/DataTableCell.mdx @@ -0,0 +1,109 @@ +--- +title: DataTable.Cell +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a single cell inside of a table. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + 1 + 2 + 3 + 4 + +); + +export default MyComponent; +``` + +If you want to support multiline text, please use View instead, as multiline text doesn't comply with +MD Guidelines (https://github.com/callstack/react-native-paper/issues/2381). + + + + + ## Props + ### TouchableRipple props + + + +
+ +### children (required) + +
+ + + +
+ +### numeric + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/DataTable/DataTableHeader.mdx b/docs/versioned_docs/version-5.x/components/DataTable/DataTableHeader.mdx new file mode 100644 index 0000000000..e7739956e5 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/DataTable/DataTableHeader.mdx @@ -0,0 +1,77 @@ +--- +title: DataTable.Header +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display title in table header. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + + + Dessert + + Calories + Fat (g) + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/DataTable/DataTablePagination.mdx b/docs/versioned_docs/version-5.x/components/DataTable/DataTablePagination.mdx new file mode 100644 index 0000000000..15f4c611fc --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/DataTable/DataTablePagination.mdx @@ -0,0 +1,211 @@ +--- +title: DataTable.Pagination +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show pagination for data table. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const numberOfItemsPerPageList = [2, 3, 4]; + +const items = [ + { + key: 1, + name: 'Page 1', + }, + { + key: 2, + name: 'Page 2', + }, + { + key: 3, + name: 'Page 3', + }, +]; + +const MyComponent = () => { + const [page, setPage] = React.useState(0); + const [numberOfItemsPerPage, onItemsPerPageChange] = React.useState(numberOfItemsPerPageList[0]); + const from = page * numberOfItemsPerPage; + const to = Math.min((page + 1) * numberOfItemsPerPage, items.length); + + React.useEffect(() => { + setPage(0); + }, [numberOfItemsPerPage]); + + return ( + + setPage(page)} + label={`${from + 1}-${to} of ${items.length}`} + showFastPaginationControls + numberOfItemsPerPageList={numberOfItemsPerPageList} + numberOfItemsPerPage={numberOfItemsPerPage} + onItemsPerPageChange={onItemsPerPageChange} + selectPageDropdownLabel={'Rows per page'} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### page (required) + +
+ + + +
+ +### numberOfPages (required) + +
+ + + +
+ +### onPageChange (required) + +
+ + + +
+ +### showFastPaginationControls + +
+ + + +
+ +### paginationControlRippleColor + +
+ + + +
+ +### theme + +
+ + + +
+ +### numberOfItemsPerPage + +
+ + + +
+ +### numberOfItemsPerPageList + +
+ + + +
+ +### onItemsPerPageChange + +
+ + + +
+ +### dropdownItemRippleColor + +
+ + + +
+ +### selectPageDropdownRippleColor + +
+ + + +
+ +### selectPageDropdownLabel + +
+ + + +
+ +### selectPageDropdownAccessibilityLabel + +
+ + + +
+ +### label + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/DataTable/DataTableRow.mdx b/docs/versioned_docs/version-5.x/components/DataTable/DataTableRow.mdx new file mode 100644 index 0000000000..4a16b262d5 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/DataTable/DataTableRow.mdx @@ -0,0 +1,90 @@ +--- +title: DataTable.Row +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a single row inside of a table. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + 1 + 2 + 3 + 4 + +); + +export default MyComponent; +``` + + + + + ## Props + ### TouchableRipple props + + + +
+ +### children (required) + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### pointerEvents + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/DataTable/DataTableTitle.mdx b/docs/versioned_docs/version-5.x/components/DataTable/DataTableTitle.mdx new file mode 100644 index 0000000000..18eb652eae --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/DataTable/DataTableTitle.mdx @@ -0,0 +1,125 @@ +--- +title: DataTable.Title +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display title in table header. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + + + Dessert + + Calories + Fat (g) + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### numeric + +
+ + + +
+ +### sortDirection + +
+ + + +
+ +### numberOfLines + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Dialog/Dialog.mdx b/docs/versioned_docs/version-5.x/components/Dialog/Dialog.mdx new file mode 100644 index 0000000000..dd8160a473 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Dialog/Dialog.mdx @@ -0,0 +1,136 @@ +--- +title: Dialog +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks. +To render the `Dialog` above other components, you'll need to wrap it with the [`Portal`](../Portal) component. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Button, Dialog, Portal, PaperProvider, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const showDialog = () => setVisible(true); + + const hideDialog = () => setVisible(false); + + return ( + + + + + + Alert + + This is simple dialog + + + + + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dismissable + +
+ + + +
+ +### dismissableBackButton + +
+ + + +
+ +### onDismiss + +
+ + + +
+ +### visible + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Dialog/DialogActions.mdx b/docs/versioned_docs/version-5.x/components/Dialog/DialogActions.mdx new file mode 100644 index 0000000000..3102b99ed5 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Dialog/DialogActions.mdx @@ -0,0 +1,80 @@ +--- +title: Dialog.Actions +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a list of actions in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Button, Dialog, Portal } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Dialog/DialogContent.mdx b/docs/versioned_docs/version-5.x/components/Dialog/DialogContent.mdx new file mode 100644 index 0000000000..4944c2fb83 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Dialog/DialogContent.mdx @@ -0,0 +1,71 @@ +--- +title: Dialog.Content +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show content in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + This is simple dialog + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Dialog/DialogIcon.mdx b/docs/versioned_docs/version-5.x/components/Dialog/DialogIcon.mdx new file mode 100644 index 0000000000..a1133c8dfd --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Dialog/DialogIcon.mdx @@ -0,0 +1,101 @@ +--- +title: Dialog.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +@supported Available in v5.x with theme version 3 +A component to show an icon in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + This is a title + + This is simple dialog + + + + ); +}; + +const styles = StyleSheet.create({ + title: { + textAlign: 'center', + }, +}) + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### color + +
+ + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Dialog/DialogScrollArea.mdx b/docs/versioned_docs/version-5.x/components/Dialog/DialogScrollArea.mdx new file mode 100644 index 0000000000..197c0f21a8 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Dialog/DialogScrollArea.mdx @@ -0,0 +1,87 @@ +--- +title: Dialog.ScrollArea +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a scrollable content in a Dialog. The component only provides appropriate styling. +For the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ScrollView } from 'react-native'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + + This is a scrollable area + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Dialog/DialogTitle.mdx b/docs/versioned_docs/version-5.x/components/Dialog/DialogTitle.mdx new file mode 100644 index 0000000000..ce5816a1d2 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Dialog/DialogTitle.mdx @@ -0,0 +1,80 @@ +--- +title: Dialog.Title +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a title in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + This is a title + + This is simple dialog + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Divider.mdx b/docs/versioned_docs/version-5.x/components/Divider.mdx new file mode 100644 index 0000000000..ffe25229b4 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Divider.mdx @@ -0,0 +1,93 @@ +--- +title: Divider +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A divider is a thin, lightweight separator that groups content in lists and page layouts. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Divider, Text } from 'react-native-paper'; + +const MyComponent = () => ( + + Lemon + + Mango + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### leftInset Renamed from 'inset' to 'leftInset` in v5.x + +
+ + + +
+ +### horizontalInset Available in v5.x with theme version 3 + +
+ + + +
+ +### bold Available in v5.x with theme version 3 + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Drawer/DrawerCollapsedItem.mdx b/docs/versioned_docs/version-5.x/components/Drawer/DrawerCollapsedItem.mdx new file mode 100644 index 0000000000..50cb419c33 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Drawer/DrawerCollapsedItem.mdx @@ -0,0 +1,149 @@ +--- +title: Drawer.CollapsedItem +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Note: Available in v5.x with theme version 3 + +Collapsed component used to show an action item with an icon and optionally label in a navigation drawer. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Drawer } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### label + +
+ + + +
+ +### badge + +
+ + + +
+ +### disabled + +
+ + + +
+ +### focusedIcon Renamed from 'icon' to 'focusedIcon' in v5.x + +
+ + + +
+ +### unfocusedIcon Renamed from 'icon' to 'focusedIcon' in v5.x + +
+ + + +
+ +### active + +
+ + + +
+ +### onPress + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Drawer/DrawerItem.mdx b/docs/versioned_docs/version-5.x/components/Drawer/DrawerItem.mdx new file mode 100644 index 0000000000..4c21ff2b33 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Drawer/DrawerItem.mdx @@ -0,0 +1,155 @@ +--- +title: Drawer.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to show an action item with an icon and a label in a navigation drawer. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Drawer } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### label (required) + +
+ + + +
+ +### icon + +
+ + + +
+ +### active + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### right + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Drawer/DrawerSection.mdx b/docs/versioned_docs/version-5.x/components/Drawer/DrawerSection.mdx new file mode 100644 index 0000000000..351e8bb5c9 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Drawer/DrawerSection.mdx @@ -0,0 +1,110 @@ +--- +title: Drawer.Section +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to group content inside a navigation drawer. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Drawer } from 'react-native-paper'; + +const MyComponent = () => { + const [active, setActive] = React.useState(''); + + return ( + + setActive('first')} + /> + setActive('second')} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### showDivider + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/FAB/AnimatedFAB.mdx b/docs/versioned_docs/version-5.x/components/FAB/AnimatedFAB.mdx new file mode 100644 index 0000000000..9cd723ce16 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/FAB/AnimatedFAB.mdx @@ -0,0 +1,284 @@ +--- +title: AnimatedFAB +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +An animated, extending horizontally floating action button represents the primary action in an application. + + + + + + + +## Usage +```js +import React from 'react'; +import { + StyleProp, + ViewStyle, + Animated, + StyleSheet, + Platform, + ScrollView, + Text, + SafeAreaView, + I18nManager, +} from 'react-native'; +import { AnimatedFAB } from 'react-native-paper'; + +const MyComponent = ({ + animatedValue, + visible, + extended, + label, + animateFrom, + style, + iconMode, +}) => { + const [isExtended, setIsExtended] = React.useState(true); + + const isIOS = Platform.OS === 'ios'; + + const onScroll = ({ nativeEvent }) => { + const currentScrollPosition = + Math.floor(nativeEvent?.contentOffset?.y) ?? 0; + + setIsExtended(currentScrollPosition <= 0); + }; + + const fabStyle = { [animateFrom]: 16 }; + + return ( + + + {[...new Array(100).keys()].map((_, i) => ( + {i} + ))} + + console.log('Pressed')} + visible={visible} + animateFrom={'right'} + iconMode={'static'} + style={[styles.fabStyle, style, fabStyle]} + /> + + ); +}; + +export default MyComponent; + +const styles = StyleSheet.create({ + container: { + flexGrow: 1, + }, + fabStyle: { + bottom: 16, + right: 16, + position: 'absolute', + }, +}); +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### label (required) + +
+ + + +
+ +### uppercase + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityState + +
+ + + +
+ +### color + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### disabled + +
+ + + +
+ +### visible + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### iconMode + +
+ + + +
+ +### animateFrom + +
+ + + +
+ +### extended + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### variant Available in v5.x with theme version 3 + +
+ + + +
+ +### style + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/FAB/FAB.mdx b/docs/versioned_docs/version-5.x/components/FAB/FAB.mdx new file mode 100644 index 0000000000..87844b9b2b --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/FAB/FAB.mdx @@ -0,0 +1,261 @@ +--- +title: FAB +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A floating action button represents the primary action on a screen. It appears in front of all screen content. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { FAB } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')} + /> +); + +const styles = StyleSheet.create({ + fab: { + position: 'absolute', + margin: 16, + right: 0, + bottom: 0, + }, +}) + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### icon + +
+ + + +
+ +### label + +
+ + + +
+ +### uppercase + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityState + +
+ + + +
+ +### animated + +
+ + + +
+ +### small Deprecated in v.5x - use prop size="small". + +
+ + + +
+ +### color + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### disabled + +
+ + + +
+ +### visible + +
+ + + +
+ +### loading + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### size Available in v5.x with theme version 3 + +
+ + + +
+ +### customSize + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### variant Available in v5.x with theme version 3 + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### ref + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/FAB/FABGroup.mdx b/docs/versioned_docs/version-5.x/components/FAB/FABGroup.mdx new file mode 100644 index 0000000000..56cbdc2799 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/FAB/FABGroup.mdx @@ -0,0 +1,244 @@ +--- +title: FAB.Group +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display a stack of FABs with related actions in a speed dial. +To render the group above other components, you'll need to wrap it with the [`Portal`](../Portal) component. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { FAB, Portal, PaperProvider } from 'react-native-paper'; + +const MyComponent = () => { + const [state, setState] = React.useState({ open: false }); + + const onStateChange = ({ open }) => setState({ open }); + + const { open } = state; + + return ( + + + console.log('Pressed add') }, + { + icon: 'star', + label: 'Star', + onPress: () => console.log('Pressed star'), + }, + { + icon: 'email', + label: 'Email', + onPress: () => console.log('Pressed email'), + }, + { + icon: 'bell', + label: 'Remind', + onPress: () => console.log('Pressed notifications'), + }, + ]} + onStateChange={onStateChange} + onPress={() => { + if (open) { + // do something if the speed dial is open + } + }} + /> + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### actions (required) + +
+ + + +
+ +### icon (required) + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### color + +
+ + + +
+ +### backdropColor + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### toggleStackOnLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### enableLongPressWhenStackOpened + +
+ + + +
+ +### open (required) + +
+ + + +
+ +### onStateChange (required) + +
+ + + +
+ +### visible (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### fabStyle + +
+ + + +
+ +### variant Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### label + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/HelperText/HelperText.mdx b/docs/versioned_docs/version-5.x/components/HelperText/HelperText.mdx new file mode 100644 index 0000000000..e62893bec8 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/HelperText/HelperText.mdx @@ -0,0 +1,127 @@ +--- +title: HelperText +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Helper text is used in conjuction with input elements to provide additional hints for the user. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { HelperText, TextInput } from 'react-native-paper'; + +const MyComponent = () => { + const [text, setText] = React.useState(''); + + const onChangeText = text => setText(text); + + const hasErrors = () => { + return !text.includes('@'); + }; + + return ( + + + + Email address is invalid! + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### type + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### visible + +
+ + + +
+ +### padding + +
+ + + +
+ +### disabled + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Icon.mdx b/docs/versioned_docs/version-5.x/components/Icon.mdx new file mode 100644 index 0000000000..4e0b46b75a --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Icon.mdx @@ -0,0 +1,95 @@ +--- +title: Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +An icon component which renders icon from vector library. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Icon, MD3Colors } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### size (required) + +
+ + + +
+ +### allowFontScaling + +
+ + + +
+ +### source (required) + +
+ + + +
+ +### color + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/IconButton/IconButton.mdx b/docs/versioned_docs/version-5.x/components/IconButton/IconButton.mdx new file mode 100644 index 0000000000..440a96bc59 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/IconButton/IconButton.mdx @@ -0,0 +1,190 @@ +--- +title: IconButton +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +An icon button is a button which displays only an icon without a label. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { IconButton, MD3Colors } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')} + /> +); + +export default MyComponent; +``` + + + + + ## Props + ### TouchableRipple props + + + +
+ +### icon (required) + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### iconColor Renamed from 'color' to 'iconColor' in v5.x + +
+ + + +
+ +### containerColor + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### selected Available in v5.x with theme version 3 + +
+ + + +
+ +### size + +
+ + + +
+ +### disabled + +
+ + + +
+ +### animated + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + +
+ +### loading + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/List/ListAccordion.mdx b/docs/versioned_docs/version-5.x/components/List/ListAccordion.mdx new file mode 100644 index 0000000000..fe07c5fa13 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/List/ListAccordion.mdx @@ -0,0 +1,273 @@ +--- +title: List.Accordion +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display an expandable list item. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List } from 'react-native-paper'; + +const MyComponent = () => { + const [expanded, setExpanded] = React.useState(true); + + const handlePress = () => setExpanded(!expanded); + + return ( + + }> + + + + + } + expanded={expanded} + onPress={handlePress}> + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### description + +
+ + + +
+ +### left + +
+ + + +
+ +### right + +
+ + + +
+ +### expanded + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### theme + +
+ + + +
+ +### background + +
+ + + +
+ +### style + +
+ + + +
+ +### containerStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### descriptionStyle + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### titleNumberOfLines + +
+ + + +
+ +### descriptionNumberOfLines + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### descriptionMaxFontSizeMultiplier + +
+ + + +
+ +### id + +
+ + + +
+ +### testID + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### pointerEvents + +
+ + + +
+ +### hitSlop + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/List/ListAccordionGroup.mdx b/docs/versioned_docs/version-5.x/components/List/ListAccordionGroup.mdx new file mode 100644 index 0000000000..412999538f --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/List/ListAccordionGroup.mdx @@ -0,0 +1,85 @@ +--- +title: List.AccordionGroup +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +List.AccordionGroup allows to control a group of List Accordions. `id` prop for List.Accordion is required in order for group to work. +List.AccordionGroup can be a controlled or uncontrolled component. The example shows the uncontrolled version. +At most one Accordion can be expanded at a given time. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View, Text } from 'react-native'; +import { List } from 'react-native-paper'; + +const MyComponent = () => ( + + + + + + + + + + List.Accordion can be wrapped because implementation uses React.Context. + + + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### onAccordionPress + +
+ + + +
+ +### expandedId + +
+ + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/List/ListIcon.mdx b/docs/versioned_docs/version-5.x/components/List/ListIcon.mdx new file mode 100644 index 0000000000..a55b0b6ed4 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/List/ListIcon.mdx @@ -0,0 +1,79 @@ +--- +title: List.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show an icon in a list item. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List, MD3Colors } from 'react-native-paper'; + +const MyComponent = () => ( + <> + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/List/ListItem.mdx b/docs/versioned_docs/version-5.x/components/List/ListItem.mdx new file mode 100644 index 0000000000..05de6ad884 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/List/ListItem.mdx @@ -0,0 +1,193 @@ +--- +title: List.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show tiles inside a List. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List } from 'react-native-paper'; + +const MyComponent = () => ( + } + /> +); + +export default MyComponent; +``` + + + + + ## Props + ### TouchableRipple props + + + +
+ +### title (required) + +
+ + + +
+ +### description + +
+ + + +
+ +### left + +
+ + + +
+ +### right + +
+ + + +
+ +### onPress + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### containerStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### descriptionStyle + +
+ + + +
+ +### titleNumberOfLines + +
+ + + +
+ +### descriptionNumberOfLines + +
+ + + +
+ +### titleEllipsizeMode + +
+ + + +
+ +### descriptionEllipsizeMode + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### descriptionMaxFontSizeMultiplier + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/List/ListSection.mdx b/docs/versioned_docs/version-5.x/components/List/ListSection.mdx new file mode 100644 index 0000000000..da8154c360 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/List/ListSection.mdx @@ -0,0 +1,90 @@ +--- +title: List.Section +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to group list items. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List, MD3Colors } from 'react-native-paper'; + +const MyComponent = () => ( + + Some title + } /> + } + /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### theme + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/List/ListSubheader.mdx b/docs/versioned_docs/version-5.x/components/List/ListSubheader.mdx new file mode 100644 index 0000000000..a5f507ec34 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/List/ListSubheader.mdx @@ -0,0 +1,63 @@ +--- +title: List.Subheader +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display a header in lists. + + + + + +## Usage +```js +import * as React from 'react'; +import { List } from 'react-native-paper'; + +const MyComponent = () => My List Title; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Menu/Menu.mdx b/docs/versioned_docs/version-5.x/components/Menu/Menu.mdx new file mode 100644 index 0000000000..995ce12f46 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Menu/Menu.mdx @@ -0,0 +1,190 @@ +--- +title: Menu +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Menus display a list of choices on temporary elevated surfaces. Their placement varies based on the element that opens them. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Button, Menu, Divider, PaperProvider } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const openMenu = () => setVisible(true); + + const closeMenu = () => setVisible(false); + + return ( + + + Show menu}> + {}} title="Item 1" /> + {}} title="Item 2" /> + + {}} title="Item 3" /> + + + + ); +}; + +export default MyComponent; +``` + +### Note +When using `Menu` within a React Native's `Modal` component, you need to wrap all +`Modal` contents within a `PaperProvider` in order for the menu to show. This +wrapping is not necessary if you use Paper's `Modal` instead. + + + ## Props + + + + +
+ +### visible (required) + +
+ + + +
+ +### anchor (required) + +
+ + + +
+ +### anchorPosition + +
+ + + +
+ +### statusBarHeight + +
+ + + +
+ +### onDismiss + +
+ + + +
+ +### overlayAccessibilityLabel + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### elevation + +
+ + + +
+ +### mode + +
+ + + +
+ +### theme + +
+ + + +
+ +### keyboardShouldPersistTaps + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Menu/MenuItem.mdx b/docs/versioned_docs/version-5.x/components/Menu/MenuItem.mdx new file mode 100644 index 0000000000..4a2cfcec58 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Menu/MenuItem.mdx @@ -0,0 +1,198 @@ +--- +title: Menu.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a single list item inside a Menu. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Menu } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} title="Redo" /> + {}} title="Undo" /> + {}} title="Cut" disabled /> + {}} title="Copy" disabled /> + {}} title="Paste" /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### leadingIcon Renamed from 'icon' to 'leadingIcon' in v5.x + +
+ + + +
+ +### trailingIcon Available in v5.x with theme version 3 + +
+ + + +
+ +### disabled + +
+ + + +
+ +### dense Available in v5.x with theme version 3 + +
+ + + +
+ +### background + +
+ + + +
+ +### onPress + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### containerStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### theme + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### testID + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityState + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Modal.mdx b/docs/versioned_docs/version-5.x/components/Modal.mdx new file mode 100644 index 0000000000..31684b84c0 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Modal.mdx @@ -0,0 +1,146 @@ +--- +title: Modal +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +The Modal component is a simple way to present content above an enclosing view. +To render the `Modal` above other components, you'll need to wrap it with the [`Portal`](./Portal) component. +Note that this modal is NOT accessible by default; if you need an accessible modal, please use the React Native Modal. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Modal, Portal, Text, Button, PaperProvider } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const showModal = () => setVisible(true); + const hideModal = () => setVisible(false); + const containerStyle = { backgroundColor: 'white', padding: 20 }; + + return ( + + + + Example Modal. Click outside this area to dismiss. + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dismissable + +
+ + + +
+ +### dismissableBackButton + +
+ + + +
+ +### onDismiss + +
+ + + +
+ +### overlayAccessibilityLabel + +
+ + + +
+ +### visible + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### contentContainerStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Portal/Portal.mdx b/docs/versioned_docs/version-5.x/components/Portal/Portal.mdx new file mode 100644 index 0000000000..9d3d325820 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Portal/Portal.mdx @@ -0,0 +1,74 @@ +--- +title: Portal +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Portal allows rendering a component at a different place in the parent tree. +You can use it to render content which should appear above other elements, similar to `Modal`. +It requires a [`Portal.Host`](PortalHost) component to be rendered somewhere in the parent tree. +Note that if you're using the `Provider` component, this already includes a `Portal.Host`. + + + + + +## Usage +```js +import * as React from 'react'; +import { Portal, Text } from 'react-native-paper'; + +const MyComponent = () => ( + + This is rendered at a different place + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### theme (required) + +
+ + + + + + + ## More Examples +
+ Toggle to grab more examples + +
+ + + + + diff --git a/docs/versioned_docs/version-5.x/components/Portal/PortalHost.mdx b/docs/versioned_docs/version-5.x/components/Portal/PortalHost.mdx new file mode 100644 index 0000000000..f54c0b8609 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Portal/PortalHost.mdx @@ -0,0 +1,56 @@ +--- +title: Portal.Host +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Portal host renders all of its children `Portal` elements. +For example, you can wrap a screen in `Portal.Host` to render items above the screen. +If you're using the `Provider` component, it already includes `Portal.Host`. + + + + + +## Usage +```js +import * as React from 'react'; +import { Text } from 'react-native'; +import { Portal } from 'react-native-paper'; + +const MyComponent = () => ( + + Content of the app + +); + +export default MyComponent; +``` + +Here any `Portal` elements under `` are rendered alongside `` and will appear above `` like a `Modal`. + + + ## Props + + + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/ProgressBar.mdx b/docs/versioned_docs/version-5.x/components/ProgressBar.mdx new file mode 100644 index 0000000000..fb920c538e --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/ProgressBar.mdx @@ -0,0 +1,119 @@ +--- +title: ProgressBar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Progress bar is an indicator used to present progress of some activity in the app. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ProgressBar, MD3Colors } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### animatedValue + +
+ + + +
+ +### progress + +
+ + + +
+ +### color + +
+ + + +
+ +### indeterminate + +
+ + + +
+ +### visible + +
+ + + +
+ +### fillStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/RadioButton/RadioButton.mdx b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButton.mdx new file mode 100644 index 0000000000..fcd29216fa --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButton.mdx @@ -0,0 +1,123 @@ +--- +title: RadioButton +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Radio buttons allow the selection a single option from a set. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { RadioButton } from 'react-native-paper'; + +const MyComponent = () => { + const [checked, setChecked] = React.useState('first'); + + return ( + + setChecked('first')} + /> + setChecked('second')} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### value (required) + +
+ + + +
+ +### status + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonAndroid.mdx b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonAndroid.mdx new file mode 100644 index 0000000000..e7a2fa46d8 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonAndroid.mdx @@ -0,0 +1,99 @@ +--- +title: RadioButton.Android +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + + + + + + + +Radio buttons allow the selection a single option from a set. +This component follows platform guidelines for Android, but can be used +on any platform. + + + + + ## Props + ### TouchableRipple props + + + +
+ +### value (required) + +
+ + + +
+ +### status + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonGroup.mdx b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonGroup.mdx new file mode 100644 index 0000000000..1ee266bf77 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonGroup.mdx @@ -0,0 +1,81 @@ +--- +title: RadioButton.Group +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Radio button group allows to control a group of radio buttons. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { RadioButton, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('first'); + + return ( + setValue(newValue)} value={value}> + + First + + + + Second + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### onValueChange (required) + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonIOS.mdx b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonIOS.mdx new file mode 100644 index 0000000000..25b8985a91 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonIOS.mdx @@ -0,0 +1,91 @@ +--- +title: RadioButton.IOS +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + + + + + + + +Radio buttons allow the selection a single option from a set. +This component follows platform guidelines for iOS, but can be used +on any platform. + + + + + ## Props + ### TouchableRipple props + + + +
+ +### value (required) + +
+ + + +
+ +### status + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonItem.mdx b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonItem.mdx new file mode 100644 index 0000000000..5dbb46c6e3 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/RadioButton/RadioButtonItem.mdx @@ -0,0 +1,210 @@ +--- +title: RadioButton.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +RadioButton.Item allows you to press the whole row (item) instead of only the RadioButton. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { RadioButton } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('first'); + + return ( + setValue(value)} value={value}> + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### value (required) + +
+ + + +
+ +### label (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### background + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### status + +
+ + + +
+ +### style + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### labelVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### mode + +
+ + + +
+ +### position + +
+ + + +
+ +### hitSlop + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Searchbar.mdx b/docs/versioned_docs/version-5.x/components/Searchbar.mdx new file mode 100644 index 0000000000..38942b16ba --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Searchbar.mdx @@ -0,0 +1,256 @@ +--- +title: Searchbar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Searchbar is a simple input box where users can type search queries. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Searchbar } from 'react-native-paper'; + +const MyComponent = () => { + const [searchQuery, setSearchQuery] = React.useState(''); + + return ( + + ); +}; + +export default MyComponent; + +``` + + + ## Props + + + + +
+ +### placeholder + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### onChangeText + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### icon + +
+ + + +
+ +### iconColor + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### onIconPress + +
+ + + +
+ +### onClearIconPress + +
+ + + +
+ +### searchAccessibilityLabel + +
+ + + +
+ +### clearIcon + +
+ + + +
+ +### clearAccessibilityLabel + +
+ + + +
+ +### traileringIcon Available in v5.x with theme version 3 + +
+ + + +
+ +### traileringIconColor Available in v5.x with theme version 3 + +
+ + + +
+ +### traileringRippleColor Available in v5.x with theme version 3 + +
+ + + +
+ +### onTraileringIconPress Available in v5.x with theme version 3 + +
+ + + +
+ +### traileringIconAccessibilityLabel + +
+ + + +
+ +### right Available in v5.x with theme version 3 + +
+ + + +
+ +### showDivider Available in v5.x with theme version 3 + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### inputStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### loading + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/SegmentedButtons/SegmentedButtons.mdx b/docs/versioned_docs/version-5.x/components/SegmentedButtons/SegmentedButtons.mdx new file mode 100644 index 0000000000..0923129bc1 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/SegmentedButtons/SegmentedButtons.mdx @@ -0,0 +1,107 @@ +--- +title: SegmentedButtons +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Segmented buttons can be used to select options, switch views or sort elements. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { SafeAreaView, StyleSheet } from 'react-native'; +import { SegmentedButtons } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState(''); + + return ( + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### buttons (required) + +
+ + + +
+ +### density + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Snackbar.mdx b/docs/versioned_docs/version-5.x/components/Snackbar.mdx new file mode 100644 index 0000000000..779486da75 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Snackbar.mdx @@ -0,0 +1,226 @@ +--- +title: Snackbar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Snackbars provide brief feedback about an operation through a message rendered at the bottom of the container in which it's wrapped. + +Note: To display it as a popup, regardless of the parent's position, wrap it with a `Portal` component – refer to the example in the "More Examples` section. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View, StyleSheet } from 'react-native'; +import { Button, Snackbar } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const onToggleSnackBar = () => setVisible(!visible); + + const onDismissSnackBar = () => setVisible(false); + + return ( + + + { + // Do something + }, + }}> + Hey there! I'm a Snackbar. + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'space-between', + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### visible (required) + +
+ + + +
+ +### action + +
+ + + +
+ +### icon Available in v5.x with theme version 3 + +
+ + + +
+ +### rippleColor Available in v5.x with theme version 3 + +
+ + + +
+ +### onIconPress Available in v5.x with theme version 3 + +
+ + + +
+ +### iconAccessibilityLabel Available in v5.x with theme version 3 + +
+ + + +
+ +### duration + +
+ + + +
+ +### onDismiss (required) + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### wrapperStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + ## More Examples +
+ Toggle to grab more examples + +
+ + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Surface.mdx b/docs/versioned_docs/version-5.x/components/Surface.mdx new file mode 100644 index 0000000000..f350bf6480 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Surface.mdx @@ -0,0 +1,119 @@ +--- +title: Surface +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Surface is a basic container that can give depth to an element with elevation shadow. +On dark theme with `adaptive` mode, surface is constructed by also placing a semi-transparent white overlay over a component surface. +See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information. +Overlay and shadow can be applied by specifying the `elevation` property both on Android and iOS. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Surface, Text } from 'react-native-paper'; +import { StyleSheet } from 'react-native'; + +const MyComponent = () => ( + + Surface + +); + +export default MyComponent; + +const styles = StyleSheet.create({ + surface: { + padding: 8, + height: 80, + width: 80, + alignItems: 'center', + justifyContent: 'center', + }, +}); +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### ref + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Switch/Switch.mdx b/docs/versioned_docs/version-5.x/components/Switch/Switch.mdx new file mode 100644 index 0000000000..9040b1f50c --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Switch/Switch.mdx @@ -0,0 +1,95 @@ +--- +title: Switch +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Switch is a visual toggle between two mutually exclusive states — on and off. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Switch } from 'react-native-paper'; + +const MyComponent = () => { + const [isSwitchOn, setIsSwitchOn] = React.useState(false); + + const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn); + + return ; +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### disabled + +
+ + + +
+ +### value + +
+ + + +
+ +### color + +
+ + + +
+ +### onValueChange + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Text/Text.mdx b/docs/versioned_docs/version-5.x/components/Text/Text.mdx new file mode 100644 index 0000000000..b6e28003b6 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Text/Text.mdx @@ -0,0 +1,101 @@ +--- +title: Text +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Typography component showing styles complied with passed `variant` prop and supported by the type system. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Text } from 'react-native-paper'; + +const MyComponent = () => ( + <> + Display Large + Display Medium + Display small + + Headline Large + Headline Medium + Headline Small + + Title Large + Title Medium + Title Small + + Body Large + Body Medium + Body Small + + Label Large + Label Medium + Label Small + +); + +export default MyComponent; +``` + + + + + ## Props + ### Text props + + + +
+ +### variant Available in v5.x with theme version 3 + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/TextInput/TextInput.mdx b/docs/versioned_docs/version-5.x/components/TextInput/TextInput.mdx new file mode 100644 index 0000000000..a02528bdd6 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/TextInput/TextInput.mdx @@ -0,0 +1,301 @@ +--- +title: TextInput +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to allow users to input text. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { TextInput } from 'react-native-paper'; + +const MyComponent = () => { + const [text, setText] = React.useState(""); + + return ( + setText(text)} + /> + ); +}; + +export default MyComponent; +``` + + + + + ## Props + ### TextInput props + + + +
+ +### mode + +
+ + + +
+ +### left + +
+ + + +
+ +### right + +
+ + + +
+ +### disabled + +
+ + + +
+ +### label + +
+ + + +
+ +### placeholder + +
+ + + +
+ +### error + +
+ + + +
+ +### onChangeText + +
+ + + +
+ +### selectionColor + +
+ + + +
+ +### cursorColor Android only + +
+ + + +
+ +### underlineColor + +
+ + + +
+ +### activeUnderlineColor + +
+ + + +
+ +### outlineColor + +
+ + + +
+ +### activeOutlineColor + +
+ + + +
+ +### textColor + +
+ + + +
+ +### dense + +
+ + + +
+ +### multiline + +
+ + + +
+ +### numberOfLines Android only + +
+ + + +
+ +### onFocus + +
+ + + +
+ +### onBlur + +
+ + + +
+ +### render + +
+ + + +
+ +### value + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### outlineStyle + +
+ + + +
+ +### underlineStyle + +
+ + + +
+ +### editable + +
+ + + + + + + + + + + ## Known Issues + +
+ +
+ diff --git a/docs/versioned_docs/version-5.x/components/TextInput/TextInputAffix.mdx b/docs/versioned_docs/version-5.x/components/TextInput/TextInputAffix.mdx new file mode 100644 index 0000000000..74f1fc0434 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/TextInput/TextInputAffix.mdx @@ -0,0 +1,100 @@ +--- +title: TextInput.Affix +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to render a leading / trailing text in the TextInput + + + + + + + +## Usage +```js +import * as React from 'react'; +import { TextInput } from 'react-native-paper'; + +const MyComponent = () => { + const [text, setText] = React.useState(''); + + return ( + } + /> + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### text (required) + +
+ + + +
+ +### onLayout + +
+ + + +
+ +### onPress + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/TextInput/TextInputIcon.mdx b/docs/versioned_docs/version-5.x/components/TextInput/TextInputIcon.mdx new file mode 100644 index 0000000000..703ffc298d --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/TextInput/TextInputIcon.mdx @@ -0,0 +1,107 @@ +--- +title: TextInput.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to render a leading / trailing icon in the TextInput + + + + + + + +## Usage +```js +import * as React from 'react'; +import { TextInput } from 'react-native-paper'; + +const MyComponent = () => { + const [text, setText] = React.useState(''); + + return ( + } + /> + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### icon (required) Renamed from 'name' to 'icon` in v5.x + +
+ + + +
+ +### onPress + +
+ + + +
+ +### forceTextInputFocus + +
+ + + +
+ +### color + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButton.mdx b/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButton.mdx new file mode 100644 index 0000000000..a2dedc9a06 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButton.mdx @@ -0,0 +1,162 @@ +--- +title: ToggleButton +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Toggle buttons can be used to group related options. To emphasize groups of related toggle buttons, +a group should share a common container. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ToggleButton } from 'react-native-paper'; + +const ToggleButtonExample = () => { + const [status, setStatus] = React.useState('checked'); + + const onButtonToggle = value => { + setStatus(status === 'checked' ? 'unchecked' : 'checked'); + }; + + return ( + + ); +}; + +export default ToggleButtonExample; + +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### iconColor + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### disabled + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### value + +
+ + + +
+ +### status + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### ref + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButtonGroup.mdx b/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButtonGroup.mdx new file mode 100644 index 0000000000..8f5a4ab20f --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButtonGroup.mdx @@ -0,0 +1,78 @@ +--- +title: ToggleButton.Group +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Toggle group allows to control a group of toggle buttons. +It doesn't change the appearance of the toggle buttons. If you want to group them in a row, check out [ToggleButton.Row](ToggleButtonRow). + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ToggleButton } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('left'); + + return ( + setValue(value)} + value={value} + > + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### onValueChange (required) + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButtonRow.mdx b/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButtonRow.mdx new file mode 100644 index 0000000000..b326a1eb73 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/ToggleButton/ToggleButtonRow.mdx @@ -0,0 +1,83 @@ +--- +title: ToggleButton.Row +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Toggle button row renders a group of toggle buttons in a row. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ToggleButton } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('left'); + + return ( + setValue(value)} value={value}> + + + + ); +}; + +export default MyComponent; + +``` + + + ## Props + + + + +
+ +### onValueChange (required) + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/Tooltip/Tooltip.mdx b/docs/versioned_docs/version-5.x/components/Tooltip/Tooltip.mdx new file mode 100644 index 0000000000..18a2f43339 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/Tooltip/Tooltip.mdx @@ -0,0 +1,99 @@ +--- +title: Tooltip +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Tooltips display informative text when users hover over, focus on, or tap an element. + +Plain tooltips, when activated, display a text label identifying an element, such as a description of its function. Tooltips should include only short, descriptive text and avoid restating visible UI text. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { IconButton, Tooltip } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### enterTouchDelay + +
+ + + +
+ +### leaveTouchDelay + +
+ + + +
+ +### title (required) + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-5.x/components/TouchableRipple/TouchableRipple.mdx b/docs/versioned_docs/version-5.x/components/TouchableRipple/TouchableRipple.mdx new file mode 100644 index 0000000000..b53a4ee98c --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/TouchableRipple/TouchableRipple.mdx @@ -0,0 +1,157 @@ +--- +title: TouchableRipple +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A wrapper for views that should respond to touches. +Provides a material "ink ripple" interaction effect for supported platforms (>= Android Lollipop). +On unsupported platforms, it falls back to a highlight effect. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Text, TouchableRipple } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')} + rippleColor="rgba(0, 0, 0, .32)" + > + Press anywhere + +); + +export default MyComponent; +``` + + + + + ## Props + ### Pressable props + + + +
+ +### borderless + +
+ + + +
+ +### background + +
+ + + +
+ +### centered + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### underlayColor + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-5.x/components/_category_.json b/docs/versioned_docs/version-5.x/components/_category_.json new file mode 100644 index 0000000000..c1ea2a2a75 --- /dev/null +++ b/docs/versioned_docs/version-5.x/components/_category_.json @@ -0,0 +1,3 @@ +{ + "label": "Components" +} \ No newline at end of file diff --git a/docs/versioned_docs/version-5.x/guides/01-getting-started.md b/docs/versioned_docs/version-5.x/guides/01-getting-started.md new file mode 100644 index 0000000000..68071c4d25 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/01-getting-started.md @@ -0,0 +1,171 @@ +--- +title: Getting Started +--- + +# Getting Started + +## Installation + +- Open a Terminal in your project's folder and run: + +```bash npm2yarn +npm install react-native-paper +``` + +- From `v5` there is a need to install [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe area. + +```bash npm2yarn +npm install react-native-safe-area-context +``` + +Additionaly for `iOS` platform there is a requirement to link the native parts of the library: + +```bash +npx pod-install +``` + +- If you're on a vanilla React Native project, you also need to install and link [@react-native-vector-icons/material-design-icons](https://github.com/oblador/react-native-vector-icons). + +Specifically `MaterialDesignIcons` icon pack needs to be included in the project, because some components use those internally (e.g. `AppBar.BackAction` on Android). + +```bash npm2yarn +npm install @react-native-vector-icons/material-design-icons +``` + +:::note +The `react-native-vector-icons` library requires some additional setup steps for each platform. To ensure proper use of icon fonts, please follow their [installation guide](https://github.com/oblador/react-native-vector-icons?tab=readme-ov-file#setup). +::: + +If you use Expo, you don't need to install vector icons - those are the part of the expo package. However, if you have a `babel.config.js` or `.babelrc` file, make sure that it includes `babel-preset-expo`. + +:::info +If you don't want to install vector icons, you can use [babel-plugin-optional-require](https://github.com/satya164/babel-plugin-optional-require) to opt-out. +:::note + +### Bundle size optimization + +To get smaller bundle size by excluding modules you don't use, you can use our optional babel plugin. The plugin automatically rewrites the import statements so that only the modules you use are imported instead of the whole library. Add `react-native-paper/babel` to the `plugins` section in your `babel.config.js` for production environment. It should look like this: + +```js +module.exports = { + presets: ['module:metro-react-native-babel-preset'], + env: { + production: { + plugins: ['react-native-paper/babel'], + }, + }, +}; +``` + +If you created your project using Expo, it'll look something like this: + +```js +module.exports = function (api) { + api.cache(true); + return { + presets: ['babel-preset-expo'], + env: { + production: { + plugins: ['react-native-paper/babel'], + }, + }, + }; +}; +``` + +The plugin only works if you are importing the library using ES2015 import statements and not with `require`. + +:::note +The above examples are for the latest `react-native` using Babel 7. If you have `react-native <= 0.55`, you'll have a `.babelrc` file instead of a `babel.config.js` file and the content of the file will be different. +::: + +If you're using Flow for typechecking your code, you need to add the following under the `[options]` section in your `.flowconfig`: + +```ini +module.file_ext=.js +module.file_ext=.native.js +module.file_ext=.android.js +module.file_ext=.ios.js +``` + +## Usage + +Wrap your root component in `PaperProvider` from `react-native-paper`(if you are using versions prior to 5.8.0 you need to use `Provider`). If you have a vanilla React Native project, it's a good idea to add it in the component which is passed to `AppRegistry.registerComponent`. This will usually be in the `index.js` file. If you have an Expo project, you can do this inside the exported component in the `App.js` file. + +Example: + +```js +import * as React from 'react'; +import { AppRegistry } from 'react-native'; +import { PaperProvider } from 'react-native-paper'; +import { name as appName } from './app.json'; +import App from './src/App'; + +export default function Main() { + return ( + + + + ); +} + +AppRegistry.registerComponent(appName, () => Main); +``` + +The `PaperProvider` component provides the theme to all the components in the framework. It also acts as a portal to components which need to be rendered at the top level. + +If you have another provider (such as `Redux`), wrap it outside `PaperProvider` so that the context is available to components rendered inside a `Modal` from the library: + +```js +import * as React from 'react'; +import { PaperProvider } from 'react-native-paper'; +import { Provider as StoreProvider } from 'react-redux'; +import App from './src/App'; +import store from './store'; + +export default function Main() { + return ( + + + + + + ); +} +``` + +## Customization + +You can provide a custom theme to customize the colors, typescales etc. with the `Provider` component. Check the [Material Design 3 default theme](https://github.com/callstack/react-native-paper/blob/main/src/styles/themes/v3/LightTheme.tsx) to see what customization options are supported. + +Example: + +```js +import * as React from 'react'; +import { + MD3LightTheme as DefaultTheme, + PaperProvider, +} from 'react-native-paper'; +import App from './src/App'; + +const theme = { + ...DefaultTheme, + colors: { + ...DefaultTheme.colors, + primary: 'tomato', + secondary: 'yellow', + }, +}; + +export default function Main() { + return ( + + + + ); +} +``` + +:::note +For MD2 check the following [Material Design 2 default theme](https://github.com/callstack/react-native-paper/blob/main/src/styles/themes/v2/LightTheme.tsx). +::: diff --git a/docs/versioned_docs/version-5.x/guides/02-theming.mdx b/docs/versioned_docs/version-5.x/guides/02-theming.mdx new file mode 100644 index 0000000000..53bb236889 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/02-theming.mdx @@ -0,0 +1,639 @@ +--- +title: Theming +--- + +import DynamicColorTheme from '@site/src/components/DynamicColorTheme.tsx'; + +# Theming + +:::note +To observe changes related to switching between light and dark mode in the app, ensure that the "Override force-dark" feature in the "developer options" settings on your Android device is not overridden. +::: + +## Applying a theme to the whole app + +To support custom themes, paper exports a `PaperProvider` component. You need to wrap your root component with the provider to be able to support themes: + +```js +import * as React from 'react'; +import { PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +export default function Main() { + return ( + + + + ); +} +``` + +By default React Native Paper will apply the [Material You theme (MD3)](https://github.com/callstack/react-native-paper/blob/main/src/styles/themes/v3/LightTheme.tsx) if no `theme` or `version` prop is passed to the `PaperProvider`. + +## Accessing theme properties + +Use the built-in `useTheme()` hook to get access to the theme's variables: + +```js +import * as React from 'react'; +import { useTheme } from 'react-native-paper'; + +export default function PaymentScreen() { + const theme = useTheme(); + + return ; +} +``` + +You can also use the `withTheme()` HOC exported from the library. If you wrap your component with the HOC, you'll receive the theme as a prop: + +```js +import * as React from 'react'; +import { withTheme } from 'react-native-paper'; + +function PaymentScreen({ theme }) { + return ; +} + +export default withTheme(PaymentScreen); +``` + +## Theme properties + +You can change the theme prop dynamically and all the components will automatically update to reflect the new theme. + +A theme usually contains the following properties: + +- `dark` (`boolean`): whether this is a dark theme or light theme. +- `version`: specify which design system components should follow in the app + - 3 - new Material You (MD3) + - 2 - previous Material Design (MD2) +- `mode` (`'adaptive' | 'exact'`): color mode for dark theme (See [Dark Theme](#dark-theme)). +- `roundness` (`number`): roundness of common elements, such as buttons. +- `colors` (`object`): various colors used throughout different elements. + + > The primary key color is used to derive roles for key components across the UI, such as the FAB, prominent buttons, active states, as well as the tint of elevated surfaces. + + - `primary` + - `onPrimary` + - `primaryContainer` + - `onPrimaryContainer` + + > The secondary key color is used for less prominent components in the UI such as filter chips, while expanding the opportunity for color expression. + + - `secondary` + - `onSecondary` + - `secondaryContainer` + - `onSecondaryContainer` + + > The tertiary key color is used to derive the roles of contrasting accents that can be used to balance primary and secondary colors or bring heightened attention to an element. + + > The tertiary color role is left for teams to use at their discretion and is intended to support broader color expression in products. + + - `tertiary` + - `onTertiary` + - `tertiaryContainer` + - `onTertiaryContainer` + + > The neutral key color is used to derive the roles of surface and background, as well as high emphasis text and icons. + + - `background` + - `onBackground` + - `surface` + - `onSurface` + + > The neutral variant key color is used to derive medium emphasis text and icons, surface variants, and component outlines. + + - `surfaceVariant` + - `onSurfaceVariant` + - `outline` + + > In addition to the accent and neutral key color, the color system includes a semantic color role for error + + - `error` + - `onError` + - `errorContainer` + - `onErrorContainer` + + > Surfaces at elevation levels 0-5 are tinted via color overlays based on the primary color, such as app bars or menus. The addition of a grade from 0-5 introduces tonal variation to the surface baseline. + + - `elevation` (`object`) + - `level0` - transparent + - `level1` - 5% opacity + - `level2` - 8% opacity + - `level3` - 11% opacity + - `level4` - 12% opacity + - `level5` - 14% opacity + + > Colors for disabled state + + - `surfaceDisabled` + - `onSurfaceDisabled` + + > These additional role mappings exist in a scheme and are mapped to components where needed. + + - `shadow` + - `inverseOnSurface` + - `inverseSurface` + - `inversePrimary` + - `backdrop` + +- `fonts` (`object`): various fonts styling properties under the text variant key used in component. + - [`variant` e.g. `labelMedium`] (`object`): + - `fontFamily` + - `letterSpacing` + - `fontWeight` + - `lineHeight` + - `fontSize` +- `animation` (`object`) + - `scale` - scale for all animations + +When creating a custom theme, you will need to provide all of these properties. + +If you don't use a custom theme, Paper will automatically turn animations on/off, depending on device settings. + +Otherwise, your custom theme will need to handle it manually, using React Native's [AccessibilityInfo API](https://reactnative.dev/docs/accessibilityinfo). + +## Extending the theme + +Keeping your own properties in the theme is fully supported by our library: + +```js +import * as React from 'react'; +import { + MD3LightTheme as DefaultTheme, + PaperProvider, +} from 'react-native-paper'; +import App from './src/App'; + +const theme = { + ...DefaultTheme, + // Specify custom property + myOwnProperty: true, + // Specify custom property in nested object + colors: { + ...DefaultTheme.colors, + myOwnColor: '#BADA55', + }, +}; + +export default function Main() { + return ( + + + + ); +} +``` + +## Creating dynamic theme colors + +Dynamic Color Themes allows for generating two color schemes lightScheme and darkScheme, based on the provided source color. +Created schemes are following the Material Design 3 color system and covering colors structure from the Paper theme. User may generate these schemes using the following tool: + + + +
+ +Passed source color into the util is translated into tones to automatically provide the range of tones that map to color roles. + +![customColors](../../../static/screenshots/custom-colors.png) + +_Source: [Material You Color System](https://m3.material.io/styles/color/the-color-system/custom-colors)_ + +### Using schemes + +Once we have copied the color schemes from the generated JSON above, we can use by passing it to the colors in `theme` object as below: + +```jsx +import * as React from 'react'; +import { + MD3LightTheme as DefaultTheme, + PaperProvider, +} from 'react-native-paper'; +import App from './src/App'; + +const theme = { + ...DefaultTheme, + colors: yourGeneratedLightOrDarkScheme.colors, // Copy it from the color codes scheme and then use it here +}; + +export default function Main() { + return ( + + + + ); +} +``` + +### Sync dynamic colors with system colors + +Using [`pchmn/expo-material3-theme`](https://github.com/pchmn/expo-material3-theme) library you can easily access the Material 3 system colors from Android 12+ devices and seamlessly integrate them into your dynamic theme. Any changes made by the user to the system colors will be automatically reflected in the theme. + +:::info +In case of incompatible devices, the library will revert to a default theme. +::: + +To get started, follow the [installation instructions](https://github.com/pchmn/expo-material3-theme#installation) and check the following code: + +```tsx +import { useMaterial3Theme } from '@pchmn/expo-material3-theme'; +import { useColorScheme } from 'react-native'; +import { MD3DarkTheme, MD3LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +export default function Main() { + const colorScheme = useColorScheme(); + const { theme } = useMaterial3Theme(); + + const paperTheme = + colorScheme === 'dark' + ? { ...MD3DarkTheme, colors: theme.dark } + : { ...MD3LightTheme, colors: theme.light }; + + return ( + + + + ); +} +``` + +## Adapting React Navigation theme + +The `adaptNavigationTheme` function takes an existing React Navigation theme and returns a React Navigation theme using the colors from Material Design 3. This theme can be passed to `NavigationContainer` so that React Navigation's UI elements have the same color scheme as Paper. + +```ts +adaptNavigationTheme(themes); +``` + +:::info +For users of `react-navigation` version `7.0.0` and above, `adaptNavigationTheme` overrides the **fonts** from the navigation theme as follows: + +```ts +fonts: { + regular: { + fontFamily: materialTheme.fonts.bodyMedium.fontFamily, + fontWeight: materialTheme.fonts.bodyMedium.fontWeight, + letterSpacing: materialTheme.fonts.bodyMedium.letterSpacing, + }, + medium: { + fontFamily: materialTheme.fonts.titleMedium.fontFamily, + fontWeight: materialTheme.fonts.titleMedium.fontWeight, + letterSpacing: materialTheme.fonts.titleMedium.letterSpacing, + }, + bold: { + fontFamily: materialTheme.fonts.headlineSmall.fontFamily, + fontWeight: materialTheme.fonts.headlineSmall.fontWeight, + letterSpacing: materialTheme.fonts.headlineSmall.letterSpacing, + }, + heavy: { + fontFamily: materialTheme.fonts.headlineLarge.fontFamily, + fontWeight: materialTheme.fonts.headlineLarge.fontWeight, + letterSpacing: materialTheme.fonts.headlineLarge.letterSpacing, + }, +} +``` + +::: + +Parameters: + +| NAME | TYPE | +| ------ | ------ | +| themes | object | + +Valid `themes` keys are: + +- `reactNavigationLight` () - React Navigation compliant light theme. +- `reactNavigationDark` () - React Navigation compliant dark theme. +- `materialLight` () - React Native Paper compliant light theme. +- `materialDark` () - React Native Paper compliant dark theme. + +```ts +// App.tsx +import { NavigationContainer, DefaultTheme } from '@react-navigation/native'; +import { createStackNavigator } from '@react-navigation/stack'; +import { + PaperProvider, + MD3LightTheme, + adaptNavigationTheme, +} from 'react-native-paper'; +const Stack = createStackNavigator(); +const { LightTheme } = adaptNavigationTheme({ + reactNavigationLight: DefaultTheme, +}); +export default function App() { + return ( + + + + + + + + + ); +} +``` + +## TypeScript + +By default, TypeScript works well whenever you change the value of the built-in theme's properties. It gets more complicated when you want to extend the theme's properties or change their types. In order to fully support TypeScript, you will need to follow the guide that fits your use-case most accurately: + +There are two supported ways of overriding the theme: + +1. Simple built-in theme overrides - when you only customize the values and + the whole theme schema remains the same +2. Advanced theme overrides - when you add new properties or + change the built-in schema shape + + +:::caution +TypeScript support for `withTheme` is currently limited to Material You (MD3) theme only. + + + We are planning to provide a better support of handling custom theme overrides + in future releases. + +::: + +### Simple built-in theme overrides + +You can provide a `theme` prop with a theme object with the same properties as the default theme: + +```js +import * as React from 'react'; +import { MD3LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +const theme = { + ...MD3LightTheme, // or MD3DarkTheme + roundness: 2, + colors: { + ...MD3LightTheme.colors, + primary: '#3498db', + secondary: '#f1c40f', + tertiary: '#a1b2c3', + }, +}; + +export default function Main() { + return ( + + + + ); +} +``` + +### Advanced theme overrides + +If you need to modify the built-in theme schema by adding a new property or changing its type, you need to follow these steps: + +1. Pass your theme overrides to the PaperProvider component + +```ts +import * as React from 'react'; +import { MD3LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +const theme = { + ...MD3LightTheme, + + // Specify a custom property + custom: 'property', + + // Specify a custom property in nested object + colors: { + ...MD3LightTheme.colors, + brandPrimary: '#fefefe', + brandSecondary: 'red', + }, +}; + +export default function Main() { + return ( + + + + ); +} +``` + +2. Create a typed `useAppTheme()` hook in your project + +```ts +import * as React from 'react'; +import { MD3LightTheme, PaperProvider, useTheme } from 'react-native-paper'; +import App from './src/App'; + +const theme = { + ...MD3LightTheme, + + // Specify a custom property + custom: 'property', + + // Specify a custom property in nested object + colors: { + ...MD3LightTheme.colors, + brandPrimary: '#fefefe', + brandSecondary: 'red', + }, +}; + +export type AppTheme = typeof theme; + +export const useAppTheme = () => useTheme(); + +export default function Main() { + return ( + + + + ); +} +``` + +3. Start using the `useAppTheme()` hook across your components in the whole app + +```ts +import * as React from 'react'; +import { useAppTheme } from './App'; + +export default function HomeScreen() { + const { + colors: { brandPrimary }, + } = useAppTheme(); + + return ...; +} +``` + +## Material Design 2 + +Using Material Design 2 is fully supported in React Native Paper v5.x. + +### Simple setup + +In order to use the Material Design 2 theme you can just pass `{ version: 2 }` to the PaperProvider theme prop: + +```js +import * as React from 'react'; +import { PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +export default function Main() { + return ( + + + + ); +} +``` + +Specifying `{ version: 2 }` tells React Native Paper to use the built in Material Design 2 theme, so you don't have to fully extend it on your own. + +### Advanced setup + +As with any theme, you can also specify your custom properties within the Material Design 2 theme: + +```js +import * as React from 'react'; +import { MD2LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +export default function Main() { + const theme = { + ...MD2LightTheme, + + // Specify a custom property + custom: 'property', + + // Specify a custom nested property + colors: { + ...MD2LightTheme.colors, + primary: '#fefefe', + }, + }; + + return ( + + + + ); +} +``` + +### Typescript + +Due to the amount of changes in the theme's schema shape it falls into the [Advanced theme overrides](#advanced-theme-overrides) category. The steps are identical as with any advanced theme, just make sure to extend the built-in `MD2LightTheme` or `MD2DarkTheme` instead of `MD3LightTheme` or `MD3DarkTheme`. + +The final example for Material Design 2 would look like this: + +```ts +import * as React from 'react'; +import { MD2LightTheme, PaperProvider, useTheme } from 'react-native-paper'; +import App from './src/App'; + +const theme = { + // Extend Material Design 2 theme + + ...MD2LightTheme, // or MD2DarkTheme + + // Specify a custom property + myOwnProperty: true, + + // Specify a custom nested property + colors: { + ...MD2LightTheme.colors, + myOwnColor: '#BADA55', + }, +}; + +export type AppTheme = typeof theme; + +export const useAppTheme = () => useTheme(); + +export default function Main() { + return ( + + + + ); +} + +// App.tsx + +export default function App() { + const { theme } = useAppTheme(); + + return ; +} +``` + +### Migrating to Material You + +If you are migrating from Material Design 2 (4.x and lower) to Material You (5.x), please refer to our [Migration Guide](https://callstack.github.io/react-native-paper/docs/guides/migration-guide-to-5.0) + +## Applying a theme to a paper component + +If you want to change the theme for a certain component from the library, you can directly pass the `theme` prop to the component. The theme passed as the prop is merged with the theme from the `PaperProvider`: + +```js +import * as React from 'react'; +import { Button } from 'react-native-paper'; + +export default function ButtonExample() { + return ( + + ); +} +``` + +## Customizing all instances of a component + +Sometimes you want to style a component in a different way everywhere, but don't want to change the properties in the theme, so that other components are not affected. For example, say you want to change the font for all your buttons, but don't want to change `theme.fonts.labelLarge` because it affects other components. + +We don't have an API to do this, because you can already do it with components: + +```js +import * as React from 'react'; +import { Button } from 'react-native-paper'; + +export default function FancyButton(props) { + return ( + +``` + +:::note +Choose the correct tab below based on your `react-native-vector-icons` version: + +- Use **latest** tab if you're using the latest version of `@react-native-vector-icons/material-design-icons` +- Use **10.x** tab if you're still using the old single package `react-native-vector-icons`, version `10.x` + +If you are using `@expo/vector-icons`, please check their [searchable list of icons](https://icons.expo.fyi/). +::: + + + +
+ See the list of supported icons + +
+
+ +
+ See the list of supported icons + +
+
+
+ +### 2. An image source + +You can pass an image source, such as an object of shape `{ uri: 'https://path.to' }` or a local image: `require('../path/to/image.png')` to use as an icon. The image might be rendered with a different color than the one provided depending on the component. If don't want this behavior, see the next example to pass an `Image` element. + +Remote image: + +```js + +``` + +Local image: + +```js + +``` + +### 3. A render function + +You can pass a function which returns a react element to be used an icon. The function receives an object with `size` and `color` properties as its arguments. The element is used as is without any modification. However, it might get clipped if the provided element's size is bigger than what the component renders. It's up to you to make sure that the size of the element is correct. + +Example: + +```js + +``` + +### 4. Use custom icons + +If you want to use icons other than `MaterialDesignIcons` you need to import the icons and pass it to the `settings` prop within `PaperProvider`. + +Example: + +```js +import AwesomeIcon from '@react-native-vector-icons/fontawesome'; +// ... + + , + }} + theme={this.state.theme} +> + // ... +; +``` + +## RTL support + +If you want your icon to behave properly in a RTL environment, you can pass an object to the `icon` prop with shape: `{ source: { uri: 'https://path.to' }, direction : 'rtl' }`. `source` can be any of the values that the `icon` prop accepts in [option 1](#1.-an-icon-name) and [option 2](#2.-an-image-source). For `direction` you have a few options: + +1. `auto` - uses the device language to determine if icon should be displayed from rtl. Uses the `I18nManager` module to get this info. +2. `rtl` - flips the icon so that it is rtl, this is regardless of the device language. +3. `ltr` - displays from ltr, even if in an rtl environment. + +Example for using an image source: + +```js + +``` + +Example for using an icon name: + +```js + +``` + +You can also use a render function. Along with `size` and `color`, you have access to `direction` which will either be `'rtl'` or `'ltr'`. You can then decide how to render your icon component accordingly. + +Example of using a render function: + +```js + +``` diff --git a/docs/versioned_docs/version-5.x/guides/04-fonts.md b/docs/versioned_docs/version-5.x/guides/04-fonts.md new file mode 100644 index 0000000000..60d3c6e457 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/04-fonts.md @@ -0,0 +1,527 @@ +--- +title: Fonts +--- + +# Fonts + +## Installing custom fonts + +The easiest way to install custom fonts to your RN project is do as follows: + + 1. Define path to assets directory with fonts in project: + + Example: + + ```js + module.exports = { + ... + assets: [ + './assets/fonts' + ], + ``` + +:::note +`fonts` is a folder with `.ttf` files +::: + + 2. Place your font files in your assets directory. + + 3. Link font files, using the following command in the terminal: + + * React Native `>= 0.69`: + + ```sh + npx react-native-asset + ``` + + * React Native `< 0.69`: + + ```sh + npx react-native link + ``` + + + 4. Restart your project to refresh changes. + +Now, you are able to use `fontFamily` from font files. + +## Configuring fonts in ThemeProvider + +### Material Design 2 + +#### Using `configureFonts` helper + +To create a custom font, prepare a `fontConfig` object where fonts are divided by platforms. After that, you have to: + +* pass the `fontConfig` into `configureFonts` params object property called `config` +* set the params object property `isV3` to `false`. + +The `fontConfig` object accepts `ios`, `android`, `macos`, `windows`, `web`, and `native`. Use these to override fonts on particular platforms. + +:::info +At a minimum, you need to explicitly pass fonts for `android`, `ios`, and `web`. +::: + +```js +import * as React from 'react'; +import { configureFonts, MD2LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +const fontConfig = { + web: { + regular: { + fontFamily: 'sans-serif', + fontWeight: 'normal', + }, + medium: { + fontFamily: 'sans-serif-medium', + fontWeight: 'normal', + }, + light: { + fontFamily: 'sans-serif-light', + fontWeight: 'normal', + }, + thin: { + fontFamily: 'sans-serif-thin', + fontWeight: 'normal', + }, + }, + ios: { + regular: { + fontFamily: 'sans-serif', + fontWeight: 'normal', + }, + medium: { + fontFamily: 'sans-serif-medium', + fontWeight: 'normal', + }, + light: { + fontFamily: 'sans-serif-light', + fontWeight: 'normal', + }, + thin: { + fontFamily: 'sans-serif-thin', + fontWeight: 'normal', + }, + }, + android: { + regular: { + fontFamily: 'sans-serif', + fontWeight: 'normal', + }, + medium: { + fontFamily: 'sans-serif-medium', + fontWeight: 'normal', + }, + light: { + fontFamily: 'sans-serif-light', + fontWeight: 'normal', + }, + thin: { + fontFamily: 'sans-serif-thin', + fontWeight: 'normal', + }, + } +}; + +const theme = { + ...MD2LightTheme, + fonts: configureFonts({config: fontConfig, isV3: false}), +}; + +export default function Main() { + return ( + + + + ); +} +``` + +:::tip +If you're using TypeScript use `as const` when defining `fontConfig`. +::: + +### Material Design 3 + +#### Variants + +In the latest version fonts in theme are structured based on the `variant` keys e.g. `displayLarge` or `bodyMedium` which are then used in `Text`'s component throughout the whole library. + +:::info +The default `fontFamily` is different per particular platfrom: + +```js +Platform.select({ + web: 'Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif', + ios: 'System', + default: 'sans-serif', // and 'sans-serif-medium' for `fontWeight:"500"` +}), +``` +::: + +* #### Display + +
+
+ + ```json + "displaySmall": { + "fontFamily": "Font", + "fontSize": 36, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 44, + } + ``` + +
+ +
+ + ```json + "displayMedium": { + "fontFamily": "Font", + "fontSize": 45, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 52, + } + ``` + +
+ +
+ + ```json + "displayLarge": { + "fontFamily": "Font", + "fontSize": 57, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 64, + } + ``` + +
+
+ +* #### Headline + +
+
+ + ```json + "headlineSmall": { + "fontFamily": "Font", + "fontSize": 24, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 32, + } + ``` + +
+ +
+ + ```json + "headlineMedium": { + "fontFamily": "Font", + "fontSize": 28, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 36, + } + ``` + +
+ +
+ + ```json + "headlineLarge": { + "fontFamily": "Font", + "fontSize": 32, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 40, + } + ``` + +
+
+ +* #### Title + +
+
+ + ```json + "titleSmall": { + "fontFamily": "Font", + "fontSize": 14, + "fontWeight": "500", + "letterSpacing": 0.1, + "lineHeight": 20, + } + ``` + +
+ +
+ + ```json + "titleMedium": { + "fontFamily": "Font", + "fontSize": 16, + "fontWeight": "500", + "letterSpacing": 0.15, + "lineHeight": 24, + } + ``` + +
+ +
+ + ```json + "titleLarge": { + "fontFamily": "Font", + "fontSize": 22, + "fontWeight": "400", + "letterSpacing": 0, + "lineHeight": 28, + } + ``` + +
+
+ +* #### Label + +
+
+ + ```json + "labelSmall": { + "fontFamily": "Font", + "fontSize": 11, + "fontWeight": "500", + "letterSpacing": 0.5, + "lineHeight": 16, + } + ``` + +
+ +
+ + ```json + "labelMedium": { + "fontFamily": "Font", + "fontSize": 12, + "fontWeight": "500", + "letterSpacing": 0.5, + "lineHeight": 16, + } + ``` + +
+ +
+ + ```json + "labelLarge": { + "fontFamily": "Font", + "fontSize": 14, + "fontWeight": "500", + "letterSpacing": 0.1, + "lineHeight": 20, + } + ``` + +
+
+ +* #### Body + +
+
+ + ```json + "bodySmall": { + "fontFamily": "Font", + "fontSize": 12, + "fontWeight": "400", + "letterSpacing": 0.4, + "lineHeight": 16, + } + ``` + +
+ +
+ + ```json + "bodyMedium": { + "fontFamily": "Font", + "fontSize": 14, + "fontWeight": "400", + "letterSpacing": 0.25, + "lineHeight": 20, + } + ``` + +
+ +
+ + ```json + "bodyLarge": { + "fontFamily": "Font", + "fontSize": 16, + "fontWeight": "400", + "letterSpacing": 0.15, + "lineHeight": 24, + } + ``` + +
+
+ +:::info +If any component uses Paper's `Text` component, without specified variant, then `default` variant is applied: + +```json +"default": { + "fontFamily": "FontFamily", + "fontWeight": "400", + "letterSpacing": 0, +}, +``` +::: + +#### Using `configureFonts` helper + +* If there is a need to create a custom font variant, prepare its config object including required all fonts properties. After that, defined `fontConfig` has to be passed under the `variant` name as `config` into the params object: + +```js +import * as React from 'react'; +import { configureFonts, MD3LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +const fontConfig = { + customVariant: { + fontFamily: Platform.select({ + web: 'Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif', + ios: 'System', + default: 'sans-serif', + }), + fontWeight: '400', + letterSpacing: 0.5, + lineHeight: 22, + fontSize: 20, + } +}; + +const theme = { + ...MD3LightTheme, + fonts: configureFonts({config: fontConfig}), +}; + +export default function Main() { + return ( + + + + ); +} +``` + +If you're using TypeScript you will need to create a custom `Text` component which accepts your custom variants: + +```typescript +import { customText } from 'react-native-paper' + +// Use this instead of importing `Text` from `react-native-paper` +export const Text = customText<'customVariant'>() +``` + + +* In order to override one of the available `variant`'s font properties, pass the modified `fontConfig` under specific `variant` name as `config` into the params object: + +```js +import * as React from 'react'; +import { configureFonts, MD3LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +const fontConfig = { + bodyLarge: { + letterSpacing: 0.5, + lineHeight: 22, + fontSize: 20, + } +}; + +const theme = { + ...MD3LightTheme, + fonts: configureFonts({config: fontConfig}), +}; + +export default function Main() { + return ( + + + + ); +} +``` + +* However, if you just want to override any font property e.g. `fontFamily` or `letterSpacing` for all variants, you can pass the `fontConfig` as a `config` into the params object without specifying variant name: + +```js +import * as React from 'react'; +import { configureFonts, MD3LightTheme, PaperProvider } from 'react-native-paper'; +import App from './src/App'; + +const fontConfig = { + fontFamily: 'NotoSans' +}; + +const theme = { + ...MD3LightTheme, + fonts: configureFonts({config: fontConfig}), +}; + +export default function Main() { + return ( + + + + ); +} +``` + + +## Variable fonts + +Although React Native Paper supports `fontWeight` and `fontStyle` properties, there are multiple limitations to custom +fonts in React Native. Using custom [variable fonts](https://fonts.google.com/knowledge/introducing_type/introducing_variable_fonts) +is especially problematic, with some platforms failing to render variants entirely. To ensure correct typography in your +app, we suggest installing each font variant as a separate file. Below you'll find example on how to set up React Native Paper +theme with custom fonts. + +Should you decide to use a variable font anyway, second example will show you how to test if the font is rendered correctly in React Native on all platforms. + +
+ Variable fonts examples + +
diff --git a/docs/versioned_docs/version-5.x/guides/05-react-native-web.md b/docs/versioned_docs/version-5.x/guides/05-react-native-web.md new file mode 100644 index 0000000000..af0331a7d9 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/05-react-native-web.md @@ -0,0 +1,282 @@ +--- +title: Using on the Web +--- + +# Using on the Web + +## Pre-requisites + +Make sure that you have followed the getting started guide and have `react-native-paper` installed and configured before following this guide. + +We're going to use [react-native-web](https://github.com/necolas/react-native-web) and [webpack](https://webpack.js.org/) to use React Native Paper on the web, so let's install them as well. + +To install `react-native-web`, run: + +```bash npm2yarn +npm install react-native-web react-dom react-art +``` + +### Using CRA ([Create React App](https://github.com/facebook/create-react-app)) + +Install [`react-app-rewired`](https://github.com/timarney/react-app-rewired) to override `webpack` configuration: + +```bash npm2yarn +npm install --save-dev react-app-rewired +``` + +[Configure `babel-loader`](#2-configure-babel-loader) using a new file called `config-overrides.js`: + +```js +module.exports = function override(config, env) { + config.module.rules.push({ + test: /\.js$/, + exclude: /node_modules[/\\](?!react-native-vector-icons)/, + use: { + loader: 'babel-loader', + options: { + // Disable reading babel configuration + babelrc: false, + configFile: false, + + // The configuration for compilation + presets: [ + ['@babel/preset-env', { useBuiltIns: 'usage' }], + '@babel/preset-react', + '@babel/preset-flow', + '@babel/preset-typescript', + ], + plugins: [ + '@babel/plugin-proposal-class-properties', + '@babel/plugin-proposal-object-rest-spread', + ], + }, + }, + }); + + return config; +}; +``` + +Change your script in `package.json`: + +```diff +/* package.json */ + + "scripts": { +- "start": "react-scripts start", ++ "start": "react-app-rewired start", +- "build": "react-scripts build", ++ "build": "react-app-rewired build", +- "test": "react-scripts test --env=jsdom", ++ "test": "react-app-rewired test --env=jsdom" +} +``` + +### Custom webpack setup + +To install `webpack`, run: + +```bash npm2yarn +npm install --save-dev webpack webpack-cli webpack-dev-server +``` + +If you don't have a webpack config in your project, copy the following to `webpack.config.js` get started: + +```js +const path = require('path'); + +module.exports = { + mode: 'development', + + // Path to the entry file, change it according to the path you have + entry: path.join(__dirname, 'App.js'), + + // Path for the output files + output: { + path: path.join(__dirname, 'dist'), + filename: 'app.bundle.js', + }, + + // Enable source map support + devtool: 'source-map', + + // Loaders and resolver config + module: { + rules: [], + }, + resolve: {}, + + // Development server config + devServer: { + contentBase: [path.join(__dirname, 'public')], + historyApiFallback: true, + }, +}; +``` + +Also create a folder named `public` and add the following file named `index.html`: + +```html + + + + + + + + App + + + + +
+ + +``` + +Now we're ready to start configuring the project. + +## Configure webpack + +### 1. Alias `react-native` to `react-native-web` + +First, we have to tell webpack to use `react-native-web` instead of `react-native`. Add the following alias in your webpack config under `resolve`: + +```js +alias: { + 'react-native$': require.resolve('react-native-web'), +} +``` + +### 2. Configure `babel-loader` + +Next, we want to tell `babel-loader` to compile `react-native-paper` and `react-native-vector-icons`. We would also want to disable reading the babel configuration files to prevent any conflicts. + +First install the required dependencies: + +```bash npm2yarn +npm install --save-dev babel-loader @babel/preset-env @babel/preset-react @babel/preset-flow @babel/preset-typescript @babel/plugin-proposal-class-properties @babel/plugin-proposal-object-rest-spread +``` + +Now, add the following in the `module.rules` array in your webpack config: + +```js +{ + test: /\.js$/, + exclude: /node_modules[/\\](?!react-native-vector-icons)/, + use: { + loader: 'babel-loader', + options: { + // Disable reading babel configuration + babelrc: false, + configFile: false, + + // The configuration for compilation + presets: [ + ['@babel/preset-env', { useBuiltIns: 'usage' }], + '@babel/preset-react', + '@babel/preset-flow', + "@babel/preset-typescript" + ], + plugins: [ + '@babel/plugin-proposal-class-properties', + '@babel/plugin-proposal-object-rest-spread' + ], + }, + }, +}, +``` + +### 3. Configure `file-loader` + +#### webpack < 5.0 + +To be able to import images and other assets using `require`, we need to configure `file-loader`. Let's install it: + +```bash npm2yarn +npm install --save-dev file-loader +``` + +To configure it, add the following in the `module.rules` array in your webpack config: + +```js +{ + test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/, + loader: 'file-loader', +} +``` + +##### webpack >= 5.0 + +Use `asset/resource`, since `file-loader` was deprecated in webpack v5. + +```js +{ + test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/, + type: 'asset/resource' +} +``` + +## Load the Material Design Icons + +If you followed the getting started guide, you should have the following code in your root component: + +```js + + + +``` + +Now we need tweak this section to load the Material Design Icons from the [`react-native-vector-icons`](https://github.com/oblador/react-native-vector-icons) library: + +```js + + + {Platform.OS === 'web' ? ( + + ) : null} + + + +``` + +Remember to import `Platform` from `react-native` at the top: + +```js +import { Platform } from 'react-native'; +``` + +You can also load these fonts using [`css-loader`](https://github.com/webpack-contrib/css-loader) if you prefer. + +## Load the Roboto fonts (optional) + +The default theme in React Native Paper uses the Roboto font. You can add them to your project following [the instructions on its Google Fonts page](https://fonts.google.com/specimen/Roboto?selection.family=Roboto:100,300,400,500). + +## We're done! + +You can run `webpack-dev-server` to run the webpack server and open your project in the browser. You can add the following script in your `package.json` under the `"scripts"` section to make it easier: + +```json +"web": "webpack-dev-server --open" +``` + +Now you can run `yarn web` to run the project on web. diff --git a/docs/versioned_docs/version-5.x/guides/06-recommended-libraries.md b/docs/versioned_docs/version-5.x/guides/06-recommended-libraries.md new file mode 100644 index 0000000000..e70157ca1d --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/06-recommended-libraries.md @@ -0,0 +1,40 @@ +--- +title: Recommended Libraries +--- + +# Recommended Libraries + +Our mission is to provide a full suite of well-integrated components built with Material Design in mind. However, many components already have better well maintained implementations. + +Here are some of the libraries we recommend: + +## Tabs + +[react-native-community/react-native-tab-view](https://github.com/react-native-community/react-native-tab-view) +Material Design themed [swipeable tabs](https://material.io/design/components/tabs.html), maintained by [@satya164](https://twitter.com/satya164) and [@mosdnk](https://twitter.com/mosdnk). + +[react-native-paper-tabs](https://github.com/web-ridge/react-native-paper-tabs) +Material Design themed [swipeable tabs](https://material.io/design/components/tabs.html) for React Native Paper, maintained by [@RichardLindhout](https://twitter.com/RichardLindhout) + +## Bottom sheet + +[osdnk/reanimated-bottom-sheet](https://github.com/osdnk/react-native-reanimated-bottom-sheet) +An implementation of the [bottom sheet behaviour](https://material.io/design/components/sheets-bottom.html), maintained by [@mosdnk](https://twitter.com/mosdnk). + +[gorhom/react-native-bottom-sheet](https://github.com/gorhom/react-native-bottom-sheet) +An implementation of the [bottom sheet behaviour](https://material.io/design/components/sheets-bottom.html), maintained by [@Gorhom](https://twitter.com/Gorhom). + + +## Date Picker +[web-ridge/react-native-paper-dates](https://github.com/web-ridge/react-native-paper-dates) +Material Design themed [date picker](https://material.io/components/date-pickers), maintained by [@RichardLindhout](https://twitter.com/RichardLindhout) + +[react-native-community/react-native-datetimepicker](https://github.com/react-native-community/react-native-datetimepicker) + +## Time Picker +[web-ridge/react-native-paper-dates](https://github.com/web-ridge/react-native-paper-dates) +Material Design themed [time picker](https://material.io/components/time-pickers), maintained by [@RichardLindhout](https://twitter.com/RichardLindhout) + +## System Colors +[pchmn/expo-material3-theme](https://github.com/pchmn/expo-material3-theme) +Retrieve Material 3 system colors from Android 12+ devices \ No newline at end of file diff --git a/docs/versioned_docs/version-5.x/guides/07-contributing.mdx b/docs/versioned_docs/version-5.x/guides/07-contributing.mdx new file mode 100644 index 0000000000..2861043dc3 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/07-contributing.mdx @@ -0,0 +1,7 @@ +--- +title: Contributing +--- + +import Contributing from '../../../../CONTRIBUTING.md'; + + diff --git a/docs/versioned_docs/version-5.x/guides/08-theming-with-react-navigation.md b/docs/versioned_docs/version-5.x/guides/08-theming-with-react-navigation.md new file mode 100644 index 0000000000..197d2bfa31 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/08-theming-with-react-navigation.md @@ -0,0 +1,356 @@ +--- +title: Theming with React Navigation +--- + +# Theming with React Navigation + +In this guide, we will look into how to apply theming for an application using React Native Paper and React Navigation at the same time. + +Offering different theme options, especially dark/light ones, has become increasingly a standard requirement of the modern mobile application. Fortunately, both React Navigation and React Native Paper support configurable theming out-of-the-box. +But how to make them work together? + +## Themes adaptation + +### Material Design 2 + +Fortunately, in Material Design 2, both React Navigation and React Native Paper offer very similar API when it comes to theming and theme color structure. It's possible to import them in light and dark variants from both. + +```js +import { + DarkTheme as NavigationDarkTheme, + DefaultTheme as NavigationDefaultTheme, +} from '@react-navigation/native'; + +import { + MD2LightTheme, + MD2DarkTheme, +} from 'react-native-paper'; +``` + +### Material Design 3 + +From v5, React Native Paper theme colors structure follows the Material Design 3 (known as Material You) colors system, which differs significantly from both the previous Paper's theme and React Navigation theme. + +However, to simplify adapting React Navigation theme colors, to use the ones from React Native Paper, it's worth using a utility called `adaptNavigationTheme` – it accepts navigation-compliant themes in both modes and returns their equivalents adjusted to Material Design 3. + +```ts +import { + DarkTheme as NavigationDarkTheme, + DefaultTheme as NavigationDefaultTheme, +} from '@react-navigation/native'; +import { adaptNavigationTheme } from 'react-native-paper'; + +const { LightTheme, DarkTheme } = adaptNavigationTheme({ + reactNavigationLight: NavigationDefaultTheme, + reactNavigationDark: NavigationDarkTheme, +}); +``` + +Library exports also Material Design 3 themes in both modes: + +```js +import { + MD3LightTheme, + MD3DarkTheme, +} from 'react-native-paper'; +``` + +## Combining theme objects + +Both libraries require a wrapper to be used at the entry point of the application. +React Navigation exposes `NavigationContainer`, which ensures that navigation works correctly and accepts `theme` as an optional property. Read more about setting up navigation [here](https://reactnavigation.org/docs/getting-started/). +For React Native Paper theme to work, we need to use `PaperProvider` also at the application's entry point. + +```js +import { NavigationContainer } from '@react-navigation/native'; +import { createStackNavigator } from '@react-navigation/stack'; +import { TouchableOpacity } from 'react-native'; +import { + Card, + Title, + Paragraph, + List, + PaperProvider, +} from 'react-native-paper'; + +const Stack = createStackNavigator(); + +const HomeScreen = ({ navigation }) => ( + + navigation?.push('Details', { + title, + content, + }) + } + > + + + {title} + {content} + + + +); + +const DetailsScreen = (props) => { + const { title, content } = props?.route?.params; + return ( + + {title} + + + ); +}; + +export default function App() { + return ( + + + + + + + + + ); +} +``` + + + +Our goal here is to combine those two themes, so that we could control the theme for the entire application from a single place. + +To make things easier we can use [deepmerge](https://www.npmjs.com/package/deepmerge) package. We can install it with: + +```bash npm2yarn +npm install deepmerge +``` + +### Material Design 2 + +```js +import { + NavigationContainer, + DarkTheme as NavigationDarkTheme, + DefaultTheme as NavigationDefaultTheme, +} from '@react-navigation/native'; +import { + MD2DarkTheme, + MD2LightTheme, +} from 'react-native-paper'; +import merge from 'deepmerge'; + +const CombinedDefaultTheme = merge(MD2LightTheme, NavigationDefaultTheme); +const CombinedDarkTheme = merge(MD2DarkTheme, NavigationDarkTheme); +``` + +### Material Design 3 + +```js +import { + NavigationContainer, + DarkTheme as NavigationDarkTheme, + DefaultTheme as NavigationDefaultTheme, +} from '@react-navigation/native'; +import { + MD3DarkTheme, + MD3LightTheme, + adaptNavigationTheme, +} from 'react-native-paper'; +import merge from 'deepmerge'; + +const { LightTheme, DarkTheme } = adaptNavigationTheme({ + reactNavigationLight: NavigationDefaultTheme, + reactNavigationDark: NavigationDarkTheme, +}); + +const CombinedDefaultTheme = merge(MD3LightTheme, LightTheme); +const CombinedDarkTheme = merge(MD3DarkTheme, DarkTheme); +``` + +Alternatively, we could merge those themes using vanilla JavaScript: + +### Material Design 2 + +```js +const CombinedDefaultTheme = { + ...MD2LightTheme, + ...NavigationDefaultTheme, + colors: { + ...MD2LightTheme.colors, + ...NavigationDefaultTheme.colors, + }, +}; +const CombinedDarkTheme = { + ...MD2DarkTheme, + ...NavigationDarkTheme, + colors: { + ...MD2DarkTheme.colors, + ...NavigationDarkTheme.colors, + }, +}; +``` + +### Material Design 3 + +```js +const { LightTheme, DarkTheme } = adaptNavigationTheme({ + reactNavigationLight: NavigationDefaultTheme, + reactNavigationDark: NavigationDarkTheme, +}); + +const CombinedDefaultTheme = { + ...MD3LightTheme, + ...LightTheme, + colors: { + ...MD3LightTheme.colors, + ...LightTheme.colors, + }, +}; +const CombinedDarkTheme = { + ...MD3DarkTheme, + ...DarkTheme, + colors: { + ...MD3DarkTheme.colors, + ...DarkTheme.colors, + }, +}; +``` + +## Passing theme with Providers + +After combining the themes, we will be able to control theming in both libraries from a single source, which will come in handy later. + +Next, we need to pass merged themes into the Providers. For this part, we use the dark one - `CombinedDarkTheme`. + +```js +const Stack = createStackNavigator(); + +export default function App() { + return ( + + + + + + + + + ); +} +``` + +## Customizing theme + +We don't need to limit ourselves to the themes offered by the libraries' default. Both packages allow for custom themes to be applied. +You can learn all about it in their documentation: + +- [Theming in React Navigation](https://reactnavigation.org/docs/themes/) +- [Theming in React Native Paper](https://callstack.github.io/react-native-paper/docs/guides/theming) + +## React Context for theme customization + +Now, we wouldn't want to stay on dark theme forever, which is why we need to gain the ability to control theme dynamically. A bit of state management is needed for this purpose. + +React Context proves itself very useful in handling cross-cutting concerns like global theme handling, so we will use just that. + +## Creating Context + +First, we define our Context. + +```js +import React from 'react'; + +export const PreferencesContext = React.createContext({ + toggleTheme: () => {}, + isThemeDark: false, +}); +``` + +## Using Context + +Context Provider should be imported also at the entry point, as we want it to wrap the whole app, for the theme values to be accessible at every component that we have. + +```js +import React from 'react'; +import { PreferencesContext } from './PreferencesContext'; + +const Stack = createStackNavigator(); + +export default function App() { + const [isThemeDark, setIsThemeDark] = React.useState(false); + + let theme = isThemeDark ? CombinedDarkTheme : CombinedDefaultTheme; + + const toggleTheme = React.useCallback(() => { + return setIsThemeDark(!isThemeDark); + }, [isThemeDark]); + + const preferences = React.useMemo( + () => ({ + toggleTheme, + isThemeDark, + }), + [toggleTheme, isThemeDark] + ); + + return ( + // Context is wired into the local state of our main component, so that its values could be propagated throughout the entire application + + + + + + + + + + + ); +} +``` + +Now that the Context is available at every component, all we need to do is import it. Next, provide the user with some UI element to control changing the theme. We will use `Paper`'s [Switch](https://callstack.github.io/react-native-paper/docs/components/Switch) for this purpose. + +```js +import React from 'react'; +import { useTheme, Appbar, TouchableRipple, Switch } from 'react-native-paper'; +import { PreferencesContext } from './PreferencesContext'; + +const Header = ({ scene }) => { + const theme = useTheme(); + const { toggleTheme, isThemeDark } = React.useContext(PreferencesContext); + + return ( + + + + + ); +}; +``` + +And now you can switch between light and dark theme! + +![paperGuide1](../../../static/screenshots/themingWithReactNavigationDarkLightSwitch.gif) + +Thanks to the linking of themes that we did earlier, switching themes can be controlled with only one piece of state. + +React Native Paper components will automatically use the provided theme thanks to the `PaperProvider` that is wrapped around the entry point of our application, but we can also access theme values manually with `useTheme` hook, +exposed by the library. You can see how it's done in the `Header` component code above. + +If light/dark themes are not enough for your use case, you can learn more about creating Material Design themes [here](https://material.io/design/material-theming/implementing-your-theme.html#color). +On `main` branch of the example app, you will find implemented [Menu](https://callstack.github.io/react-native-paper/docs/components/Menu) component, which allows you to choose a few custom themes. Inspecting code in `utils` and `Header` may give you some idea of how to use your own themes with `Paper`, in addition to dedicated [docs](https://callstack.github.io/react-native-paper/docs/components/Menu). + +Read more about integrating `Paper` with `React Navigation` in a brilliant [article](https://reactnavigation.org/blog/2020/01/29/using-react-navigation-5-with-react-native-paper/) by [@trensik](https://twitter.com/trensik) diff --git a/docs/versioned_docs/version-5.x/guides/09-bottom-navigation.md b/docs/versioned_docs/version-5.x/guides/09-bottom-navigation.md new file mode 100644 index 0000000000..21776718c9 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/09-bottom-navigation.md @@ -0,0 +1,248 @@ +--- +title: Using BottomNavigation with React Navigation +--- + +:::caution +The `createMaterialBottomTabNavigator` has been deprecated as of `react-native-paper@5.14.0`. Instead, use `@react-navigation/bottom-tabs` version `7.x` or later, combined with `BottomNavigation.Bar` to achieve a Material Design look. + +For implementation details, see the [dedicated example](https://callstack.github.io/react-native-paper/docs/components/BottomNavigation/BottomNavigationBar#with-react-navigation). +::: + +A material-design themed tab bar on the bottom of the screen that lets you switch between different routes with animation. Routes are lazily initialized - their screen components are not mounted until they are first focused. + +This wraps the [`BottomNavigation`](https://callstack.github.io/react-native-paper/docs/components/BottomNavigation/) component from `react-native-paper`, however if you [configure the Babel plugin](https://callstack.github.io/react-native-paper/docs/guides/getting-started/), it won't include the whole library in your bundle. + + + +:::info +To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](https://reactnavigation.org/docs/getting-started): +::: + +> 👉 For a complete example please visit `createMaterialBottomTabNavigator` [snack](https://snack.expo.dev/@react-native-paper/creatematerialbottomtabnavigator) + +## API Definition + +To use this tab navigator, import it from `react-native-paper/react-navigation`: + +```js +import { createMaterialBottomTabNavigator } from 'react-native-paper/react-navigation'; + +const Tab = createMaterialBottomTabNavigator(); + +function MyTabs() { + return ( + + + + + ); +} +``` + +> 👉 For a complete usage guide please visit [Tab Navigation](https://reactnavigation.org/docs/tab-based-navigation/) + +### Props + +The `Tab.Navigator` component accepts following props: + +#### `id` + +Optional unique ID for the navigator. This can be used with [`navigation.getParent`](https://reactnavigation.org/docs/navigation-prop#getparent) to refer to this navigator in a child navigator. + +#### `initialRouteName` + +The name of the route to render on first load of the navigator. + +#### `screenOptions` + +Default options to use for the screens in the navigator. + +#### `backBehavior` + +This controls what happens when `goBack` is called in the navigator. This includes pressing the device's back button or back gesture on Android. + +It supports the following values: + +- `firstRoute` - return to the first screen defined in the navigator (default) +- `initialRoute` - return to initial screen passed in `initialRouteName` prop, if not passed, defaults to the first screen +- `order` - return to screen defined before the focused screen +- `history` - return to last visited screen in the navigator; if the same screen is visited multiple times, the older entries are dropped from the history +- `none` - do not handle back button + +#### `shifting` + +Whether the shifting style is used, the active tab icon shifts up to show the label and the inactive tabs won't have a label. + +By default, this is `true` when you have more than 3 tabs. Pass `shifting={false}` to explicitly disable this animation, or `shifting={true}` to always use this animation. + +#### `labeled` + +Whether to show labels in tabs. When `false`, only icons will be displayed. + +#### `activeColor` + +Custom color for icon and label in the active tab. + +#### `inactiveColor` + +Custom color for icon and label in the inactive tab. + +#### `barStyle` + +Style for the bottom navigation bar. You can pass custom background color here: + +```js + + {/* ... */} + +``` + +If you have a translucent navigation bar on Android, you can also set a bottom padding here: + +```js + + {/* ... */} + +``` + +#### `theme` + +Enables the customization of default theme attributes (e.g. colors) or facilitates the utilization of a personalized custom theme. + +### Options + +The following [options](https://reactnavigation.org/docs/screen-options) can be used to configure the screens in the navigator: + +#### `title` + +Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`. + +#### `tabBarIcon` + +Function that given `{ focused: boolean, color: string }` returns a React.Node, to display in the tab bar. + +#### `tabBarColor`
In v5.x works only with theme version 2.
+ +Color for the tab bar when the tab corresponding to the screen is active. Used for the ripple effect. This is only supported when `shifting` is `true`. + +#### `tabBarLabel` + +Title string of a tab displayed in the tab bar. When undefined, scene `title` is used. To hide, see `labeled` option in the previous section. + +#### `tabBarBadge` + +Badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text. + +#### `tabBarAccessibilityLabel` + +Accessibility label for the tab button. This is read by the screen reader when the user taps the tab. It's recommended to set this if you don't have a label for the tab. + +#### `tabBarTestID` + +ID to locate this tab button in tests. + +### Events + +The navigator can [emit events](https://reactnavigation.org/docs/navigation-events) on certain actions. Supported events are: + +#### `tabPress` + +This event is fired when the user presses the tab button for the current screen in the tab bar. By default a tab press does several things: + +- If the tab is not focused, tab press will focus that tab +- If the tab is already focused: + - If the screen for the tab renders a scroll view, you can use [`useScrollToTop`](https://reactnavigation.org/docs/use-scroll-to-top) to scroll it to top + - If the screen for the tab renders a stack navigator, a `popToTop` action is performed on the stack + +To prevent the default behavior, you can call `event.preventDefault`: + +```js +React.useEffect(() => { + const unsubscribe = navigation.addListener('tabPress', (e) => { + // Prevent default behavior + + e.preventDefault(); + // Do something manually + // ... + }); + + return unsubscribe; +}, [navigation]); +``` + +### Helpers + +The tab navigator adds the following methods to the navigation prop: + +#### `jumpTo` + +Navigates to an existing screen in the tab navigator. The method accepts following arguments: + +- `name` - _string_ - Name of the route to jump to. +- `params` - _object_ - Screen params to pass to the destination route. + + + +```js +navigation.jumpTo('Profile', { name: 'Michaś' }); +``` + +## Example + +```js +import { createMaterialBottomTabNavigator } from 'react-native-paper/react-navigation'; +import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons'; + +const Tab = createMaterialBottomTabNavigator(); + +function MyTabs() { + return ( + + ( + + ), + }} + /> + ( + + ), + }} + /> + ( + + ), + }} + /> + + ); +} +``` diff --git a/docs/versioned_docs/version-5.x/guides/09-react-navigation.md b/docs/versioned_docs/version-5.x/guides/09-react-navigation.md new file mode 100644 index 0000000000..d9227cfb2b --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/09-react-navigation.md @@ -0,0 +1,281 @@ +--- +title: Integrate AppBar with React Navigation +--- + +# Integrate AppBar with react-navigation + +## Prerequisites + + - `react-native-paper` + - `react-navigation` + +We assume that you have already installed the mentioned libraries above, otherwise please check out the guides below. + + [React Native Paper - Getting Started](https://callstack.github.io/react-native-paper/docs/guides/getting-started) + + [React Navigation - Getting Started](https://reactnavigation.org/docs/getting-started/) + +## Stack Navigator + +We will start with `react-navigation` by creating a basic navigation stack. Stack navigator gives us a possibility of transition between screens in our app and manage navigation's history. In a simple scenario where there is only one stack navigator present in the app, it resembles a navigation state in a browser. +Screens are pushed and popped from the stack while the user navigates to a new screen or go back to the previous one. + +Let's create two screens. A main screen named `Home` and details screen named `Details`. + +```js +import 'react-native-gesture-handler'; +import React from 'react'; +import { NavigationContainer } from '@react-navigation/native'; +import { createStackNavigator } from '@react-navigation/stack'; + +const Stack = createStackNavigator(); + +export default function App() { + return ( + + + + + + + ); +} +``` + +At the moment our navigation stack contains two screens and will render `HomeScreen` or `DetailsScreen` components according to the current navigation state. We have not implemented those components yet, so let's do this now: + +```js +import React from 'react'; +import {View, Text, Button, StyleSheet} from 'react-native'; + +function HomeScreen() { + return ( + + Home Screen + + ); +} + +function DetailsScreen() { + return ( + + Details Screen + + ); +} + +const style = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, +}); +``` + +Once we have finished implementing the components, we can run the app and check how Stack looks like. + + + +To navigate from `HomeScreen` to `DetailsScreen` we can use the navigation object provided by `Stack.Screen` component. Every component rendered by `Stack.Screen` has an access to the navigation object via props. Let's modify our `HomeScreen` component: + +```js +import { Button } from 'react-native-paper'; + +function HomeScreen({ navigation }) { + return ( + + Home Screen + + + ); +} + +const style = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, +}); +``` + +Our result: + + + +As you can see, we can already navigate between two screens. In the next steps, we will show you how to use Paper's `AppBar` instead of the default header. + +### Adding `AppBar` + +We can customize Stack's header by passing custom component: + +```js +export default function App() { + return ( + + , + }}> + + + + + ); +} +``` + +Now we will implement `CustomNavigationBar` using `AppBar` component: + +```js +import { Appbar } from 'react-native-paper'; + +export default function CustomNavigationBar() { + return ( + + + + ); +} +``` + +Current implementation of the `CustomNavigationBar` is simple - we just render a title inside of it, however it's hardcoded "My awesome app" text, so let's adjust it. +To automatically get the correct `title` for the screen, we're going to take the advantage of `getHeaderTitle` helper available in `@react-navigation/elements` in the following way: + +```js +import { Appbar } from 'react-native-paper'; +import { getHeaderTitle } from '@react-navigation/elements'; + +export default function CustomNavigationBar({ route, options }) { + const title = getHeaderTitle(options, route.name); + + return ( + + + + ); +} +``` + +You may notice there is no way to go back to the previous screen, because the back button is not visible in the header. Let's add it now and let's make sure it's visible on all Stack's screens except `Home` screen. + +In order to achieve it, we firstly check, if the navigation bar receives a `back` prop. If it has, it means there is another screen on the stack beneath the current screen and we should render the back arrow button in such a case. + +```js +import { Appbar } from 'react-native-paper'; +import { getHeaderTitle } from '@react-navigation/elements'; + +export default function CustomNavigationBar({ navigation, route, options, back }) { + const title = getHeaderTitle(options, route.name); + + return ( + + {back ? : null} + + + ); +} +``` + + + +### Adding more items to `Appbar` + +Another interesting pattern that can be implemented with `react-native-paper` and `react-navigation` is a "menu" button. Thanks to the `Menu` component we can add a nice looking pop-up to our `Appbar`. To implement this feature we need to make a couple of changes in `CustomNavigationBar`: +- Render a `Menu` component +- Pass `Appbar.Action` to the anchor prop +- Add a state to control `Menu` visibility + +:::note +To have properly working `Menu` component, remember to wrap your root component with the `PaperProvider`: + +```js +import { PaperProvider } from 'react-native-paper'; + +// ... + + + + , + }}> + + + + + +``` +::: + +We also want the menu to appear only on `HomeScreen`, which means we will render it conditionally based on the `back` prop. + +```js +import React from 'react'; +import { Appbar, Menu } from 'react-native-paper'; +import { getHeaderTitle } from '@react-navigation/elements'; + +export default function CustomNavigationBar({ + navigation, + route, + options, + back, +}) { + const [visible, setVisible] = React.useState(false); + const openMenu = () => setVisible(true); + const closeMenu = () => setVisible(false); + + const title = getHeaderTitle(options, route.name); + + return ( + + {back ? : null} + + {!back ? ( + + }> + { + console.log('Option 1 was pressed'); + }} + title="Option 1" + /> + { + console.log('Option 2 was pressed'); + }} + title="Option 2" + /> + { + console.log('Option 3 was pressed'); + }} + title="Option 3" + disabled + /> + + ) : null} + + ); +} +``` + +Final result: + + + +That's all we need! We have app bar that contains everything we need to navigate through screens and access an additional menu on the main screen. As you can see, with Material design `Appbar` provided by `react-native-paper` used together with `react-navigation` we can easily create an app that looks and works great. + +Grab the Expo [snack](https://snack.expo.dev/@react-native-paper/integrate-appbar-with-react-navigation) if you want to check the whole code! diff --git a/docs/versioned_docs/version-5.x/guides/10-migration-guide-to-5.0.md b/docs/versioned_docs/version-5.x/guides/10-migration-guide-to-5.0.md new file mode 100644 index 0000000000..670b9f7ab5 --- /dev/null +++ b/docs/versioned_docs/version-5.x/guides/10-migration-guide-to-5.0.md @@ -0,0 +1,656 @@ +--- +title: Introducing v5 with Material You +--- + +React Native Paper v5 is all about adopting the new Material Design 3 aka Material You. It was released in October 2021 after intense work and effort to make Material You follow a more expressive approach to design. + +Paper now supports both Material Design 2 and 3 through the configuration described in [Versioning](#versioning) and is compatible with a handful of API changes. + +# Migration guide to Material You 5.0 + +Version 5.0 brings support for the next Material Design iteration branded as Material You (in fact being Material Design v3 or in short MD3) into the `react-native-paper` library. All the components were refined according to the official [design kit on figma](https://www.figma.com/community/file/1035203688168086460) and adjusted in terms of visuals by changes in colors, typography and animations. + +Below you can find the most important information about the components whose API may have changed API has been changed due to supporting new props, renaming existing ones or some deprecations. Hopefully, based on the presented required changes, migration to the latest version should be smooth. Enjoy! + +### Installation + +* The `v5` has been oficially released as a stable version, which means it will be installed by default from the `npm`. In order to do that, open a Terminal in your project's folder and run: + +```bash npm2yarn +npm install react-native-paper +``` + +* From `v5` there is a need to install [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe area. + +```bash npm2yarn +npm install react-native-safe-area-context +``` + +Additionaly for `iOS` platform there is a requirement to link the native parts of the library: + +```bash +npx pod-install +``` + +## Theming + +### Versioning + +Introducing Material You (MD3) into `react-native-paper` doesn't mean dropping previous Material Design (MD2)! On the contrary, both of them will be supported, however, not simultaneously. To specify which design system components should follow in the app, there is a newly created property in [the theme](https://callstack.github.io/react-native-paper/docs/guides/theming#theme-properties) named `version` that accepts one of two values: + +* 3(default) new Material You (MD3), +* 2 - previous Material Design (MD2). + +```js +theme: { + /* ... */ + version: 3 | 2 +} +``` + +Read more about using Material Design 2 in our [Material Design 2 theming guide](https://callstack.github.io/react-native-paper/docs/guides/theming#material-design-2) + +### Colors + +New theme introduces a new color palette along with new namings reflecting design color tokens, but written in camel case. Palette contains a set of five key colors, where primary, secondary and tertiary are classified into accent colors. The second group of colors is neutral and neutral variant colors used for defining surface or background roles as well as specifying high and medium emphasis text and icons. Additionally, the color system includes a semantic color role for error. + +Each accent and error colors has a group of related tones. The tones are mapped to roles that create contrast and visual interest when applied to elements in the UI. + +:::note +Dynamic colors are not supported yet +::: + +![color-palette](../../../static/migration/color-palette.png) + +Colors theme structure should follow the default palette and contain the following properties: + +```js +theme: { + /* ... */ + colors: { + primary, + primaryContainer, + secondary, + secondaryContainer, + tertiary, + tertiaryContainer, + surface, + surfaceVariant, + surfaceDisabled, + background, + error, + errorContainer, + onPrimary, + onPrimaryContainer, + onSecondary, + onSecondaryContainer, + onTertiary, + onTertiaryContainer, + onSurface, + onSurfaceVariant, + onSurfaceDisabled, + onError, + onErrorContainer, + onBackground, + outline, + shadow, + inverseOnSurface, + inverseSurface, + inversePrimary, + backdrop, + elevation: { + level0, + level1, + level2, + level3, + level4, + level5 + } + } +} +``` + +👉 You can find more about color on the [Material You website](https://m3.material.io/styles/color/the-color-system/key-colors-tones) + +## Typography + +A new way of approaching typography introduces one component `` which accepts prop `variant`. Variant defines appropriate text styles for type role and its size. The updated type scale organizes styles into five roles that are named to describe their purposes: Display, Headline, Title, Label and Body along with three display styles large, medium, and small. In total, there are fifteen variants that are MD3 compliant and are reflecting design typography tokens written in camel case. + +:::info +If any component uses Paper's `Text` component, without specified variant, then `default` variant is applied. +::: + +```js +Display Large +Display Medium +Display small + +Headline Large +Headline Medium +Headline Small + +Title Large +Title Medium +Title Small + +Body Large +Body Medium +Body Small + +Label Large +Label Medium +Label Small + ``` + +Take a look at the suggested replacement diff: + + ```diff +- Headline ++ Headline + +- Title ++ Title + +- Subheading ++ Subheading + +- Paragraph ++ Paragraph + +- Caption ++ Caption + ``` + + +👉 You can find more about typography on the [Material You website](https://m3.material.io/styles/typography/overview) + +### Configure fonts + +The existing utility called `configureFonts` was adjusted to help users configure their theme fonts in both version, that's why that function, as of today, is going to accept the object with the follwing properties as an argument: + +```ts +configureFonts(params) +``` + +Parameters: + +| NAME | TYPE | REQUIRED | +| ----------- | ----------- | ----------- | +| params | object | No | + +Valid `params` keys are: + + * `config` ([MD2FontsConfig](https://github.com/callstack/react-native-paper/blob/main/src/styles/fonts.tsx#L63) | [MD3FontsConfig](https://github.com/callstack/react-native-paper/blob/main/src/styles/fonts.tsx#L67)) - fonts config object appropriate to the MD version + * `isV3` (boolean) - whether adjusting theme fonts for v3. Default it true. + +To use your current font config from v2 and migrate to v3 there are two requirements: +* the font config previously passed directly into function has to be passed into the params object property called `config` +* the params object property `isV3` has to be set to `false` + +```diff +- configureFonts(fontConfig) ++ configureFonts({config: fontConfig, isV3: false}) +``` + +:::tip +If you want to check how to use `configureFonts` on MD3, check the [Fonts](https://callstack.github.io/react-native-paper/docs/guides/fonts.html) guide. +::: + +## Components + +### Appbar (Top app bar) + +`Appbar` and `Appbar.Header` in the latest version can be used in four various modes due to new prop `mode`: + +* `small` - Appbar with default height (64) (default), +* `medium` - Appbar with medium height (112), +* `large` - Appbar with large height (152), +* `center-aligned` - Appbar with default height (64) and center-aligned title. + +```js + + /* ... */ + +``` + +To make it easier for users to build the `BottomBar`, formed on the `Appbar` components, we have added a property `safeAreaInsets`: + +```js + + /* ... */ + +``` + +It's worth noting that by default the theme version 3 `Appbar` and `Appbar.Header` don't have a shadow. However, it can be added by passing prop `elevated` into the component: + +```js + + /* ... */ + +``` + +#### Appbar.Action + +`Appbar.Action` received new prop `isLeading`, which defines whether it's the leading button and should be placed at the beginning of the `Appbar`. + +```js + {}} /> +``` + +#### Appbar.Content + +New design guidelines indicate there is no subtitle in `Appbar.Content`, that's why there are two deprecations and the following props won't be supported anymore: `subtitle` and `subtitleStyle`. + +```diff +- ++ +``` + +### Banner, Searchbar and Snackbar + +According to the updates in `Surface` on the top of which `Banner`, `Searchbar` and `Snackbar` are implemented, all three component received `elevation` prop to adjust its value. + +```diff +- Hello ++ Hello +``` + +### BottomNavigation (Navigation bar) + +For the sake of new animation of pill shape, indicating active destination, and assisting icon change from outlined to filled, there are three changes within `navigationState.routes` property items: + +* `color` is deprecated since color is constant and the same for all routes, +* `icon` is renamed to `focusedIcon`, as the name implies, with theme version 3 it's the outline icon used as focused tab icon and with theme version 2 it's a default icon, +* `unfocusedIcon` (optional) is the filled icon used as the unfocused tab icon, compatible with theme version 3. + +:::info +`unfocusedIcon` is optional, if you can't find outline icon equivalent, omit that prop, so `focusedIcon` will be displayed in both active and inactive state. +::: + +```diff +routes: [ +- { key: "album", title: "Album", icon: "image-album", color: "#3F51B5" }, ++ { key: "album", title: "Album", focusedIcon: "image-album" }, +- { key: "library", title: "Library", icon: "inbox", color: "#009688" }, ++ { key: "library", title: "Library", focusedIcon: "inbox", unfocusedIcon: "inbox-outline" }, +- { key: "favorites", title: "Favorites", icon: "heart", color: "#795548" }, ++ { key: "favorites", title: "Favorites", focusedIcon: "heart", unfocusedIcon: "heart-outline; }, +- { key: "purchased", title: "Purchased", icon: "shopping-cart", color: "#607D8B" }, ++ { key: "purchased", title: "Purchased", focusedIcon: "shopping-cart" }, +] +``` + +The `compact` prop was also introduced, working with both themes. It indicates whether tabs should be spread across the entire width, especially in a horizontal mode. + +```js + +``` + +It's worth to mention that default value of prop `shifting` depends on the theme version: +* 3 - it's `false`, +* 2 - it's `true` when there are more than 3 tabs. + +Two additional props that control the scene animation were introduced that control the animation of the tabs when `sceneAnimationEnabled` is `true`: +* `sceneAnimationType: "opacity" | "shifting" | undefined` - defines the animation type for the scene. `shifting` enables a new animation where navigating to a scene will shift it horizontally into view. Both `opacity` and `undefined` have the same effect, fading the scene into view. +* `sceneAnimationEasing` allows specifying a custom easing function for the scene animation. + +![shiftingAnimation](../../../static/screenshots/bottom-navigation-shifting.gif) + +On a final note, please be aware that `BottomNavigation` with theme version 3 doesn't have a shadow. + +### Button + +`Button`'s property `mode` has been expanded with two additional options: +* `elevated` - button with a background color and elevation, used when absolutely necessary e.g. button requires visual separation from a patterned background, +* `container-tonal` - button with a secondary background color, an alternative middle ground between contained and outlined buttons. + +```js +<> + + + +``` + +The property `color` is deprecated, but in its place two new props called `buttonColor` and `textColor` are introduced: +* `buttonColor` - custom button's background color, +* `textColor` - custom button's text color. + +```diff +- ++ +``` + +```diff +- ++ +``` + +Please be aware that along with theme version 3, by default text in the `Button` component isn't uppercased and `contained` button doesn't have any shadow (use then `elevated`). + +### Card + +The `Card` component's property `mode` has been expanded with one additional option called `contained`, which applies to the card's specified background color without any elevation and border. + +```js + +``` + +#### Card.Title + +Since there is no one right way to make a card, there is also no one right way for specifying a title and subtitle variant. Therefore two new props come in handy: + +* `titleVariant` - title text variant defines appropriate text styles for type role and its size. +* `subtitleVariant` - subtitle text variant defines appropriate text styles for type role and its size. + +```js + +``` + +### Checkbox +#### Checkbox.Item + +`Checkbox.Item` similarly to `RadioButton.Item` has been expanded with the prop called `labelVariant`, which defines appropriate text styles for type role and its size. + +```js + +``` + +### Chip + +To properly compose `Chip` component and adjust into required type, there are three new props that will come in handy: + +* `compact` - sets smaller horizontal paddings around the label, useful for `Chip` containing only the label, +* `elevated` - indicating whether `Chip` should be elevated, +* `showSelectedOverlay` - defining whether to display an overlay on a selected button. + +```js +<> + Compact Chip + Elevated Chip + Chip with selected overlay + +``` +### Dialog +#### Dialog.Icon + +`Dialog.Icon` is another freshly added component presenting an icon within a `Dialog`, placed at the top of the content. + +:::caution +It's working only with theme version 3. +::: + +```js + + + + + +``` +### Divider + +`Divider` component received two new props: + +* `bold` - divider is bolded, +* `horizontalInset` - divider has horizontal insets on both sides. + +Additionally prop `inset` was renamed to `leftInset`. + +```diff +- ++ +``` + +### Drawer +#### Drawer.CollapsedItem (Navigation rail) + +`Drawer.CollapsedItem` is a newly created side navigation component that can be used within `Drawer`, representing a destination in the form of an action item with an icon and optionally label. + +:::caution +It's working only with theme version 3. +::: + +```js + + + + +``` + +#### Drawer.Section + +With the latest version, there is a possibility to specify whether `Drawer.Section` should have a separator, in form of `Divider` component, displayed at the end of the section. To adjust it, a new property called `showDivider` was introduced, which by default is `true`: + +```js + + + + +``` + +### FAB + +`FAB`, `AnimatedFAB` and `FAB.Group` in the latest version can be used with four variants and two modes, thanks to two new props: + +* `variant` defines color mappings variant for combinations of container and icon colors. Can be one of: primary (default), secondary, tertiary or surface. + +```js + +``` + +* `mode` specifies whether a button should be flat or elevated: + - `flat` - button without a shadow, + - `elevated` - button with a shadow. + +```js + +``` + +#### FAB + +Additionaly `FAB` may be applied in one of three available sizes, thanks to new prop `size`: + +* `small` - FAB with small height (40), +* `medium` - Appbar with default medium height (56), +* `large` - Appbar with large height (96). + +```js + +``` + +However, if you would like to have your own size of `FAB`, there is a new prop called `customSize`: + +```js + +``` + +Accordingly to introducing `size="small"`, prop `small` was deprecated. + +```diff +- ++ +``` + +#### FAB.Group + +There is also deprecation in one of the `actions` properties, namely `small` prop is deprecated and replaced in favour of the default `size="small"`. + +```diff +- ++ +``` + +Additionally, the action item property previously known as `labelStyle` was renamed to `containerStyle` since it's tied mostly with the container styles. At the same time, `labelStyle` is still available with the new role related to styling item label. + +```diff +- ++ +``` + +### IconButton + +`IconButton` received two new props: + +* `selected` sets alternative combination of icon and container color, + +```js + +``` + +* `containerColor` custom background color of the icon container. + +```js + +``` + +At the same time, the `color` prop was renamed to `iconColor`. + +```diff +- ++ +``` + +### Menu +#### Menu.Item + +`Menu.Item` received two new props: + +* `dense` sets smaller item height for more condensed layout, +* `trailingIcon` which handles displaying an icon at the end of the item row. + +```js + +``` + +At the same time, by analogy to the second new prop, the `icon` prop was renamed to `leadingIcon`. + +```diff +- {}} title="Redo" /> ++ {}} title="Redo" /> +``` + +### RadioButton +##### RadioButton.Item + +`RadioButton.Item` has been expanded with the prop called `labelVariant`, which defines appropriate text styles for type role and its size. + +```js + +``` + +### SegmentedButtons + +`SegmentedButtons` is a completely new component introduced in the latest version. It allows people to select options, switch views, or sort elements. It supports single and multiselect select variant and provide a lot +of customization options. + +![segmentedButtons](../../../static/screenshots/segmentedbuttons.gif) + +```js +const MyComponent = () => { + const [value, setValue] = React.useState(''); + + return ( + + ); +}; +``` + +### Snackbar + +`Snackbar` due to the optional close affordance, in form of `IconButton` (located on the right side of action button), received three new props: + +* `icon` - icon to display when `onIconPress` is defined. Default will be `close` icon. +* `onIconPress` - function to execute on icon button press. The icon button appears only when this prop is specified. +* `iconAccessibilityLabel` - accessibility label for the icon button. + +### Surface + +`Surface` component received one new prop: +* `elevation` - accepts values from `0` to `5` and applies background color and shadows to the `Surface` component. Supports both iOS and Android. + +Previously `elevation` was passed inside the `style` prop. Since it supported not only Android, but also iOS, we decided to extract it from `style` and create a separate `elevation` prop for that. + +```diff +- ++ +``` + +### TextInput +#### TextInput.Icon + +The property `name` was renamed to `icon`, since the scope and type of that prop is much wider than just the icon name – it accepts also the function which receives an object with color and size properties and + +```diff +- ++ +``` + +## Tooltip + +Component displayed upon tapping and holding a screen element or component used to present an informative text label identifying an element, such as a description of its function. + +![tooltip](../../../static/screenshots/tooltips.gif) + + +```js + + {}} /> + +``` + +## Credits + +With this, that’s a wrap. + +The update wouldn't happen without a group of great React Native experts I'm happy to work with. +From this place I would like to thank: +- [Daniel Szczepanik](https://github.com/Drakeoon) for his commitment, effort and collaborative work on adjusting components, +- [Olimpia Zurek](https://github.com/OlimpiaZurek) for her contribution and help, +- [Aleksandra Desmurs-Linczewska](https://github.com/p-syche), [Jan Jaworski](https://github.com/jaworek) and [Kewin Wereszczyński](https://github.com/kwereszczynski) for checking and testing changes as well as providing valuable feedback, +- [Bruno Castro](https://github.com/brunohkbx) for creating a long-awaited `Tooltip` component, +- [Muhammad Hur Ali](https://github.com/hurali97) for various bug fixes and `List` subcomponents adjustments, + +and, last but not least, [Satya Sahoo](https://github.com/satya164) for his mentoring during the process. diff --git a/docs/docs/guides/11-ripple-effect.md b/docs/versioned_docs/version-5.x/guides/11-ripple-effect.md similarity index 100% rename from docs/docs/guides/11-ripple-effect.md rename to docs/versioned_docs/version-5.x/guides/11-ripple-effect.md diff --git a/docs/docs/guides/_category_.json b/docs/versioned_docs/version-5.x/guides/_category_.json similarity index 100% rename from docs/docs/guides/_category_.json rename to docs/versioned_docs/version-5.x/guides/_category_.json diff --git a/docs/docs/showcase.mdx b/docs/versioned_docs/version-5.x/showcase.mdx similarity index 78% rename from docs/docs/showcase.mdx rename to docs/versioned_docs/version-5.x/showcase.mdx index db58df8f24..7024ab018d 100644 --- a/docs/docs/showcase.mdx +++ b/docs/versioned_docs/version-5.x/showcase.mdx @@ -2,7 +2,7 @@ title: Showcase --- -import Showcase from '../src/components/Showcase.tsx'; +import Showcase from '@site/src/components/Showcase.tsx'; # Who's using Paper? diff --git a/docs/versioned_docs/version-6.x/components/ActivityIndicator.mdx b/docs/versioned_docs/version-6.x/components/ActivityIndicator.mdx new file mode 100644 index 0000000000..51fcd3899d --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/ActivityIndicator.mdx @@ -0,0 +1,96 @@ +--- +title: ActivityIndicator +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Activity indicator is used to present progress of some activity in the app. +It can be used as a drop-in replacement for the ActivityIndicator shipped with React Native. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ActivityIndicator, Palette } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### animating + +
+ + + +
+ +### color + +
+ + + +
+ +### size + +
+ + + +
+ +### hidesWhenStopped + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Appbar/Appbar.mdx b/docs/versioned_docs/version-6.x/components/Appbar/Appbar.mdx new file mode 100644 index 0000000000..b9f52f72ae --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Appbar/Appbar.mdx @@ -0,0 +1,174 @@ +--- +title: Appbar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display action items in a bar. It can be placed at the top or bottom. +The top bar usually contains the screen title, controls such as navigation buttons, menu button etc. +The bottom bar usually provides access to a drawer and up to four actions. + +By default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead. +See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more informations + + + + + + + +## Usage +### Top bar +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} /> + + {}} /> + {}} /> + +); + +export default MyComponent; +``` + +### Bottom bar +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { Appbar, FAB, useTheme } from 'react-native-paper'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; + +const BOTTOM_APPBAR_HEIGHT = 80; +const MEDIUM_FAB_HEIGHT = 56; + +const MyComponent = () => { + const { bottom } = useSafeAreaInsets(); + const theme = useTheme(); + + return ( + + {}} /> + {}} /> + {}} /> + {}} /> + {}} + style={[ + styles.fab, + { top: (BOTTOM_APPBAR_HEIGHT - MEDIUM_FAB_HEIGHT) / 2 }, + ]} + /> + + ); +}; + +const styles = StyleSheet.create({ + bottom: { + backgroundColor: 'aquamarine', + position: 'absolute', + left: 0, + right: 0, + bottom: 0, + }, + fab: { + position: 'absolute', + right: 16, + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dark + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### elevated Available in v5.x with theme version 3 + +
+ + + +
+ +### safeAreaInsets + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Appbar/AppbarAction.mdx b/docs/versioned_docs/version-6.x/components/Appbar/AppbarAction.mdx new file mode 100644 index 0000000000..d4b3fe6ca1 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Appbar/AppbarAction.mdx @@ -0,0 +1,134 @@ +--- +title: Appbar.Action +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display an action item in the appbar. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; +import { Platform } from 'react-native'; + +const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical'; + +const MyComponent = () => ( + + + {}} /> + {}} /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### color + +
+ + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### disabled + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### isLeading Available in v5.x with theme version 3 + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Appbar/AppbarBackAction.mdx b/docs/versioned_docs/version-6.x/components/Appbar/AppbarBackAction.mdx new file mode 100644 index 0000000000..1bddbc1a47 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Appbar/AppbarBackAction.mdx @@ -0,0 +1,101 @@ +--- +title: Appbar.BackAction +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display a back button in the appbar. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### color + +
+ + + +
+ +### size + +
+ + + +
+ +### disabled + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Appbar/AppbarContent.mdx b/docs/versioned_docs/version-6.x/components/Appbar/AppbarContent.mdx new file mode 100644 index 0000000000..f0cd732f9e --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Appbar/AppbarContent.mdx @@ -0,0 +1,129 @@ +--- +title: Appbar.Content +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display a title in an appbar. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => ( + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### titleRef + +
+ + + +
+ +### onPress + +
+ + + +
+ +### disabled + +
+ + + +
+ +### color + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Appbar/AppbarHeader.mdx b/docs/versioned_docs/version-6.x/components/Appbar/AppbarHeader.mdx new file mode 100644 index 0000000000..131dbdec53 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Appbar/AppbarHeader.mdx @@ -0,0 +1,125 @@ +--- +title: Appbar.Header +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to use as a header at the top of the screen. +It can contain the screen title, controls such as navigation buttons, menu button etc. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Appbar } from 'react-native-paper'; + +const MyComponent = () => { + const _goBack = () => console.log('Went back'); + + const _handleSearch = () => console.log('Searching'); + + const _handleMore = () => console.log('Shown more'); + + return ( + + + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dark + +
+ + + +
+ +### statusBarHeight + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### elevated Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Avatar/AvatarIcon.mdx b/docs/versioned_docs/version-6.x/components/Avatar/AvatarIcon.mdx new file mode 100644 index 0000000000..8d2cb9f401 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Avatar/AvatarIcon.mdx @@ -0,0 +1,81 @@ +--- +title: Avatar.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Avatars can be used to represent people in a graphical way. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar } from 'react-native-paper'; + +const MyComponent = () => ( + +); +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Avatar/AvatarImage.mdx b/docs/versioned_docs/version-6.x/components/Avatar/AvatarImage.mdx new file mode 100644 index 0000000000..79c7c9bb0a --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Avatar/AvatarImage.mdx @@ -0,0 +1,122 @@ +--- +title: Avatar.Image +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Avatars can be used to represent people in a graphical way. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar } from 'react-native-paper'; + +const MyComponent = () => ( + +); +export default MyComponent +``` + + + ## Props + + + + +
+ +### source (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### style + +
+ + + +
+ +### onError + +
+ + + +
+ +### onLayout + +
+ + + +
+ +### onLoad + +
+ + + +
+ +### onLoadEnd + +
+ + + +
+ +### onLoadStart + +
+ + + +
+ +### onProgress + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Avatar/AvatarText.mdx b/docs/versioned_docs/version-6.x/components/Avatar/AvatarText.mdx new file mode 100644 index 0000000000..ec1379adf4 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Avatar/AvatarText.mdx @@ -0,0 +1,97 @@ +--- +title: Avatar.Text +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Avatars can be used to represent people in a graphical way. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar } from 'react-native-paper'; + +const MyComponent = () => ( + +); +``` + + + ## Props + + + + +
+ +### label (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Badge.mdx b/docs/versioned_docs/version-6.x/components/Badge.mdx new file mode 100644 index 0000000000..77326a9bf0 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Badge.mdx @@ -0,0 +1,96 @@ +--- +title: Badge +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Badges are small status descriptors for UI elements. +A badge consists of a small circle, typically containing a number or other short set of characters, that appears in proximity to another object. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Badge } from 'react-native-paper'; + +const MyComponent = () => ( + 3 +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### visible + +
+ + + +
+ +### children + +
+ + + +
+ +### size + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Banner.mdx b/docs/versioned_docs/version-6.x/components/Banner.mdx new file mode 100644 index 0000000000..14c1107d0b --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Banner.mdx @@ -0,0 +1,172 @@ +--- +title: Banner +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Banner displays a prominent message and related actions. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Image } from 'react-native'; +import { Banner } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(true); + + return ( + setVisible(false), + }, + { + label: 'Learn more', + onPress: () => setVisible(false), + }, + ]} + icon={({size}) => ( + + )}> + There was a problem processing a transaction on your credit card. + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### visible (required) + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### icon + +
+ + + +
+ +### actions + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + +
+ +### onShowAnimationFinished + +
+ + + +
+ +### onHideAnimationFinished + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/BottomNavigation/BottomNavigation.mdx b/docs/versioned_docs/version-6.x/components/BottomNavigation/BottomNavigation.mdx new file mode 100644 index 0000000000..fb90edf463 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/BottomNavigation/BottomNavigation.mdx @@ -0,0 +1,308 @@ +--- +title: BottomNavigation +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +BottomNavigation provides quick navigation between top-level views of an app with a bottom navigation bar. +It is primarily designed for use on mobile. If you want to use the navigation bar only see [`BottomNavigation.Bar`](BottomNavigationBar). + +By default BottomNavigation uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead. +See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { BottomNavigation, Text } from 'react-native-paper'; + +const MusicRoute = () => Music; + +const AlbumsRoute = () => Albums; + +const RecentsRoute = () => Recents; + +const NotificationsRoute = () => Notifications; + +const MyComponent = () => { + const [index, setIndex] = React.useState(0); + const [routes] = React.useState([ + { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'}, + { key: 'albums', title: 'Albums', focusedIcon: 'album' }, + { key: 'recents', title: 'Recents', focusedIcon: 'history' }, + { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' }, + ]); + + const renderScene = BottomNavigation.SceneMap({ + music: MusicRoute, + albums: AlbumsRoute, + recents: RecentsRoute, + notifications: NotificationsRoute, + }); + + return ( + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### shifting + +
+ + + +
+ +### labeled + +
+ + + +
+ +### compact + +
+ + + +
+ +### navigationState (required) + +
+ + + +
+ +### onIndexChange (required) + +
+ + + +
+ +### renderScene (required) + +
+ + + +
+ +### renderIcon + +
+ + + +
+ +### renderLabel + +
+ + + +
+ +### renderTouchable + +
+ + + +
+ +### getAccessibilityLabel + +
+ + + +
+ +### getBadge + +
+ + + +
+ +### getLabelText + +
+ + + +
+ +### getLazy + +
+ + + +
+ +### getTestID + +
+ + + +
+ +### onTabPress + +
+ + + +
+ +### onTabLongPress + +
+ + + +
+ +### activeColor + +
+ + + +
+ +### inactiveColor + +
+ + + +
+ +### sceneAnimationEnabled + +
+ + + +
+ +### sceneAnimationType + +
+ + + +
+ +### sceneAnimationEasing + +
+ + + +
+ +### keyboardHidesNavigationBar + +
+ + + +
+ +### safeAreaInsets + +
+ + + +
+ +### barStyle + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### activeIndicatorStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/BottomNavigation/BottomNavigationBar.mdx b/docs/versioned_docs/version-6.x/components/BottomNavigation/BottomNavigationBar.mdx new file mode 100644 index 0000000000..f5d064f3b1 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/BottomNavigation/BottomNavigationBar.mdx @@ -0,0 +1,285 @@ +--- +title: BottomNavigation.Bar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A navigation bar which can easily be integrated with [React Navigation's Bottom Tabs Navigator](https://reactnavigation.org/docs/bottom-tab-navigator/). + + + + + + + + + ## Usage +### without React Navigation +```js +import React from 'react'; +import { useState } from 'react'; +import { View } from 'react-native'; +import { BottomNavigation, Text, Provider } from 'react-native-paper'; +import MaterialCommunityIcons from '@react-native-vector-icons/material-design-icons'; + +function HomeScreen() { + return ( + + Home! + + ); +} + +function SettingsScreen() { + return ( + + Settings! + + ); +} + +export default function MyComponent() { + const [index, setIndex] = useState(0); + + const routes = [ + { key: 'home', title: 'Home', icon: 'home' }, + { key: 'settings', title: 'Settings', icon: 'cog' }, + ]; + + const renderScene = ({ route }) => { + switch (route.key) { + case 'home': + return ; + case 'settings': + return ; + default: + return null; + } + }; + + return ( + + {renderScene({ route: routes[index] })} + { + const newIndex = routes.findIndex((r) => r.key === route.key); + if (newIndex !== -1) { + setIndex(newIndex); + } + }} + renderIcon={({ route, color }) => ( + + )} + getLabelText={({ route }) => route.title} + /> + + ); +} +``` + + ### with React Navigation + \n Home!\n
\n );\n}\n\nfunction SettingsScreen() {\n return (\n \n Settings!\n \n );\n}\n\nconst MyTabs = createBottomTabNavigator({\n screenOptions: {\n animation: 'shift',\n },\n tabBar: ({ navigation, state, descriptors, insets }) => (\n {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (event.defaultPrevented) {\n preventDefault();\n } else {\n navigation.dispatch({\n ...CommonActions.navigate(route.name, route.params),\n target: state.key,\n });\n }\n }}\n renderIcon={({ route, focused, color }) =>\n descriptors[route.key].options.tabBarIcon?.({\n focused,\n color,\n size: 24,\n }) || null\n }\n getLabelText={({ route }) => {\n const { options } = descriptors[route.key];\n const label =\n typeof options.tabBarLabel === 'string'\n ? options.tabBarLabel\n : typeof options.title === 'string'\n ? options.title\n : route.name;\n\n return label;\n }}\n />\n ),\n screens: {\n Home: {\n screen: HomeScreen,\n options: {\n tabBarIcon: ({ color }) => (\n \n ),\n },\n },\n Settings: {\n screen: SettingsScreen,\n options: {\n tabBarIcon: ({ color }) => (\n \n ),\n },\n },\n },\n});\n\nconst Navigation = createStaticNavigation(MyTabs);\n\nexport default function App() {\n return (\n \n \n \n \n \n );\n}","dynamic":"import { Text, View } from 'react-native';\nimport { NavigationContainer, CommonActions } from '@react-navigation/native';\nimport { createBottomTabNavigator } from '@react-navigation/bottom-tabs';\nimport { Provider, BottomNavigation } from 'react-native-paper';\nimport MaterialCommunityIcons from '@react-native-vector-icons/material-design-icons';\n\nfunction HomeScreen() {\n return (\n \n Home!\n \n );\n}\n\nfunction SettingsScreen() {\n return (\n \n Settings!\n \n );\n}\n\nconst Tab = createBottomTabNavigator();\n\nexport default function App() {\n return (\n \n \n (\n {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (event.defaultPrevented) {\n preventDefault();\n } else {\n navigation.dispatch({\n ...CommonActions.navigate(route.name, route.params),\n target: state.key,\n });\n }\n }}\n renderIcon={({ route, focused, color }) =>\n descriptors[route.key].options.tabBarIcon?.({\n focused,\n color,\n size: 24,\n }) || null\n }\n getLabelText={({ route }) => {\n const { options } = descriptors[route.key];\n const label =\n typeof options.tabBarLabel === 'string'\n ? options.tabBarLabel\n : typeof options.title === 'string'\n ? options.title\n : route.name;\n\n return label;\n }}\n />\n )}>\n (\n \n ),\n }}\n />\n (\n \n ),\n }}\n />\n \n \n \n );\n}\n"}}} /> + + + + ## Props + + + + +
+ +### shifting + +
+ + + +
+ +### labeled + +
+ + + +
+ +### compact + +
+ + + +
+ +### navigationState (required) + +
+ + + +
+ +### renderIcon + +
+ + + +
+ +### renderLabel + +
+ + + +
+ +### renderTouchable + +
+ + + +
+ +### getAccessibilityLabel + +
+ + + +
+ +### getBadge + +
+ + + +
+ +### getLabelText + +
+ + + +
+ +### getTestID + +
+ + + +
+ +### onTabPress (required) + +
+ + + +
+ +### onTabLongPress + +
+ + + +
+ +### activeColor + +
+ + + +
+ +### inactiveColor + +
+ + + +
+ +### animationEasing + +
+ + + +
+ +### keyboardHidesNavigationBar + +
+ + + +
+ +### safeAreaInsets + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### activeIndicatorStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Button/Button.mdx b/docs/versioned_docs/version-6.x/components/Button/Button.mdx new file mode 100644 index 0000000000..f85bbe1d76 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Button/Button.mdx @@ -0,0 +1,273 @@ +--- +title: Button +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A button is component that the user can press to trigger an action. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Button } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### mode + +
+ + + +
+ +### dark + +
+ + + +
+ +### compact + +
+ + + +
+ +### buttonColor + +
+ + + +
+ +### textColor + +
+ + + +
+ +### loading + +
+ + + +
+ +### icon + +
+ + + +
+ +### disabled + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### uppercase + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityHint + +
+ + + +
+ +### accessibilityRole + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### style + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### touchableRef + +
+ + + +
+ +### ref + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Card/Card.mdx b/docs/versioned_docs/version-6.x/components/Card/Card.mdx new file mode 100644 index 0000000000..98fbe67108 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Card/Card.mdx @@ -0,0 +1,172 @@ +--- +title: Card +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A card is a sheet of material that serves as an entry point to more detailed information. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar, Button, Card, Text } from 'react-native-paper'; + +const LeftContent = props => + +const MyComponent = () => ( + + + + Card title + Card content + + + + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### mode + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### disabled + +
+ + + +
+ +### elevation + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### accessible + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Card/CardActions.mdx b/docs/versioned_docs/version-6.x/components/Card/CardActions.mdx new file mode 100644 index 0000000000..856f640420 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Card/CardActions.mdx @@ -0,0 +1,72 @@ +--- +title: Card.Actions +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a list of actions inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Card, Button } from 'react-native-paper'; + +const MyComponent = () => ( + + + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Card/CardContent.mdx b/docs/versioned_docs/version-6.x/components/Card/CardContent.mdx new file mode 100644 index 0000000000..bb7496c1dd --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Card/CardContent.mdx @@ -0,0 +1,64 @@ +--- +title: Card.Content +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show content inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Card, Text } from 'react-native-paper'; + +const MyComponent = () => ( + + + Card title + Card content + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Card/CardCover.mdx b/docs/versioned_docs/version-6.x/components/Card/CardCover.mdx new file mode 100644 index 0000000000..0bfac77665 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Card/CardCover.mdx @@ -0,0 +1,63 @@ +--- +title: Card.Cover +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a cover image inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Card } from 'react-native-paper'; + +const MyComponent = () => ( + + + +); + +export default MyComponent; +``` + + + + + ## Props + ### Image props + + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Card/CardTitle.mdx b/docs/versioned_docs/version-6.x/components/Card/CardTitle.mdx new file mode 100644 index 0000000000..912d3f51a8 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Card/CardTitle.mdx @@ -0,0 +1,176 @@ +--- +title: Card.Title +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a title, subtitle and an avatar inside a Card. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Avatar, Card, IconButton } from 'react-native-paper'; + +const MyComponent = () => ( + } + right={(props) => {}} />} + /> +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### titleNumberOfLines + +
+ + + +
+ +### titleVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### subtitle + +
+ + + +
+ +### subtitleStyle + +
+ + + +
+ +### subtitleNumberOfLines + +
+ + + +
+ +### subtitleVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### left + +
+ + + +
+ +### leftStyle + +
+ + + +
+ +### right + +
+ + + +
+ +### rightStyle + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### subtitleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Checkbox/Checkbox.mdx b/docs/versioned_docs/version-6.x/components/Checkbox/Checkbox.mdx new file mode 100644 index 0000000000..d8c4419527 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Checkbox/Checkbox.mdx @@ -0,0 +1,124 @@ +--- +title: Checkbox +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Checkboxes allow the selection of multiple options from a set. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Checkbox } from 'react-native-paper'; + +const MyComponent = () => { + const [checked, setChecked] = React.useState(false); + + return ( + { + setChecked(!checked); + }} + /> + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### status (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### error + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Checkbox/CheckboxItem.mdx b/docs/versioned_docs/version-6.x/components/Checkbox/CheckboxItem.mdx new file mode 100644 index 0000000000..faa96df173 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Checkbox/CheckboxItem.mdx @@ -0,0 +1,180 @@ +--- +title: Checkbox.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Checkbox.Item allows you to press the whole row (item) instead of only the Checkbox. + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Checkbox } from 'react-native-paper'; + +const MyComponent = () => ( + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### status (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### label (required) + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### labelVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### position + +
+ + + +
+ +### hitSlop + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Chip/Chip.mdx b/docs/versioned_docs/version-6.x/components/Chip/Chip.mdx new file mode 100644 index 0000000000..87b98dc6fc --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Chip/Chip.mdx @@ -0,0 +1,283 @@ +--- +title: Chip +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Chips are compact elements that can represent inputs, attributes, or actions. +They can have an icon or avatar on the left, and a close button icon on the right. +They are typically used to: +
    +
  • Present multiple options
  • +
  • Represent attributes active or chosen
  • +
  • Present filter options
  • +
  • Trigger actions related to primary content
  • +
+ + + + + + + +## Usage +```js +import * as React from 'react'; +import { Chip } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')}>Example Chip +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### mode + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### icon + +
+ + + +
+ +### avatar + +
+ + + +
+ +### closeIcon + +
+ + + +
+ +### selected + +
+ + + +
+ +### selectedColor + +
+ + + +
+ +### showSelectedOverlay Available in v5.x with theme version 3 + +
+ + + +
+ +### showSelectedCheck + +
+ + + +
+ +### disabled + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### closeIconAccessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### onClose + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### compact Available in v5.x with theme version 3 + +
+ + + +
+ +### elevated Available in v5.x with theme version 3 + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### ellipsizeMode + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### accessibilityRole + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/DataTable/DataTable.mdx b/docs/versioned_docs/version-6.x/components/DataTable/DataTable.mdx new file mode 100644 index 0000000000..510a195f7e --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/DataTable/DataTable.mdx @@ -0,0 +1,127 @@ +--- +title: DataTable +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Data tables allow displaying sets of data. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => { + const [page, setPage] = React.useState(0); + const [numberOfItemsPerPageList] = React.useState([2, 3, 4]); + const [itemsPerPage, onItemsPerPageChange] = React.useState( + numberOfItemsPerPageList[0] + ); + + const [items] = React.useState([ + { + key: 1, + name: 'Cupcake', + calories: 356, + fat: 16, + }, + { + key: 2, + name: 'Eclair', + calories: 262, + fat: 16, + }, + { + key: 3, + name: 'Frozen yogurt', + calories: 159, + fat: 6, + }, + { + key: 4, + name: 'Gingerbread', + calories: 305, + fat: 3.7, + }, + ]); + + const from = page * itemsPerPage; + const to = Math.min((page + 1) * itemsPerPage, items.length); + + React.useEffect(() => { + setPage(0); + }, [itemsPerPage]); + + return ( + + + Dessert + Calories + Fat + + + {items.slice(from, to).map((item) => ( + + {item.name} + {item.calories} + {item.fat} + + ))} + + setPage(page)} + label={`${from + 1}-${to} of ${items.length}`} + numberOfItemsPerPageList={numberOfItemsPerPageList} + numberOfItemsPerPage={itemsPerPage} + onItemsPerPageChange={onItemsPerPageChange} + showFastPaginationControls + selectPageDropdownLabel={'Rows per page'} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/DataTable/DataTableCell.mdx b/docs/versioned_docs/version-6.x/components/DataTable/DataTableCell.mdx new file mode 100644 index 0000000000..b21f71127e --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/DataTable/DataTableCell.mdx @@ -0,0 +1,109 @@ +--- +title: DataTable.Cell +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a single cell inside of a table. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + 1 + 2 + 3 + 4 + +); + +export default MyComponent; +``` + +If you want to support multiline text, please use View instead, as multiline text doesn't comply with +MD Guidelines (https://github.com/callstack/react-native-paper/issues/2381). + + + + + ## Props + ### TouchableRipple props + + + +
+ +### children (required) + +
+ + + +
+ +### numeric + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/DataTable/DataTableHeader.mdx b/docs/versioned_docs/version-6.x/components/DataTable/DataTableHeader.mdx new file mode 100644 index 0000000000..bf318e56db --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/DataTable/DataTableHeader.mdx @@ -0,0 +1,77 @@ +--- +title: DataTable.Header +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display title in table header. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + + + Dessert + + Calories + Fat (g) + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/DataTable/DataTablePagination.mdx b/docs/versioned_docs/version-6.x/components/DataTable/DataTablePagination.mdx new file mode 100644 index 0000000000..eb6afe233e --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/DataTable/DataTablePagination.mdx @@ -0,0 +1,187 @@ +--- +title: DataTable.Pagination +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show pagination for data table. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const numberOfItemsPerPageList = [2, 3, 4]; + +const items = [ + { + key: 1, + name: 'Page 1', + }, + { + key: 2, + name: 'Page 2', + }, + { + key: 3, + name: 'Page 3', + }, +]; + +const MyComponent = () => { + const [page, setPage] = React.useState(0); + const [numberOfItemsPerPage, onItemsPerPageChange] = React.useState(numberOfItemsPerPageList[0]); + const from = page * numberOfItemsPerPage; + const to = Math.min((page + 1) * numberOfItemsPerPage, items.length); + + React.useEffect(() => { + setPage(0); + }, [numberOfItemsPerPage]); + + return ( + + setPage(page)} + label={`${from + 1}-${to} of ${items.length}`} + showFastPaginationControls + numberOfItemsPerPageList={numberOfItemsPerPageList} + numberOfItemsPerPage={numberOfItemsPerPage} + onItemsPerPageChange={onItemsPerPageChange} + selectPageDropdownLabel={'Rows per page'} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### page (required) + +
+ + + +
+ +### numberOfPages (required) + +
+ + + +
+ +### onPageChange (required) + +
+ + + +
+ +### showFastPaginationControls + +
+ + + +
+ +### theme + +
+ + + +
+ +### numberOfItemsPerPage + +
+ + + +
+ +### numberOfItemsPerPageList + +
+ + + +
+ +### onItemsPerPageChange + +
+ + + +
+ +### selectPageDropdownLabel + +
+ + + +
+ +### selectPageDropdownAccessibilityLabel + +
+ + + +
+ +### label + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/DataTable/DataTableRow.mdx b/docs/versioned_docs/version-6.x/components/DataTable/DataTableRow.mdx new file mode 100644 index 0000000000..e2765dcca8 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/DataTable/DataTableRow.mdx @@ -0,0 +1,90 @@ +--- +title: DataTable.Row +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a single row inside of a table. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + 1 + 2 + 3 + 4 + +); + +export default MyComponent; +``` + + + + + ## Props + ### TouchableRipple props + + + +
+ +### children (required) + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### pointerEvents + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/DataTable/DataTableTitle.mdx b/docs/versioned_docs/version-6.x/components/DataTable/DataTableTitle.mdx new file mode 100644 index 0000000000..8967b338c8 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/DataTable/DataTableTitle.mdx @@ -0,0 +1,125 @@ +--- +title: DataTable.Title +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to display title in table header. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { DataTable } from 'react-native-paper'; + +const MyComponent = () => ( + + + + Dessert + + Calories + Fat (g) + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### numeric + +
+ + + +
+ +### sortDirection + +
+ + + +
+ +### numberOfLines + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### textStyle + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Dialog/Dialog.mdx b/docs/versioned_docs/version-6.x/components/Dialog/Dialog.mdx new file mode 100644 index 0000000000..29450a344b --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Dialog/Dialog.mdx @@ -0,0 +1,136 @@ +--- +title: Dialog +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks. +To render the `Dialog` above other components, you'll need to wrap it with the [`Portal`](../Portal) component. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Button, Dialog, Portal, PaperProvider, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const showDialog = () => setVisible(true); + + const hideDialog = () => setVisible(false); + + return ( + + + + + + Alert + + This is simple dialog + + + + + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dismissable + +
+ + + +
+ +### dismissableBackButton + +
+ + + +
+ +### onDismiss + +
+ + + +
+ +### visible + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Dialog/DialogActions.mdx b/docs/versioned_docs/version-6.x/components/Dialog/DialogActions.mdx new file mode 100644 index 0000000000..b8936894a6 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Dialog/DialogActions.mdx @@ -0,0 +1,80 @@ +--- +title: Dialog.Actions +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a list of actions in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Button, Dialog, Portal } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Dialog/DialogContent.mdx b/docs/versioned_docs/version-6.x/components/Dialog/DialogContent.mdx new file mode 100644 index 0000000000..18dc952022 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Dialog/DialogContent.mdx @@ -0,0 +1,71 @@ +--- +title: Dialog.Content +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show content in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + This is simple dialog + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Dialog/DialogIcon.mdx b/docs/versioned_docs/version-6.x/components/Dialog/DialogIcon.mdx new file mode 100644 index 0000000000..30e0d48f25 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Dialog/DialogIcon.mdx @@ -0,0 +1,101 @@ +--- +title: Dialog.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +@supported Available in v5.x with theme version 3 +A component to show an icon in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + This is a title + + This is simple dialog + + + + ); +}; + +const styles = StyleSheet.create({ + title: { + textAlign: 'center', + }, +}) + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### color + +
+ + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Dialog/DialogScrollArea.mdx b/docs/versioned_docs/version-6.x/components/Dialog/DialogScrollArea.mdx new file mode 100644 index 0000000000..cc49955a83 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Dialog/DialogScrollArea.mdx @@ -0,0 +1,87 @@ +--- +title: Dialog.ScrollArea +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a scrollable content in a Dialog. The component only provides appropriate styling. +For the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ScrollView } from 'react-native'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + + + This is a scrollable area + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Dialog/DialogTitle.mdx b/docs/versioned_docs/version-6.x/components/Dialog/DialogTitle.mdx new file mode 100644 index 0000000000..4755404144 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Dialog/DialogTitle.mdx @@ -0,0 +1,80 @@ +--- +title: Dialog.Title +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a title in a Dialog. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Dialog, Portal, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const hideDialog = () => setVisible(false); + + return ( + + + This is a title + + This is simple dialog + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Divider.mdx b/docs/versioned_docs/version-6.x/components/Divider.mdx new file mode 100644 index 0000000000..d3b868eefe --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Divider.mdx @@ -0,0 +1,93 @@ +--- +title: Divider +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A divider is a thin, lightweight separator that groups content in lists and page layouts. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Divider, Text } from 'react-native-paper'; + +const MyComponent = () => ( + + Lemon + + Mango + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### leftInset Renamed from 'inset' to 'leftInset` in v5.x + +
+ + + +
+ +### horizontalInset Available in v5.x with theme version 3 + +
+ + + +
+ +### bold Available in v5.x with theme version 3 + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Drawer/DrawerCollapsedItem.mdx b/docs/versioned_docs/version-6.x/components/Drawer/DrawerCollapsedItem.mdx new file mode 100644 index 0000000000..7193539e8f --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Drawer/DrawerCollapsedItem.mdx @@ -0,0 +1,149 @@ +--- +title: Drawer.CollapsedItem +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Note: Available in v5.x with theme version 3 + +Collapsed component used to show an action item with an icon and optionally label in a navigation drawer. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Drawer } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### label + +
+ + + +
+ +### badge + +
+ + + +
+ +### disabled + +
+ + + +
+ +### focusedIcon Renamed from 'icon' to 'focusedIcon' in v5.x + +
+ + + +
+ +### unfocusedIcon Renamed from 'icon' to 'focusedIcon' in v5.x + +
+ + + +
+ +### active + +
+ + + +
+ +### onPress + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Drawer/DrawerItem.mdx b/docs/versioned_docs/version-6.x/components/Drawer/DrawerItem.mdx new file mode 100644 index 0000000000..8320143a75 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Drawer/DrawerItem.mdx @@ -0,0 +1,147 @@ +--- +title: Drawer.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to show an action item with an icon and a label in a navigation drawer. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Drawer } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### label (required) + +
+ + + +
+ +### icon + +
+ + + +
+ +### active + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### background + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### right + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Drawer/DrawerSection.mdx b/docs/versioned_docs/version-6.x/components/Drawer/DrawerSection.mdx new file mode 100644 index 0000000000..63c7b98497 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Drawer/DrawerSection.mdx @@ -0,0 +1,110 @@ +--- +title: Drawer.Section +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to group content inside a navigation drawer. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Drawer } from 'react-native-paper'; + +const MyComponent = () => { + const [active, setActive] = React.useState(''); + + return ( + + setActive('first')} + /> + setActive('second')} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### showDivider + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/FAB/FAB.mdx b/docs/versioned_docs/version-6.x/components/FAB/FAB.mdx new file mode 100644 index 0000000000..4c3990ce52 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/FAB/FAB.mdx @@ -0,0 +1,173 @@ +--- +title: FAB +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A floating action button represents the primary action on a screen. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { FAB } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')} + /> +); + +const styles = StyleSheet.create({ + fab: { + position: 'absolute', + margin: 16, + right: 0, + bottom: 0, + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### variant + +
+ + + +
+ +### containerColor + +
+ + + +
+ +### contentColor + +
+ + + +
+ +### size + +
+ + + +
+ +### visible + +
+ + + +
+ +### onPress + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityState + +
+ + + +
+ +### background + +
+ + + +
+ +### style + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + +
+ +### ref + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/FAB/FABExtended.mdx b/docs/versioned_docs/version-6.x/components/FAB/FABExtended.mdx new file mode 100644 index 0000000000..2ab71359a8 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/FAB/FABExtended.mdx @@ -0,0 +1,199 @@ +--- +title: Extended +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +An extended floating action button represents the primary action on a screen +and shows a label next to the icon. Animates between expanded (icon + label) +and collapsed (icon only) states. + + + + + +## Usage +```js +import * as React from 'react'; +import { StyleSheet } from 'react-native'; +import { FAB } from 'react-native-paper'; + +const MyComponent = () => { + const [expanded, setExpanded] = React.useState(true); + + return ( + setExpanded((v) => !v)} + style={styles.fab} + /> + ); +}; + +const styles = StyleSheet.create({ + fab: { + position: 'absolute', + margin: 16, + left: 0, + bottom: 0, + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### label (required) + +
+ + + +
+ +### variant + +
+ + + +
+ +### containerColor + +
+ + + +
+ +### contentColor + +
+ + + +
+ +### size + +
+ + + +
+ +### expanded (required) + +
+ + + +
+ +### visible + +
+ + + +
+ +### onPress + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityState + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### background + +
+ + + +
+ +### style + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + +
+ +### ref + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/FAB/FABMenu.mdx b/docs/versioned_docs/version-6.x/components/FAB/FABMenu.mdx new file mode 100644 index 0000000000..e0c82b0f86 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/FAB/FABMenu.mdx @@ -0,0 +1,122 @@ +--- +title: Menu +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Floating action button menu. Wraps a trigger FAB; when `expanded` is true, +items appear stacked above and the trigger morphs into the spec'd close +button (`shape: 'full'`, 56 dp, saturated role color). + +No visual backdrop and no outside-tap dismiss — that matches the MD3 spec +and lets the user keep interacting with the content underneath. Dismiss +via the close button or by tapping an item. + + + + + + + +## Usage +```tsx +const [open, setOpen] = React.useState(false); + + + setOpen(false)} + trigger={{ icon: 'plus', variant: 'primary', onPress: () => setOpen(true) }} + items={[ + { icon: 'email', label: 'Send', onPress: () => {} }, + { icon: 'bell', label: 'Remind', onPress: () => {} }, + ]} + /> + +``` + + + ## Props + + + + +
+ +### expanded (required) + +
+ + + +
+ +### onDismiss (required) + +
+ + + +
+ +### trigger (required) + +
+ + + +
+ +### alignment + +
+ + + +
+ +### closeIcon + +
+ + + +
+ +### items (required) + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Icon.mdx b/docs/versioned_docs/version-6.x/components/Icon.mdx new file mode 100644 index 0000000000..5dad95ddd6 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Icon.mdx @@ -0,0 +1,95 @@ +--- +title: Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +An icon component which renders icon from vector library. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Icon, Palette } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### size (required) + +
+ + + +
+ +### allowFontScaling + +
+ + + +
+ +### source (required) + +
+ + + +
+ +### color + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/IconButton/IconButton.mdx b/docs/versioned_docs/version-6.x/components/IconButton/IconButton.mdx new file mode 100644 index 0000000000..00d0a69e4e --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/IconButton/IconButton.mdx @@ -0,0 +1,182 @@ +--- +title: IconButton +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +An icon button is a button which displays only an icon without a label. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { IconButton, Palette } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')} + /> +); + +export default MyComponent; +``` + + + + + ## Props + ### TouchableRipple props + + + +
+ +### icon (required) + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### iconColor Renamed from 'color' to 'iconColor' in v5.x + +
+ + + +
+ +### containerColor + +
+ + + +
+ +### selected + +
+ + + +
+ +### size + +
+ + + +
+ +### disabled + +
+ + + +
+ +### animated + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### onPress + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + +
+ +### loading + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/List/ListAccordion.mdx b/docs/versioned_docs/version-6.x/components/List/ListAccordion.mdx new file mode 100644 index 0000000000..eed29d3232 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/List/ListAccordion.mdx @@ -0,0 +1,265 @@ +--- +title: List.Accordion +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display an expandable list item. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List } from 'react-native-paper'; + +const MyComponent = () => { + const [expanded, setExpanded] = React.useState(true); + + const handlePress = () => setExpanded(!expanded); + + return ( + + }> + + + + + } + expanded={expanded} + onPress={handlePress}> + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### description + +
+ + + +
+ +### left + +
+ + + +
+ +### right + +
+ + + +
+ +### expanded + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### delayLongPress + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### theme + +
+ + + +
+ +### background + +
+ + + +
+ +### style + +
+ + + +
+ +### containerStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### descriptionStyle + +
+ + + +
+ +### titleNumberOfLines + +
+ + + +
+ +### descriptionNumberOfLines + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### descriptionMaxFontSizeMultiplier + +
+ + + +
+ +### id + +
+ + + +
+ +### testID + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### pointerEvents + +
+ + + +
+ +### hitSlop + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/List/ListAccordionGroup.mdx b/docs/versioned_docs/version-6.x/components/List/ListAccordionGroup.mdx new file mode 100644 index 0000000000..7224e87927 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/List/ListAccordionGroup.mdx @@ -0,0 +1,85 @@ +--- +title: List.AccordionGroup +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +List.AccordionGroup allows to control a group of List Accordions. `id` prop for List.Accordion is required in order for group to work. +List.AccordionGroup can be a controlled or uncontrolled component. The example shows the uncontrolled version. +At most one Accordion can be expanded at a given time. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View, Text } from 'react-native'; +import { List } from 'react-native-paper'; + +const MyComponent = () => ( + + + + + + + + + + List.Accordion can be wrapped because implementation uses React.Context. + + + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### onAccordionPress + +
+ + + +
+ +### expandedId + +
+ + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/List/ListIcon.mdx b/docs/versioned_docs/version-6.x/components/List/ListIcon.mdx new file mode 100644 index 0000000000..c8b5ee12df --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/List/ListIcon.mdx @@ -0,0 +1,79 @@ +--- +title: List.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show an icon in a list item. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List, Palette } from 'react-native-paper'; + +const MyComponent = () => ( + <> + + + + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### color + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/List/ListItem.mdx b/docs/versioned_docs/version-6.x/components/List/ListItem.mdx new file mode 100644 index 0000000000..7ba8aa8dfa --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/List/ListItem.mdx @@ -0,0 +1,201 @@ +--- +title: List.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show tiles inside a List. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List } from 'react-native-paper'; + +const MyComponent = () => ( + } + /> +); + +export default MyComponent; +``` + + + + + ## Props + ### TouchableRipple props + + + +
+ +### title (required) + +
+ + + +
+ +### description + +
+ + + +
+ +### left + +
+ + + +
+ +### right + +
+ + + +
+ +### onPress + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### containerStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### descriptionStyle + +
+ + + +
+ +### titleNumberOfLines + +
+ + + +
+ +### descriptionNumberOfLines + +
+ + + +
+ +### titleEllipsizeMode + +
+ + + +
+ +### descriptionEllipsizeMode + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### descriptionMaxFontSizeMultiplier + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/List/ListSection.mdx b/docs/versioned_docs/version-6.x/components/List/ListSection.mdx new file mode 100644 index 0000000000..c90da6872d --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/List/ListSection.mdx @@ -0,0 +1,90 @@ +--- +title: List.Section +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to group list items. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { List, Palette } from 'react-native-paper'; + +const MyComponent = () => ( + + Some title + } /> + } + /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### theme + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/List/ListSubheader.mdx b/docs/versioned_docs/version-6.x/components/List/ListSubheader.mdx new file mode 100644 index 0000000000..a5f507ec34 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/List/ListSubheader.mdx @@ -0,0 +1,63 @@ +--- +title: List.Subheader +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component used to display a header in lists. + + + + + +## Usage +```js +import * as React from 'react'; +import { List } from 'react-native-paper'; + +const MyComponent = () => My List Title; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Menu/Menu.mdx b/docs/versioned_docs/version-6.x/components/Menu/Menu.mdx new file mode 100644 index 0000000000..0d4044f003 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Menu/Menu.mdx @@ -0,0 +1,190 @@ +--- +title: Menu +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Menus display a list of choices on temporary elevated surfaces. Their placement varies based on the element that opens them. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Button, Menu, Divider, PaperProvider } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const openMenu = () => setVisible(true); + + const closeMenu = () => setVisible(false); + + return ( + + + Show menu}> + {}} title="Item 1" /> + {}} title="Item 2" /> + + {}} title="Item 3" /> + + + + ); +}; + +export default MyComponent; +``` + +### Note +When using `Menu` within a React Native's `Modal` component, you need to wrap all +`Modal` contents within a `PaperProvider` in order for the menu to show. This +wrapping is not necessary if you use Paper's `Modal` instead. + + + ## Props + + + + +
+ +### visible (required) + +
+ + + +
+ +### anchor (required) + +
+ + + +
+ +### anchorPosition + +
+ + + +
+ +### statusBarHeight + +
+ + + +
+ +### onDismiss + +
+ + + +
+ +### overlayAccessibilityLabel + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### elevation + +
+ + + +
+ +### mode + +
+ + + +
+ +### theme + +
+ + + +
+ +### keyboardShouldPersistTaps + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Menu/MenuItem.mdx b/docs/versioned_docs/version-6.x/components/Menu/MenuItem.mdx new file mode 100644 index 0000000000..3db471c8b8 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Menu/MenuItem.mdx @@ -0,0 +1,190 @@ +--- +title: Menu.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to show a single list item inside a Menu. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Menu } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} title="Redo" /> + {}} title="Undo" /> + {}} title="Cut" disabled /> + {}} title="Copy" disabled /> + {}} title="Paste" /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### title (required) + +
+ + + +
+ +### leadingIcon Renamed from 'icon' to 'leadingIcon' in v5.x + +
+ + + +
+ +### trailingIcon Available in v5.x with theme version 3 + +
+ + + +
+ +### disabled + +
+ + + +
+ +### dense Available in v5.x with theme version 3 + +
+ + + +
+ +### background + +
+ + + +
+ +### onPress + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### style + +
+ + + +
+ +### containerStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### titleStyle + +
+ + + +
+ +### theme + +
+ + + +
+ +### hitSlop + +
+ + + +
+ +### testID + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### accessibilityState + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Modal.mdx b/docs/versioned_docs/version-6.x/components/Modal.mdx new file mode 100644 index 0000000000..c96efbf7b5 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Modal.mdx @@ -0,0 +1,146 @@ +--- +title: Modal +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +The Modal component is a simple way to present content above an enclosing view. +To render the `Modal` above other components, you'll need to wrap it with the [`Portal`](./Portal) component. +Note that this modal is NOT accessible by default; if you need an accessible modal, please use the React Native Modal. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Modal, Portal, Text, Button, PaperProvider } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const showModal = () => setVisible(true); + const hideModal = () => setVisible(false); + const containerStyle = { backgroundColor: 'white', padding: 20 }; + + return ( + + + + Example Modal. Click outside this area to dismiss. + + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### dismissable + +
+ + + +
+ +### dismissableBackButton + +
+ + + +
+ +### onDismiss + +
+ + + +
+ +### overlayAccessibilityLabel + +
+ + + +
+ +### visible + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### contentContainerStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Portal/Portal.mdx b/docs/versioned_docs/version-6.x/components/Portal/Portal.mdx new file mode 100644 index 0000000000..9d3d325820 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Portal/Portal.mdx @@ -0,0 +1,74 @@ +--- +title: Portal +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Portal allows rendering a component at a different place in the parent tree. +You can use it to render content which should appear above other elements, similar to `Modal`. +It requires a [`Portal.Host`](PortalHost) component to be rendered somewhere in the parent tree. +Note that if you're using the `Provider` component, this already includes a `Portal.Host`. + + + + + +## Usage +```js +import * as React from 'react'; +import { Portal, Text } from 'react-native-paper'; + +const MyComponent = () => ( + + This is rendered at a different place + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### theme (required) + +
+ + + + + + + ## More Examples +
+ Toggle to grab more examples + +
+ + + + + diff --git a/docs/versioned_docs/version-6.x/components/Portal/PortalHost.mdx b/docs/versioned_docs/version-6.x/components/Portal/PortalHost.mdx new file mode 100644 index 0000000000..f54c0b8609 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Portal/PortalHost.mdx @@ -0,0 +1,56 @@ +--- +title: Portal.Host +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Portal host renders all of its children `Portal` elements. +For example, you can wrap a screen in `Portal.Host` to render items above the screen. +If you're using the `Provider` component, it already includes `Portal.Host`. + + + + + +## Usage +```js +import * as React from 'react'; +import { Text } from 'react-native'; +import { Portal } from 'react-native-paper'; + +const MyComponent = () => ( + + Content of the app + +); + +export default MyComponent; +``` + +Here any `Portal` elements under `` are rendered alongside `` and will appear above `` like a `Modal`. + + + ## Props + + + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/ProgressBar.mdx b/docs/versioned_docs/version-6.x/components/ProgressBar.mdx new file mode 100644 index 0000000000..9492b0f7e9 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/ProgressBar.mdx @@ -0,0 +1,119 @@ +--- +title: ProgressBar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Progress bar is an indicator used to present progress of some activity in the app. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ProgressBar, Palette } from 'react-native-paper'; + +const MyComponent = () => ( + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### animatedValue + +
+ + + +
+ +### progress + +
+ + + +
+ +### color + +
+ + + +
+ +### indeterminate + +
+ + + +
+ +### visible + +
+ + + +
+ +### fillStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/RadioButton/RadioButton.mdx b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButton.mdx new file mode 100644 index 0000000000..260bd42fe7 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButton.mdx @@ -0,0 +1,123 @@ +--- +title: RadioButton +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Radio buttons allow the selection a single option from a set. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { RadioButton } from 'react-native-paper'; + +const MyComponent = () => { + const [checked, setChecked] = React.useState('first'); + + return ( + + setChecked('first')} + /> + setChecked('second')} + /> + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### value (required) + +
+ + + +
+ +### status + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonAndroid.mdx b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonAndroid.mdx new file mode 100644 index 0000000000..2faf286f16 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonAndroid.mdx @@ -0,0 +1,99 @@ +--- +title: RadioButton.Android +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + + + + + + + +Radio buttons allow the selection a single option from a set. +This component follows platform guidelines for Android, but can be used +on any platform. + + + + + ## Props + ### TouchableRipple props + + + +
+ +### value (required) + +
+ + + +
+ +### status + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonGroup.mdx b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonGroup.mdx new file mode 100644 index 0000000000..bcaa9333d0 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonGroup.mdx @@ -0,0 +1,81 @@ +--- +title: RadioButton.Group +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Radio button group allows to control a group of radio buttons. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { RadioButton, Text } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('first'); + + return ( + setValue(newValue)} value={value}> + + First + + + + Second + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### onValueChange (required) + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonIOS.mdx b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonIOS.mdx new file mode 100644 index 0000000000..83db4152cc --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonIOS.mdx @@ -0,0 +1,91 @@ +--- +title: RadioButton.IOS +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + + + + + + + +Radio buttons allow the selection a single option from a set. +This component follows platform guidelines for iOS, but can be used +on any platform. + + + + + ## Props + ### TouchableRipple props + + + +
+ +### value (required) + +
+ + + +
+ +### status + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### color + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonItem.mdx b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonItem.mdx new file mode 100644 index 0000000000..c5f863d44b --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/RadioButton/RadioButtonItem.mdx @@ -0,0 +1,202 @@ +--- +title: RadioButton.Item +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +RadioButton.Item allows you to press the whole row (item) instead of only the RadioButton. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { RadioButton } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('first'); + + return ( + setValue(value)} value={value}> + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### value (required) + +
+ + + +
+ +### label (required) + +
+ + + +
+ +### disabled + +
+ + + +
+ +### background + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### uncheckedColor + +
+ + + +
+ +### color + +
+ + + +
+ +### status + +
+ + + +
+ +### style + +
+ + + +
+ +### labelStyle + +
+ + + +
+ +### labelVariant Available in v5.x with theme version 3 + +
+ + + +
+ +### labelMaxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### mode + +
+ + + +
+ +### position + +
+ + + +
+ +### hitSlop + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Searchbar.mdx b/docs/versioned_docs/version-6.x/components/Searchbar.mdx new file mode 100644 index 0000000000..657f96101f --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Searchbar.mdx @@ -0,0 +1,248 @@ +--- +title: Searchbar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Searchbar is a simple input box where users can type search queries. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Searchbar } from 'react-native-paper'; + +const MyComponent = () => { + const [searchQuery, setSearchQuery] = React.useState(''); + + return ( + + ); +}; + +export default MyComponent; + +``` + + + ## Props + + + + +
+ +### placeholder + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### onChangeText + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### icon + +
+ + + +
+ +### iconColor + +
+ + + +
+ +### onIconPress + +
+ + + +
+ +### onClearIconPress + +
+ + + +
+ +### searchAccessibilityLabel + +
+ + + +
+ +### clearIcon + +
+ + + +
+ +### clearAccessibilityLabel + +
+ + + +
+ +### traileringIcon Available in v5.x with theme version 3 + +
+ + + +
+ +### traileringIconColor Available in v5.x with theme version 3 + +
+ + + +
+ +### onTraileringIconPress + +
+ + + +
+ +### traileringIconAccessibilityLabel + +
+ + + +
+ +### right Available in v5.x with theme version 3 + +
+ + + +
+ +### showDivider Available in v5.x with theme version 3 + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### inputStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### loading + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + +
+ +### ref + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/SegmentedButtons/SegmentedButtons.mdx b/docs/versioned_docs/version-6.x/components/SegmentedButtons/SegmentedButtons.mdx new file mode 100644 index 0000000000..36496a7c1b --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/SegmentedButtons/SegmentedButtons.mdx @@ -0,0 +1,107 @@ +--- +title: SegmentedButtons +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Segmented buttons can be used to select options, switch views or sort elements. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { SafeAreaView, StyleSheet } from 'react-native'; +import { SegmentedButtons } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState(''); + + return ( + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### buttons (required) + +
+ + + +
+ +### density + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Snackbar.mdx b/docs/versioned_docs/version-6.x/components/Snackbar.mdx new file mode 100644 index 0000000000..66581f61fc --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Snackbar.mdx @@ -0,0 +1,218 @@ +--- +title: Snackbar +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Snackbars provide brief feedback about an operation through a message rendered at the bottom of the container in which it's wrapped. + +Note: To display it as a popup, regardless of the parent's position, wrap it with a `Portal` component – refer to the example in the "More Examples` section. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View, StyleSheet } from 'react-native'; +import { Button, Snackbar } from 'react-native-paper'; + +const MyComponent = () => { + const [visible, setVisible] = React.useState(false); + + const onToggleSnackBar = () => setVisible(!visible); + + const onDismissSnackBar = () => setVisible(false); + + return ( + + + { + // Do something + }, + }}> + Hey there! I'm a Snackbar. + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'space-between', + }, +}); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### visible (required) + +
+ + + +
+ +### action + +
+ + + +
+ +### icon Available in v5.x with theme version 3 + +
+ + + +
+ +### onIconPress + +
+ + + +
+ +### iconAccessibilityLabel Available in v5.x with theme version 3 + +
+ + + +
+ +### duration + +
+ + + +
+ +### onDismiss (required) + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### maxFontSizeMultiplier + +
+ + + +
+ +### wrapperStyle + +
+ + + +
+ +### contentStyle + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + + + + + ## More Examples +
+ Toggle to grab more examples + +
+ + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Surface.mdx b/docs/versioned_docs/version-6.x/components/Surface.mdx new file mode 100644 index 0000000000..e70b85c42e --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Surface.mdx @@ -0,0 +1,119 @@ +--- +title: Surface +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Surface is a basic container that can give depth to an element with elevation shadow. +On dark theme with `adaptive` mode, surface is constructed by also placing a semi-transparent white overlay over a component surface. +See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information. +Overlay and shadow can be applied by specifying the `elevation` property both on Android and iOS. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Surface, Text } from 'react-native-paper'; +import { StyleSheet } from 'react-native'; + +const MyComponent = () => ( + + Surface + +); + +export default MyComponent; + +const styles = StyleSheet.create({ + surface: { + padding: 8, + height: 80, + width: 80, + alignItems: 'center', + justifyContent: 'center', + }, +}); +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### elevation Available in v5.x with theme version 3 + +
+ + + +
+ +### mode Available in v5.x with theme version 3 + +
+ + + +
+ +### theme + +
+ + + +
+ +### testID + +
+ + + +
+ +### ref + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Switch/Switch.mdx b/docs/versioned_docs/version-6.x/components/Switch/Switch.mdx new file mode 100644 index 0000000000..12d997fa26 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Switch/Switch.mdx @@ -0,0 +1,125 @@ +--- +title: Switch +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Material 3 toggle between two mutually exclusive states (on / off). + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Switch } from 'react-native-paper'; + +const Example = () => { + const [on, setOn] = React.useState(false); + return ; +}; +``` + +## Theming +Customize by overriding these `theme.colors` roles: +- `primary` / `onPrimary`: selected track + icon / selected handle +- `primaryContainer`: selected handle on hover, press +- `surfaceContainerHighest`: unselected track + icon +- `outline`: unselected resting handle, unselected track outline +- `onSurfaceVariant`: unselected handle on hover, press +- `onSurface`: disabled track, handle, and icon fills +- `surface`: disabled selected handle +- `secondary`: focus indicator + + + ## Props + + + + +
+ +### value + +
+ + + +
+ +### onValueChange + +
+ + + +
+ +### disabled + +
+ + + +
+ +### checkedIcon + +
+ + + +
+ +### uncheckedIcon + +
+ + + +
+ +### style + +
+ + + +
+ +### testID + +
+ + + +
+ +### theme + +
+ + + +
+ +### accessibilityLabel + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Text/Text.mdx b/docs/versioned_docs/version-6.x/components/Text/Text.mdx new file mode 100644 index 0000000000..076a690898 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Text/Text.mdx @@ -0,0 +1,109 @@ +--- +title: Text +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Typography component showing styles complied with passed `variant` prop and supported by the type system. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { Text } from 'react-native-paper'; + +const MyComponent = () => ( + <> + Display Large + Display Medium + Display small + + Headline Large + Headline Medium + Headline Small + + Title Large + Title Medium + Title Small + + Body Large + Body Medium + Body Small + + Label Large + Label Medium + Label Small + +); + +export default MyComponent; +``` + + + + + ## Props + ### Text props + + + +
+ +### variant Available in v5.x with theme version 3 + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### theme + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/TextInput/TextInput.mdx b/docs/versioned_docs/version-6.x/components/TextInput/TextInput.mdx new file mode 100644 index 0000000000..1928ab0072 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/TextInput/TextInput.mdx @@ -0,0 +1,177 @@ +--- +title: TextInput +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A text input lets users enter and edit text. It shows an optional floating label, +supports `filled` and `outlined` variants, optional supporting text (including +error state), and start/end accessories. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { TextInput } from 'react-native-paper'; + +const MyComponent = () => { + const [text, setText] = React.useState(''); + + const searchAccessory = (accessoryProps) => ( + + ); + + const clearAccessory = ({ style, disabled }) => ( + setText('')} + role="button" + aria-label="Clear text" + > + + + ); + + return ( + + ); +}; + +export default MyComponent; +``` + + + + + ## Props + ### TextInput props + + + +
+ +### ref + +
+ + + +
+ +### variant + +
+ + + +
+ +### error + +
+ + + +
+ +### label + +
+ + + +
+ +### supportingText + +
+ + + +
+ +### counter + +
+ + + +
+ +### disabled + +
+ + + +
+ +### prefix + +
+ + + +
+ +### suffix + +
+ + + +
+ +### theme + +
+ + + +
+ +### startAccessory + +
+ + + +
+ +### endAccessory + +
+ + + +
+ +### render + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/TextInput/TextInputIcon.mdx b/docs/versioned_docs/version-6.x/components/TextInput/TextInputIcon.mdx new file mode 100644 index 0000000000..96271b8578 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/TextInput/TextInputIcon.mdx @@ -0,0 +1,95 @@ +--- +title: TextInput.Icon +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A component to render a leading / trailing icon in the TextInput +(return it from `startAccessory` or `endAccessory`). Accepts icon-specific props as well as +`TextInputAccessoryProps`, which TextInput passes into those render props. + + + + + +## Usage +```js +import * as React from 'react'; +import { TextInput } from 'react-native-paper'; + +const MyComponent = () => { + const [text, setText] = React.useState(''); + + const searchAccessory = (props) => ( + + ); + + const clearAccessory = (props) => ( + setText('')} /> + ); + + return ( + + ); +}; + +export default MyComponent; +``` + + + + + ## Props + ### IconButton props + + + +
+ +### style (required) + +
+ + + +
+ +### multiline (required) + +
+ + + +
+ +### disabled (required) + +
+ + + +
+ +### error (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButton.mdx b/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButton.mdx new file mode 100644 index 0000000000..990a014737 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButton.mdx @@ -0,0 +1,154 @@ +--- +title: ToggleButton +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Toggle buttons can be used to group related options. To emphasize groups of related toggle buttons, +a group should share a common container. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ToggleButton } from 'react-native-paper'; + +const ToggleButtonExample = () => { + const [status, setStatus] = React.useState('checked'); + + const onButtonToggle = value => { + setStatus(status === 'checked' ? 'unchecked' : 'checked'); + }; + + return ( + + ); +}; + +export default ToggleButtonExample; + +``` + + + ## Props + + + + +
+ +### icon (required) + +
+ + + +
+ +### size + +
+ + + +
+ +### iconColor + +
+ + + +
+ +### disabled + +
+ + + +
+ +### accessibilityLabel + +
+ + + +
+ +### onPress + +
+ + + +
+ +### value + +
+ + + +
+ +### status + +
+ + + +
+ +### style + +
+ + + +
+ +### theme + +
+ + + +
+ +### ref + +
+ + + +
+ +### testID + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButtonGroup.mdx b/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButtonGroup.mdx new file mode 100644 index 0000000000..e29c66ad41 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButtonGroup.mdx @@ -0,0 +1,78 @@ +--- +title: ToggleButton.Group +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Toggle group allows to control a group of toggle buttons. +It doesn't change the appearance of the toggle buttons. If you want to group them in a row, check out [ToggleButton.Row](ToggleButtonRow). + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ToggleButton } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('left'); + + return ( + setValue(value)} + value={value} + > + + + + ); +}; + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### onValueChange (required) + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### children (required) + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButtonRow.mdx b/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButtonRow.mdx new file mode 100644 index 0000000000..8ef840854d --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/ToggleButton/ToggleButtonRow.mdx @@ -0,0 +1,83 @@ +--- +title: ToggleButton.Row +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Toggle button row renders a group of toggle buttons in a row. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { ToggleButton } from 'react-native-paper'; + +const MyComponent = () => { + const [value, setValue] = React.useState('left'); + + return ( + setValue(value)} value={value}> + + + + ); +}; + +export default MyComponent; + +``` + + + ## Props + + + + +
+ +### onValueChange (required) + +
+ + + +
+ +### value (required) + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/Tooltip/Tooltip.mdx b/docs/versioned_docs/version-6.x/components/Tooltip/Tooltip.mdx new file mode 100644 index 0000000000..840879f1b8 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/Tooltip/Tooltip.mdx @@ -0,0 +1,99 @@ +--- +title: Tooltip +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +Tooltips display informative text when users hover over, focus on, or tap an element. + +Plain tooltips, when activated, display a text label identifying an element, such as a description of its function. Tooltips should include only short, descriptive text and avoid restating visible UI text. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { IconButton, Tooltip } from 'react-native-paper'; + +const MyComponent = () => ( + + {}} /> + +); + +export default MyComponent; +``` + + + ## Props + + + + +
+ +### children (required) + +
+ + + +
+ +### enterTouchDelay + +
+ + + +
+ +### leaveTouchDelay + +
+ + + +
+ +### title (required) + +
+ + + +
+ +### titleMaxFontSizeMultiplier + +
+ + + +
+ +### theme + +
+ + + + + + + + + ## Theme colors + + + + + diff --git a/docs/versioned_docs/version-6.x/components/TouchableRipple/TouchableRipple.mdx b/docs/versioned_docs/version-6.x/components/TouchableRipple/TouchableRipple.mdx new file mode 100644 index 0000000000..c94b4f9b64 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/TouchableRipple/TouchableRipple.mdx @@ -0,0 +1,165 @@ +--- +title: TouchableRipple +--- + +import PropTable from '@site/src/components/PropTable.tsx'; +import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; +import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; +import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; +import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; + +A wrapper for views that should respond to touches. +Provides a material "ink ripple" interaction effect for supported platforms (>= Android Lollipop). +On unsupported platforms, it falls back to a highlight effect. + + + + + + + +## Usage +```js +import * as React from 'react'; +import { View } from 'react-native'; +import { Text, TouchableRipple } from 'react-native-paper'; + +const MyComponent = () => ( + console.log('Pressed')} + rippleColor="rgba(0, 0, 0, .32)" + > + Press anywhere + +); + +export default MyComponent; +``` + + + + + ## Props + ### Pressable props + + + +
+ +### borderless + +
+ + + +
+ +### background + +
+ + + +
+ +### centered + +
+ + + +
+ +### disabled + +
+ + + +
+ +### onPress + +
+ + + +
+ +### onLongPress + +
+ + + +
+ +### onPressIn + +
+ + + +
+ +### onPressOut + +
+ + + +
+ +### rippleColor + +
+ + + +
+ +### underlayColor + +
+ + + +
+ +### children (required) + +
+ + + +
+ +### style + +
+ + + +
+ +### ref + +
+ + + +
+ +### theme + +
+ + + + + + + + + + diff --git a/docs/versioned_docs/version-6.x/components/_category_.json b/docs/versioned_docs/version-6.x/components/_category_.json new file mode 100644 index 0000000000..c1ea2a2a75 --- /dev/null +++ b/docs/versioned_docs/version-6.x/components/_category_.json @@ -0,0 +1,3 @@ +{ + "label": "Components" +} \ No newline at end of file diff --git a/docs/docs/guides/01-getting-started.mdx b/docs/versioned_docs/version-6.x/guides/01-getting-started.mdx similarity index 100% rename from docs/docs/guides/01-getting-started.mdx rename to docs/versioned_docs/version-6.x/guides/01-getting-started.mdx diff --git a/docs/docs/guides/02-theming.mdx b/docs/versioned_docs/version-6.x/guides/02-theming.mdx similarity index 99% rename from docs/docs/guides/02-theming.mdx rename to docs/versioned_docs/version-6.x/guides/02-theming.mdx index db65637b1b..e35a3f1068 100644 --- a/docs/docs/guides/02-theming.mdx +++ b/docs/versioned_docs/version-6.x/guides/02-theming.mdx @@ -195,7 +195,7 @@ Created schemes are following the Material Design 3 color system and covering co Passed source color into the util is translated into tones to automatically provide the range of tones that map to color roles. -![customColors](../../static/screenshots/custom-colors.png) +![customColors](../../../static/screenshots/custom-colors.png) _Source: [Material You Color System](https://m3.material.io/styles/color/the-color-system/custom-colors)_ diff --git a/docs/docs/guides/03-icons.mdx b/docs/versioned_docs/version-6.x/guides/03-icons.mdx similarity index 100% rename from docs/docs/guides/03-icons.mdx rename to docs/versioned_docs/version-6.x/guides/03-icons.mdx diff --git a/docs/docs/guides/04-fonts.md b/docs/versioned_docs/version-6.x/guides/04-fonts.md similarity index 100% rename from docs/docs/guides/04-fonts.md rename to docs/versioned_docs/version-6.x/guides/04-fonts.md diff --git a/docs/docs/guides/05-react-native-web.md b/docs/versioned_docs/version-6.x/guides/05-react-native-web.md similarity index 100% rename from docs/docs/guides/05-react-native-web.md rename to docs/versioned_docs/version-6.x/guides/05-react-native-web.md diff --git a/docs/docs/guides/06-recommended-libraries.md b/docs/versioned_docs/version-6.x/guides/06-recommended-libraries.md similarity index 100% rename from docs/docs/guides/06-recommended-libraries.md rename to docs/versioned_docs/version-6.x/guides/06-recommended-libraries.md diff --git a/docs/versioned_docs/version-6.x/guides/07-contributing.mdx b/docs/versioned_docs/version-6.x/guides/07-contributing.mdx new file mode 100644 index 0000000000..2861043dc3 --- /dev/null +++ b/docs/versioned_docs/version-6.x/guides/07-contributing.mdx @@ -0,0 +1,7 @@ +--- +title: Contributing +--- + +import Contributing from '../../../../CONTRIBUTING.md'; + + diff --git a/docs/docs/guides/08-theming-with-react-navigation.md b/docs/versioned_docs/version-6.x/guides/08-theming-with-react-navigation.md similarity index 99% rename from docs/docs/guides/08-theming-with-react-navigation.md rename to docs/versioned_docs/version-6.x/guides/08-theming-with-react-navigation.md index 67b360dbba..aa4f5386ee 100644 --- a/docs/docs/guides/08-theming-with-react-navigation.md +++ b/docs/versioned_docs/version-6.x/guides/08-theming-with-react-navigation.md @@ -287,7 +287,7 @@ const Header = ({ scene }) => { And now you can switch between light and dark theme! -![paperGuide1](../../static/screenshots/themingWithReactNavigationDarkLightSwitch.gif) +![paperGuide1](../../../static/screenshots/themingWithReactNavigationDarkLightSwitch.gif) Thanks to the linking of themes that we did earlier, switching themes can be controlled with only one piece of state. diff --git a/docs/docs/guides/09-bottom-navigation.md b/docs/versioned_docs/version-6.x/guides/09-bottom-navigation.md similarity index 100% rename from docs/docs/guides/09-bottom-navigation.md rename to docs/versioned_docs/version-6.x/guides/09-bottom-navigation.md diff --git a/docs/docs/guides/09-react-navigation.md b/docs/versioned_docs/version-6.x/guides/09-react-navigation.md similarity index 100% rename from docs/docs/guides/09-react-navigation.md rename to docs/versioned_docs/version-6.x/guides/09-react-navigation.md diff --git a/docs/docs/guides/10-rtl.md b/docs/versioned_docs/version-6.x/guides/10-rtl.md similarity index 100% rename from docs/docs/guides/10-rtl.md rename to docs/versioned_docs/version-6.x/guides/10-rtl.md diff --git a/docs/versioned_docs/version-6.x/guides/11-ripple-effect.md b/docs/versioned_docs/version-6.x/guides/11-ripple-effect.md new file mode 100644 index 0000000000..31845060d7 --- /dev/null +++ b/docs/versioned_docs/version-6.x/guides/11-ripple-effect.md @@ -0,0 +1,45 @@ +--- +title: Ripple effect +--- + +The ripple effect is a visual feedback that occurs when a user interacts with a pressable UI element, such as a button. This response takes the form of a circular ripple expanding from the point of contact, much like a drop falling into water and creating ripples. + +The ripple effect is an essential aspect of Material Design, and Paper's pressable components have it enabled by default. Nonetheless, it can be tailored to suit specific needs. + +:::note +The ripple effect on the iOS platform is replaced by a highlight effect. +::: + +## Customize ripple effect color in component + +The `rippleColor` prop is available for every pressable component which allows you to set the color of the ripple effect. For the instance, to make the `Button` component's ripple effect transparent, simply pass the desired color value to the prop: + +```typescript + +``` + +## Disable ripple effect in all components + +To disable the ripple effect in **all** of Paper's components set `rippleEffectEnabled: false` on the `settings` prop of `PaperProvider`. + +```typescript +import { Provider as PaperProvider } from 'react-native-paper'; +// ... + + + // ... + +``` + + + diff --git a/docs/docs/guides/12-migration.md b/docs/versioned_docs/version-6.x/guides/12-migration.md similarity index 100% rename from docs/docs/guides/12-migration.md rename to docs/versioned_docs/version-6.x/guides/12-migration.md diff --git a/docs/versioned_docs/version-6.x/guides/_category_.json b/docs/versioned_docs/version-6.x/guides/_category_.json new file mode 100644 index 0000000000..82c9b69949 --- /dev/null +++ b/docs/versioned_docs/version-6.x/guides/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Guides", + "position": 0 +} diff --git a/docs/versioned_docs/version-6.x/showcase.mdx b/docs/versioned_docs/version-6.x/showcase.mdx new file mode 100644 index 0000000000..7024ab018d --- /dev/null +++ b/docs/versioned_docs/version-6.x/showcase.mdx @@ -0,0 +1,11 @@ +--- +title: Showcase +--- + +import Showcase from '@site/src/components/Showcase.tsx'; + +# Who's using Paper? + +Check out these apps built using Paper. Send us a [pull request](https://github.com/callstack/react-native-paper/pulls) to add your app to this list. + + diff --git a/docs/versioned_sidebars/version-5.x-sidebars.json b/docs/versioned_sidebars/version-5.x-sidebars.json new file mode 100644 index 0000000000..9553dd0602 --- /dev/null +++ b/docs/versioned_sidebars/version-5.x-sidebars.json @@ -0,0 +1,14 @@ +{ + "tutorialSidebar": [ + { + "type": "autogenerated", + "dirName": "guides" + } + ], + "components": [ + { + "type": "autogenerated", + "dirName": "components" + } + ] +} diff --git a/docs/versioned_sidebars/version-6.x-sidebars.json b/docs/versioned_sidebars/version-6.x-sidebars.json new file mode 100644 index 0000000000..9553dd0602 --- /dev/null +++ b/docs/versioned_sidebars/version-6.x-sidebars.json @@ -0,0 +1,14 @@ +{ + "tutorialSidebar": [ + { + "type": "autogenerated", + "dirName": "guides" + } + ], + "components": [ + { + "type": "autogenerated", + "dirName": "components" + } + ] +} diff --git a/docs/versions.json b/docs/versions.json new file mode 100644 index 0000000000..3f6328c126 --- /dev/null +++ b/docs/versions.json @@ -0,0 +1,4 @@ +[ + "6.x", + "5.x" +] diff --git a/scripts/generate-component-docs.ts b/scripts/generate-component-docs.ts new file mode 100644 index 0000000000..cc0ff5d93d --- /dev/null +++ b/scripts/generate-component-docs.ts @@ -0,0 +1,168 @@ +const childProcess = require('child_process'); +const fs = require('fs'); +const os = require('os'); +const path = require('path'); + +type PluginOptions = { + docsRootDir: string; + libsRootDir: string; + pages: unknown; +}; + +type PluginConfig = [string, PluginOptions]; + +type PluginFactory = ( + context: unknown, + options: PluginOptions +) => Promise<{ + loadContent: () => Promise; +}>; + +const isRecord = (value: unknown): value is { [key: string]: unknown } => + typeof value === 'object' && value !== null; + +const normalizeDocs = (value: unknown, sourceDir: string): unknown => { + if (Array.isArray(value)) { + return value.map((item) => normalizeDocs(item, sourceDir)); + } + + if (!isRecord(value)) { + return value; + } + + return Object.fromEntries( + Object.entries(value).map(([key, item]) => { + if (key !== 'dependencies' || !Array.isArray(item)) { + return [key, normalizeDocs(item, sourceDir)]; + } + + return [ + key, + item.map((dependency) => { + if (typeof dependency !== 'string' || !path.isAbsolute(dependency)) { + return dependency; + } + + const realDependency = fs.existsSync(dependency) + ? fs.realpathSync(dependency) + : dependency; + const relativeDependency = path.relative(sourceDir, realDependency); + + if ( + relativeDependency.startsWith('..') || + path.isAbsolute(relativeDependency) + ) { + return dependency; + } + + return relativeDependency.split(path.sep).join('/'); + }), + ]; + }) + ); +}; + +const main = async () => { + const [branchName, outputPath = 'docs/src/data/componentDocs5x.json'] = + process.argv.slice(2); + + if (!branchName) { + console.error( + 'Usage: node scripts/generate-component-docs.ts [output]' + ); + process.exitCode = 1; + return; + } + + const rootDir = path.resolve(__dirname, '..'); + const tempDir = fs.mkdtempSync( + path.join(os.tmpdir(), 'react-native-paper-docs-') + ); + + try { + const archivePath = path.join(tempDir, 'source.tar'); + const sourceDir = path.join(tempDir, 'source'); + + childProcess.execFileSync( + 'git', + ['rev-parse', '--verify', `${branchName}^{commit}`], + { + cwd: rootDir, + stdio: 'ignore', + } + ); + childProcess.execFileSync( + 'git', + ['archive', '--format=tar', '--output', archivePath, branchName], + { + cwd: rootDir, + stdio: 'inherit', + } + ); + + fs.mkdirSync(sourceDir); + childProcess.execFileSync('tar', ['-xf', archivePath, '-C', sourceDir], { + cwd: rootDir, + stdio: 'inherit', + }); + + const nodeModulesPath = path.join(rootDir, 'docs', 'node_modules'); + const archivedNodeModulesPath = path.join( + sourceDir, + 'docs', + 'node_modules' + ); + + if (fs.existsSync(nodeModulesPath)) { + fs.symlinkSync(nodeModulesPath, archivedNodeModulesPath, 'dir'); + } + + const configPath = path.join(sourceDir, 'docs', 'docusaurus.config.js'); + const config = require(configPath); + + if (!isRecord(config) || !Array.isArray(config.plugins)) { + throw new Error(`Unable to read plugins from ${configPath}`); + } + + const pluginConfig = config.plugins.find( + (plugin: unknown): plugin is PluginConfig => + Array.isArray(plugin) && + plugin[0] === './component-docs-plugin' && + isRecord(plugin[1]) && + typeof plugin[1].docsRootDir === 'string' && + typeof plugin[1].libsRootDir === 'string' + ); + + if (!pluginConfig) { + throw new Error( + `Unable to find component docs plugin config in ${configPath}` + ); + } + + const pluginFactory: PluginFactory = require(path.join( + sourceDir, + 'docs', + 'component-docs-plugin' + )); + const plugin = await pluginFactory({}, pluginConfig[1]); + const docs = await plugin.loadContent(); + const destination = path.resolve(rootDir, outputPath); + + fs.mkdirSync(path.dirname(destination), { recursive: true }); + fs.writeFileSync( + destination, + `${JSON.stringify( + { docs: normalizeDocs(docs, fs.realpathSync(sourceDir)) }, + null, + 2 + )}\n` + ); + } catch (error) { + console.error(error instanceof Error ? error.message : String(error)); + process.exitCode = 1; + } finally { + fs.rmSync(tempDir, { recursive: true, force: true }); + } +}; + +void main();