cardviewwithimage.md

March 28, 2018 ยท View on GitHub

CardViewWithImage

CardViewWithImage Example

Attributes

PropTypeDefaultDescriptionPlatformRequired
widthnumber or string300CardView width (for full width you should set '100%')iOS,AndroidYes
imageWidthnumber or string100Image width (for full width you should set '100%')iOS,AndroidYes
imageHeightnumber or string100Image height (for full width you should set '100%')iOS,AndroidYes
roundedImagebooltrueIf you set false image will be squareiOS,AndroidNo
roundedImageValuenumber50If you want your image rounded first set roundedImage "true" after give a number value this attr.iOS,AndroidNo
imageMarginobject-You can set image margin with this. This object requires top, bottom, right, leftiOS,AndroidNo
sourceobject-You can add your source like React_Native Image Component Documents. Also, if you use imageComponent you can remove thisiOS,AndroidIf you're not using imageComponent
buttonComponentobject-You can place your own button component for showing a buttoniOS,AndroidNo
imageComponentobject-You can place your own image component (Fast-image etc.) but if you use this, our embedded styling not work.iOS,AndroidNo
titlestring-Component titleiOS,AndroidNo
titleTextAlignstring-Component title text aligniOS,AndroidNo
titleFontWeightstring-Component title font weightiOS,AndroidNo
titleFontSizenumber-Component title font sizeiOS,AndroidNo
titleFontFamilystring"sans-serif"Card view title font familyiOS,Android
titleLineHeightnumber-Component title text line heightiOS,AndroidNo
titlePaddingobject-You can set title padding with this object. This object requires top, bottom, right, leftiOS,AndroidNo
titleMarginobject-You can set title margin with this object. This object requires top, bottom, right, leftiOS,AndroidNo
contentstring-Content textiOS,AndroidNo
contentFontWeightstring-Component content font weightiOS,AndroidNo
contentFontSizestring-Component content font sizeiOS,AndroidNo
contentTextAlignstring-Component content text aligniOS,AndroidNo
contentPaddingobject-You can set content padding with this object. This object requires top, bottom, right, leftiOS,AndroidNo
contentFontFamilystring-Card view content font familyiOS,Android
contentMarginobject-You can set content margin with this object. This object requires top, bottom, right, leftiOS,AndroidNo
contentLineHeightnumber-Component content text line heightiOS,AndroidNo

Examples

import { CardViewWithImage } from 'react-native-simple-card-view'

Simple Full Width Image Example

    <CardViewWithImage
        width={ (200}
        source={ {uri: 'https://placeimg.com/640/480/nature'} }
        content={ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. At aut distinctio!' }
        title={ 'React Nature :D' }
        imageWidth={ '100%' }
        imageHeight={ 100 }
        roundedImage={ false }
    />

Rounded Image Example

    <CardViewWithImage
        width={ (300}
        content={ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. At aut distinctio!' }
        source={ {uri: 'https://placeimg.com/640/480/tech'} }
        title={ 'Hello World!' }
        imageWidth={ 100 }
        imageHeight={ 100 }
        roundedImage={ true }
        roundedImageValue={ 50 }
        imageMargin={ {top: 10} }
    />

onPress Example

    <CardViewWithImage
        width={ (300}
        content={ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. At aut distinctio!' }
        source={ {uri: 'https://placeimg.com/640/480/tech'} }
        title={ 'Hello World!' }
        imageWidth={ 100 }
        imageHeight={ 100 }
        onPress={() => console.log("CardViewWithImage Clicked!")}
        roundedImage={ true }
        roundedImageValue={ 50 }
        imageMargin={ {top: 10} }
    />