Beautiful React-Native components using RN Paper by Callstack
npm install react-native-cross-components
Beautiful React-Native components using react-native-paper and other libraries. If using a paper provider your theme should be applied to all the components.
Package renamed
Previous package name: @crossplatform/react-native-components
New package name: react-native-cross-components
Note that version of React-Native-Vector-Icons is bound by Expo for compatibility.
The iconset used is currently FontAwesome v4 icons. Ability to customize which iconset is used might be added.
``bash`
npm i react-native-cross-components
npm i react-native-paper
npm i react-native-vector-icons
react-native link
`bash`
yarn add react-native-cross-components
yarn add react-native-paper
yarn add react-native-vector-icons
react-native link
`bash`
npm i react-native-cross-components
`bash`
yarn add react-native-cross-components
The styles used by this library are exported for your convenience.
See Components below for examples
---







!GitHub









Table of contents generated with markdown-toc
Renders an FontAwesome Button if only iconName is supplied, else an Paper Button.
For properties and documentation, see API reference - Class CrossButton.
Styles can be customized using ButtonStyle, IconStyle and style properties.
However, react-native-paper is currently missing the option to customize fontSize.
Examples
Button with title, but no icon and mode contained (background color):
`typescript`
import { CrossButton } from 'react-native-cross-components';
export const ButtonComp => () => (
mode="contained"
onPress={() => OnButtonPress('Pressed button with no icon')}
/>
);
Button with title and iconName, default text mode (no background):
`typescript`
import { CrossButton } from 'react-native-cross-components';
export const ButtonComp => () => (
iconName="home"
onPress={() => OnButtonPress('Pressed button with icon')}
/>
);
Clickable icon:
`typescript`
import { CrossButton } from 'react-native-cross-components';
export const ButtonComp => () => (
onPress={() => OnButtonPress('Pressed icon with no title')}
backgroundColor="transparent"
/>
);
Renders a react-native-modal containing cool animations from react-native-indicators.
For properties and documentation, see API reference - Class CrossBusyIndicator.
Examples
Feedback message and PacmanIndicator type (because, why not).
`typescript`
type='PacmanIndicator'
isCancelButtonVisible={true}
message="Loading.."
onCancel={() => this.setState({ isBusy: false })}
/>
Non-cancellable and custom styles for spinnerProps and messageStyle:
`typescript`
messageStyle={{ color: 'red' }}
isBusy={this.state.isBusy2}
isCancelButtonVisible={false}
message="Resistance is futile"
/>
Custom modal props:
`typescript`
swipeDirection: 'up',
backdropColor: 'blue'
}}
isBusy={this.state.isBusy2}
isCancelButtonVisible={false}
message="Busy busy busy.."
/>
Basically just wraps react-native-indicators so you can provide the type you want via property.
For properties and documentation, see API reference - Class CrossSpinner.
Examples
`typescript`
style={styles.spinner}
/>
Wraps react-native-paper typhography components and can also act as a clickable text link.
For properties and documentation, see API reference - Class CrossLabel.
Examples
Headline component:
`typescript`
Title component:
`typescript`
Subheading (with custom style):
`typescript`
style={{ marginTop: 5 }}
>
isSubHeading = true
Caption component (with custom style):
`typescript`
style={{ color: Colors.CrossLightBlue, marginTop: 10 }}
>
isCaption=true, custom color
Paragraph component (with custom style):
`typescript`
style={{ marginTop: 5 }}
>
isParagraph = true
URL link using onPressUrlTarget property. You can also set color using linkColor.
`typescript`
isSubheading={true}
style={{ marginTop: 20, marginBottom: 10 }}
>
Clickable link (onPressUrlTarget):
Regular onPress event:
`typescript`
style={{ marginTop: 20, marginBottom: 10 }}
>
onPress message
A Paper TextInput that also supports masking using react-native-masked-input.
For properties and documentation, see API reference - Class CrossEditor.
Examples
Basic usage
`typescript`
onChangeText={(val) => console.log('Got value', val)}
value={'Textvalue'}
/>
Masked input usage. For maskProps documentation see react-native-masked-input.
`typescript``