1.0.6-rc.78 • Published 5 years ago

react-native-styled-elements v1.0.6-rc.78

Weekly downloads
89
License
MIT
Repository
github
Last release
5 years ago

react-native-styled-elements Still in development

Installation

npm install react-native-styled-elements

DefaultTextProps, DefaultTextStyle

import { Theme } from 'react-native-styled-elements';

Theme.set({ 
    colors: {
        primary: '#6200ee',
        secondary: '#03dac5',
        accent: '#03dac4',
        background: '#f6f6f6',
        surface: '#ffffff',
        error: '#B00020',
        text: '#000000',
        onBackground: '#000000',
        onSurface: '#000000',
        disabled: 'rgba(0,0,0,0.26)',
        disabledBackgroundColor: '#D1D5D8',
        placeholder: 'rgba(0,0,0,0.54)',
        backdrop: 'rgba(0,0,0,0.5)',
        notification: '#F50057',
    }
})
Theme.setFontFamily('FontName')

<Text style={Theme.heading}>heading</Text>
<Text style={Theme.title}>title</Text>
<Text style={Theme.subtitle}>subtitle</Text>
<Text style={Theme.text}>text</Text>
<Text style={Theme.footnote}>footnote</Text>
<Text style={Theme.caption}>caption</Text>

DefaultTextProps, DefaultTextStyle

import { setDefaultTextProps, setDefaultTextStyle } from 'react-native-styled-elements';

setDefaultTextProps(textProps)
setDefaultTextStyle(textStyle)

I18n translations

Get the user preferred languages and use the library of your choice to translate your app. Uses the user preferred locale as default.

import { i18n } from 'react-native-styled-elements';

//Enable fallbacks if you want`en-US` and`en-GB` to fallback to`en`
i18n.fallbacks = true
i18n.locale = 'en'
i18n.translations = {
    en: { welcome: 'Hello' }
}
i18n.getLanguage() // or i18n.locale
console.log(i18n.t('welcome'))

DropdownMenu

import { DropDownMenu } from 'react-native-styled-elements';

<DropDownMenu
    options={[{ title: '', value: {} }]}
    onOptionSelected={item => {}}
    onClose={}
    buttonTextStyle={}
    renderButton={}
    selectedValue={}
/>

Icon

You have to install react-native-vector-icons

import { Icon } from 'react-native-styled-elements';

<Icon
    name='comment-discussion'
    type='OcticonIcon'
    size={20}
    color='#000'
    onPress={() => {}}
/>

Button

import { Button } from 'react-native-styled-elements';

<Button
    title=""
    containerStyle={}
    titleStyle={}
    disabled={true/false}
    onPress={}
/>

ListView

import { ListView } from 'react-native-styled-elements';

const fetchData = ({ data, page, perPage }) => {
    return callAPI({ page, perPage }).then(res => {
        return { data: [...data, res.data], page: page + 1, total: res.total }
    })
}

<ListView
    data={fetchData}
    renderItem={({ item, index }) => {}}
    keyExtractor={i => i.id}
    page={1}
    perPage={10}
/>

ListItem

import { ListItem } from 'react-native-styled-elements';

<ListItem
    title="Title"
    subtitle="SubTitle"
/>

Rating

import { Rating } from 'react-native-styled-elements';

<Rating
    max={5}
    size={16}
    value={4.5}
    color={'#FFAB40'}
/>

SwipeableItem

import { SwipeableItem } from 'react-native-styled-elements';

<SwipeableItem
    renderLeft={}
    renderRight={}
    style={}
/>

KeyboardSpacer

import { KeyboardSpacer } from 'react-native-styled-elements';

<KeyboardSpacer />

UpDownPuller

import { UpDownPuller } from 'react-native-styled-elements';

<UpDownPuller
    miniHeight={210}
    top={80}
    containerStyle={}
    onPullDown={}
    onPullUp={}
>
    ...rest of your component
</UpDownPuller>

ParallaxScrollView

import { ParallaxScrollView } from 'react-native-styled-elements';

<ParallaxScrollView
    style={{}}
    renderForeground={<View />}
    parallaxHeaderHeight={150}
>
    ...rest of your component
</ParallaxScrollView>
1.0.6-rc.78

5 years ago

1.0.6-rc.77

5 years ago

1.0.6-rc.76

5 years ago

1.0.6-rc.75

5 years ago

1.0.6-rc.74

5 years ago

1.0.6-rc.73

5 years ago

1.0.6-rc.72

5 years ago

1.0.6-rc.71

5 years ago

1.0.6-rc.70

5 years ago

1.0.6-rc.69

5 years ago

1.0.6-rc.68

5 years ago

1.0.6-rc.67

5 years ago

1.0.6-rc.66

5 years ago

1.0.6-rc.65

5 years ago

1.0.6-rc.64

5 years ago

1.0.6-rc.63

5 years ago

1.0.6-rc.62

5 years ago

1.0.6-rc.61

5 years ago

1.0.6-rc.60

5 years ago

1.0.6-rc.59

5 years ago

1.0.6-rc.58

5 years ago

1.0.6-rc.57

5 years ago

1.0.6-rc.56

5 years ago

1.0.6-rc.55

5 years ago

1.0.6-rc.54

5 years ago

1.0.6-rc.53

5 years ago

1.0.6-rc.52

5 years ago

1.0.6-rc.51

5 years ago

1.0.6-rc.49

5 years ago

1.0.6-rc.48

5 years ago

1.0.6-rc.47

5 years ago

1.0.6-rc.46

5 years ago

1.0.6-rc.45

5 years ago

1.0.6-rc.44

5 years ago

1.0.6-rc.42

5 years ago

1.0.6-rc.43

5 years ago

1.0.6-rc.41

5 years ago

1.0.6-rc.40

5 years ago

1.0.6-rc.39

5 years ago

1.0.6-rc.38

5 years ago

1.0.6-rc.37

5 years ago

1.0.6-rc.35

6 years ago

1.0.6-rc.34

6 years ago

1.0.6-rc.36

6 years ago

1.0.6-rc.33

6 years ago

1.0.6-rc.32

6 years ago

1.0.6-rc.31

6 years ago

1.0.6-rc.30

6 years ago

1.0.6-rc.29

6 years ago

1.0.6-rc.28

6 years ago

1.0.6-rc.27

6 years ago

1.0.6-rc.26

6 years ago

1.0.6-rc.25

6 years ago

1.0.6-rc.24

6 years ago

1.0.6-rc.23

6 years ago

1.0.6-rc.22

6 years ago

1.0.6-rc.21

6 years ago

1.0.6-rc.20

6 years ago

1.0.6-rc.19

6 years ago

1.0.6-rc.18

6 years ago

1.0.6-rc.17

6 years ago

1.0.6-rc.16

6 years ago

1.0.6-rc.15

6 years ago

1.0.6-rc.14

6 years ago

1.0.6-rc.13

6 years ago

1.0.6-rc.12

6 years ago

1.0.6-rc.11

6 years ago

1.0.6-rc.10

6 years ago

1.0.6-rc.9

6 years ago

1.0.6-rc.8

6 years ago

1.0.6-rc.7

7 years ago

1.0.6-rc.6

7 years ago

1.0.6-rc.5

7 years ago

1.0.6-rc.4

7 years ago

1.0.6-rc.3

7 years ago

1.0.6-rc-2

7 years ago

1.0.6-rc-1

7 years ago

1.0.6-rc

7 years ago

1.0.6-beta-2

7 years ago

1.0.6-beta-01

7 years ago

1.0.6-beta

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago