diff --git a/docs/appDrawer.md b/docs/appDrawer.md index 7e0afecbd..3fa173b72 100644 --- a/docs/appDrawer.md +++ b/docs/appDrawer.md @@ -6,52 +6,65 @@ title: App drawer Creating an app drawer like layout is very common and with NativeBase's SimpleGrid make this extremely simple while still keeping it extremely customisable. Here is an example to illustrate it. ```SnackPlayer name=AppDrawer -import React from "react"; -import { IconButton, SimpleGrid, Icon, NativeBaseProvider } from "native-base"; -import {MaterialIcons} from '@expo/vector-icons'; +import React from 'react'; +import { + IconButton, + SimpleGrid, + Icon, + NativeBaseProvider, + Box, +} from 'native-base'; +import { MaterialIcons } from '@expo/vector-icons'; -function AppDrawer(){ +function AppDrawer() { const icons = [ - "bolt", - "build", - "cloud", - "delivery-dining", - "favorite", - "music-note", - "invert-colors-on", - "navigation", - "settings", - "sports-esports", - "shield", - "photo-camera", - "network-wifi", - "nightlight-round", - "flight", - "extension", - "duo", - "album", - "access-alarm", - "forum", + { name: 'bolt', bg: 'amber.600' }, + { name: 'build', bg: 'emerald.600' }, + { name: 'cloud', bg: 'blue.600' }, + { name: 'delivery-dining', bg: 'orange.600' }, + { name: 'favorite', bg: 'rose.600' }, + { name: 'music-note', bg: 'violet.600' }, + { name: 'invert-colors-on', bg: 'lime.600' }, + { name: 'navigation', bg: 'indigo.600' }, + { name: 'settings', bg: 'pink.600' }, + { name: 'sports-esports', bg: 'coolGray.600' }, + { name: 'shield', bg: 'darkBlue.600' }, + { name: 'photo-camera', bg: 'fuchsia.600' }, + { name: 'network-wifi', bg: 'amber.500' }, + { name: 'nightlight-round', bg: 'violet.800' }, + { name: 'flight', bg: 'blue.800' }, + { name: 'extension', bg: 'indigo.600' }, + { name: 'duo', bg: 'orange.600' }, + { name: 'album', bg: 'rose.600' }, + { name: 'access-alarm', bg: 'emerald.600' }, + { name: 'forum', bg: 'indigo.600' }, ]; - return + return ( + {icons.map((icon) => ( } + p="3" + icon={ + + } /> ))} + ); } export default function () { return ( - - - + + + + + ); } + ``` diff --git a/docs/breakpoints.md b/docs/breakpoints.md index c7ed47991..563075139 100644 --- a/docs/breakpoints.md +++ b/docs/breakpoints.md @@ -19,19 +19,113 @@ breakpoints = { `useBreakpointValue` is a custom hook which returns the value for the current breakpoint from the provided responsive values object. This hook also responds to the window resizing and returning the appropriate value for the new window size. -```jsx +```SnackPlayer name=useBreakpointValue import React from 'react'; -import { Box, useBreakpointValue } from 'native-base'; -export default () => { - const color = useBreakpointValue({ - base: 'red.200', - sm: 'blue.200', - md: 'blue.200', +import { + Factory, + Button, + Stack, + NativeBaseProvider, + Center, +} from 'native-base'; +import { TextInput } from 'react-native'; + +import { Icon, useBreakpointValue, Text, VStack, Heading } from 'native-base'; +import { FontAwesome, Foundation, Feather } from '@expo/vector-icons'; +import { View } from 'react-native'; + +export const UseBreakpointValueExample = () => { + const flexDir = useBreakpointValue({ + base: 'column', + lg: 'row', }); return ( - - This is a box - + + Why us? + + + + + Secure Checkout + + + + + + Secure Checkout + + + + + + Fast Turn Around + + + + ); }; + +// Example template which wraps component with NativeBaseProvider +export default function () { + return ( + +
+ +
+
+ ); +} + ``` diff --git a/docs/buildingFooterTabs.md b/docs/buildingFooterTabs.md index b696cf4a0..c4ae07db8 100644 --- a/docs/buildingFooterTabs.md +++ b/docs/buildingFooterTabs.md @@ -8,8 +8,8 @@ With NativeBase v3 we have removed FooterTab components because as it's very sim ## Example ```SnackPlayer name=Footer dependencies=react-native-linear-gradient -import React from 'react'; +import React from 'react'; import { NativeBaseProvider, Box, @@ -25,50 +25,53 @@ import { Center, Pressable, } from 'native-base'; -import { MaterialCommunityIcons , MaterialIcons} from '@expo/vector-icons'; +import { MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons'; export default function App() { const [selected, setSelected] = React.useState(1); return ( - -
-
- + +
+ setSelected(0)} - > + onPress={() => setSelected(0)}>
} + as={ + + } color="white" - size="xs" + size="sm" /> - - Favorites + + Home +
setSelected(1)} - > + py={2} + flex={1} + onPress={() => setSelected(1)}>
} + as={} color="white" - size="xs" + size="sm" /> - - Music + + Search +
setSelected(2)} - > + onPress={() => setSelected(2)}>
} + mb={1} + as={ + + } color="white" - size="xs" + size="sm" /> - - Places + + Cart +
setSelected(3)} - > + onPress={() => setSelected(3)}>
} + mb={1} + as={ + + } color="white" - size="xs" + size="sm" /> - News + + Account +
@@ -112,4 +124,5 @@ export default function App() { ); } + ``` diff --git a/docs/buildingSearchBar.md b/docs/buildingSearchBar.md index 3949946af..918ecc8a7 100644 --- a/docs/buildingSearchBar.md +++ b/docs/buildingSearchBar.md @@ -13,34 +13,62 @@ Here are some examples to show how easily and quickly we can create so many type ![https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b4c4662d-8a9c-48a2-817d-000ff8f5f6b6/Screenshot_2021-01-18_at_7.51.08_PM.png](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b4c4662d-8a9c-48a2-817d-000ff8f5f6b6/Screenshot_2021-01-18_at_7.51.08_PM.png) --> ```SnackPlayer name=Search%20Bar -import React from "react"; -import { VStack, Input, Button, IconButton, Icon, Text, NativeBaseProvider, Center, Box } from "native-base"; +import React from 'react'; +import { + VStack, + Input, + Button, + IconButton, + Icon, + Text, + NativeBaseProvider, + Center, + Box, + Divider, + Heading, +} from 'native-base'; import { Ionicons, MaterialIcons } from '@expo/vector-icons'; import { FontAwesome5 } from '@expo/vector-icons'; - -function SearchBar(){ +function SearchBar() { return ( - - - Cupertino + + +
+ }> + + Cupertino } />} + _focus: { style: { boxShadow: 'none' } }, + }} + InputLeftElement={ + } + /> + } /> - - Material + + Material } />} - InputRightElement={} />} + }} + InputLeftElement={ + } + /> + } + InputRightElement={ + } + /> + } /> - - ) + + ); } export default function () { return (
- +
); } + ``` diff --git a/docs/buildingSwipeList.md b/docs/buildingSwipeList.md index 208a39a7d..95dc270da 100644 --- a/docs/buildingSwipeList.md +++ b/docs/buildingSwipeList.md @@ -57,7 +57,7 @@ function Basic() { }, { id: '3ac68afc-c605-48d3-a4f8-fbd91aa97f63', - fullName: 'Sujitha Alexander', + fullName: 'Sujita Mathur', timeStamp: '11:11 PM', recentText: 'Cheer up, there!', avatarUrl: @@ -82,7 +82,7 @@ function Basic() { id: '28694a0f-3da1-471f-bd96-142456e29d72', fullName: 'Kiara', timeStamp: '12:47 PM', - recentText: 'I will call him today.', + recentText: 'I will call today.', avatarUrl: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRBwgu1A5zgPSvfE83nurkuzNEoXs9DMNr8Ww&usqp=CAU', }, @@ -116,17 +116,19 @@ function Basic() { borderColor="coolGray.200" pl="4" pr="5" - py="2"> + py="2" + _dark={{ borderColor: 'gray.600' }} + > - + {item.fullName} - {item.recentText} + {item.recentText} - + {item.timeStamp} diff --git a/docs/interaction-styles.mdx b/docs/interaction-styles.mdx index f1e1bb417..8c07bf6a5 100644 --- a/docs/interaction-styles.mdx +++ b/docs/interaction-styles.mdx @@ -22,15 +22,15 @@ Using `_hover` pseudo prop, we can customize the style of Pressable component on - Hover over me + Hover @@ -38,11 +38,11 @@ Using `_hover` pseudo prop, we can customize the style of Pressable component on ```jsx title="Hover example" @@ -58,15 +58,15 @@ Using `_pressed` pseudo prop, we can customize the style of Pressable component - Press me + Pressed @@ -74,15 +74,15 @@ Using `_pressed` pseudo prop, we can customize the style of Pressable component ```jsx title="Pressed example" - Hover over me + Pressed ``` @@ -94,15 +94,19 @@ Using `_focus` pseudo prop, we can customize the style of Pressable component on - Try focusing me + Focus @@ -110,15 +114,15 @@ Using `_focus` pseudo prop, we can customize the style of Pressable component on ```jsx title="Focus example" - Hover over me + Focus ``` @@ -131,45 +135,45 @@ Using `_web`, `_iOS`, `_android` pseudo props, we can customize the style or beh - Primary + Save Web - - Primary + + Save Android - Primary + Save iOS @@ -181,42 +185,42 @@ Using `_web`, `_iOS`, `_android` pseudo props, we can customize the style or beh - Primary + Save Web - - Primary + + Save Android - Primary + Save iOS diff --git a/docs/loginsignupforms.md b/docs/loginsignupforms.md index 75b491f6d..c576656e7 100644 --- a/docs/loginsignupforms.md +++ b/docs/loginsignupforms.md @@ -23,88 +23,63 @@ import { Icon, IconButton, HStack, - Divider + Divider, } from 'native-base'; export default function App() { - - return ( - - - + return ( + + + Welcome - + Sign in to continue! - + - - Email ID + + Email ID - - - Password + + + Password + mt="1"> Forget Password? - - - - - } - color='muted.700' - size='sm' - /> - } - /> - } - color='muted.700' - size="sm" - /> - } - /> - } - color='muted.700' - size="sm" - /> - } - /> - - - - I'm a new user. - + + + I'm a new user.{' '} + + Sign Up @@ -113,6 +88,7 @@ export default function App() { ); } + ``` ### Signup Form @@ -133,87 +109,49 @@ import { Icon, IconButton, HStack, - Divider + Divider, } from 'native-base'; export default function App() { - - return ( - - - + return ( + + + Welcome - + Sign up to continue! - + - - Email + + Email - - Password + + Password - - Confirm Password + + Confirm Password - - - - - } - color='muted.700' - size='sm' - /> - } - /> - } - color='muted.700' - size="sm" - /> - } - /> - } - color='muted.700' - size="sm" - /> - } - /> - - ); } + ``` diff --git a/docs/nativebase-factory.md b/docs/nativebase-factory.md index 56c3a0ed7..d3cbf2589 100644 --- a/docs/nativebase-factory.md +++ b/docs/nativebase-factory.md @@ -99,27 +99,35 @@ export default function () { ```SnackPlayer name=NativeBase%20Factory%20Using%20Ref import React from 'react'; -import { Factory, Button, Stack, NativeBaseProvider,Center } from 'native-base'; +import { + Factory, + Button, + Stack, + NativeBaseProvider, + Center, +} from 'native-base'; import { TextInput } from 'react-native'; -function FactoryViewRefExample () { +function FactoryViewRefExample() { const NBInput = Factory(TextInput); const inputRef = React.useRef(null); return ( + p="2" + borderWidth="1" + borderColor="muted.200" + borderRadius="md" + placeholderTextColor="muted.400" + /> @@ -136,6 +144,7 @@ export default function () { ); } + ``` ## Params diff --git a/docs/useBreakPointValue.md b/docs/useBreakPointValue.md index 525e7ce96..52d1a84a7 100644 --- a/docs/useBreakPointValue.md +++ b/docs/useBreakPointValue.md @@ -17,21 +17,106 @@ The `useBreakpointValue` hook returns the value for the current breakpoint. ## Usage -```SnackPlayer name=useBreakpoint%20Usage +```SnackPlayer name=useBreakpointValue + import React from 'react'; -import { Box, useBreakpointValue, NativeBaseProvider, Center } from 'native-base'; -function UseBreakpointValueExample () { - const color = useBreakpointValue({ - base: 'red.200', - sm: 'blue.200', - md: 'blue.200', +import { + Factory, + Button, + Stack, + NativeBaseProvider, + Center, +} from 'native-base'; +import { TextInput } from 'react-native'; + +import { Icon, useBreakpointValue, Text, VStack, Heading } from 'native-base'; +import { FontAwesome, Foundation, Feather } from '@expo/vector-icons'; +import { View } from 'react-native'; + +export const UseBreakpointValueExample = () => { + const flexDir = useBreakpointValue({ + base: 'column', + lg: 'row', }); return ( - - This is a box - + + Why us? + + + + + Secure Checkout + + + + + + Secure Checkout + + + + + + Fast Turn Around + + + + ); }; + +// Example template which wraps component with NativeBaseProvider export default function () { return ( @@ -41,4 +126,5 @@ export default function () { ); } + ``` diff --git a/docs/utilityProps.md b/docs/utilityProps.md index 6eb0b4a94..59df78b21 100644 --- a/docs/utilityProps.md +++ b/docs/utilityProps.md @@ -16,7 +16,7 @@ import React from 'react'; import { Box as NBBox, NativeBaseProvider, Center } from 'native-base'; const Box = (props) => { - return + return } function Component() { @@ -117,7 +117,7 @@ export default function () { :::tip Note -Above props can be written in the format: {color}:alpha-{opacityToken}, this gets converted into RGBA color format and the opacityToken is mapped to [`Opacity`](default-theme#opacity) +Above props can be written in the format: {color}:alpha.{opacityToken}, this gets converted into RGBA color format and the opacityToken is mapped to [`Opacity`](default-theme#opacity) ::: @@ -131,7 +131,7 @@ export function Example() {
Box 2
+
+ Box 3 +
) @@ -226,7 +237,7 @@ import React from 'react'; import { Box as NBBox, NativeBaseProvider, Center } from 'native-base'; const Box = (props) => { - return + return } function Component() { @@ -283,7 +294,7 @@ import React from 'react'; import { Box as NBBox, Flex, NativeBaseProvider, Center } from 'native-base'; const Box = (props) => { - return + return } function Component() {