forked from react-native-elements/react-native-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add more usage examples & update theme guides (react-native-ele…
- Loading branch information
1 parent
f5f5812
commit 54a14dc
Showing
24 changed files
with
733 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { info, usage } from '@rneui/doc-gen'; | ||
import React from 'react'; | ||
import { ButtonGroup, Icon } from '..'; | ||
|
||
info( | ||
'ButtonGroup is a linear set of segments, each of which function as a button that can display a different view/or perform a different action.', | ||
'Use a ButtonGroup to offer choices that are closely related but mutually exclusive.', | ||
'This component inherits [all native TouchableHighlight and TouchableOpacity props that come with React Native TouchableHighlight or TouchableOpacity elements](https://reactnative.dev/docs/touchablehighlight.html).' | ||
); | ||
|
||
usage( | ||
'Icon', | ||
'', | ||
() => | ||
function () { | ||
const [selectedIndex, setSelectedIndex] = React.useState(0); | ||
return ( | ||
<ButtonGroup | ||
buttonStyle={{ padding: 10 }} | ||
selectedButtonStyle={{ backgroundColor: '#e2e2e2' }} | ||
buttons={[ | ||
<Icon name="format-align-left" />, | ||
<Icon name="format-align-center" />, | ||
<Icon name="format-align-right" />, | ||
]} | ||
selectedIndex={selectedIndex} | ||
onPress={setSelectedIndex} | ||
/> | ||
); | ||
} | ||
); | ||
|
||
usage( | ||
'Multi Select', | ||
'', | ||
() => | ||
function () { | ||
const [selectedIndex, setSelectedIndex] = React.useState([]); | ||
return ( | ||
<ButtonGroup | ||
selectMultiple | ||
buttonStyle={{ padding: 10 }} | ||
selectedButtonStyle={{ backgroundColor: '#e2e2e2' }} | ||
buttons={[ | ||
<Icon name="format-bold" />, | ||
<Icon name="format-italic" />, | ||
<Icon name="format-underline" />, | ||
]} | ||
selectedIndexes={selectedIndex} | ||
onPress={setSelectedIndex} | ||
/> | ||
); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { info, usage, Stack } from '@rneui/doc-gen'; | ||
import React from 'react'; | ||
import { Text } from '..'; | ||
|
||
info('Text displays words and characters of various sizes.'); | ||
|
||
usage('Icon', '', () => ( | ||
<Stack> | ||
<Text h1>Heading 1</Text> | ||
<Text h2>Heading 2</Text> | ||
<Text h3>Heading 3</Text> | ||
<Text h4>Heading 4</Text> | ||
</Stack> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
```tsx live | ||
<Text h2>Hello World</Text> | ||
``` | ||
|
||
### Using font-weight on android | ||
|
||
:::note | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.