Skip to content

Latest commit

 

History

History
executable file
·
170 lines (159 loc) · 5.47 KB

Card.md

File metadata and controls

executable file
·
170 lines (159 loc) · 5.47 KB

card-def-headref

Card

Card is a pure NativeBase component.
Card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.
NativeBase Cards support a wide variety of content, including images, text, list groups, links, and more. Mix and match multiple content types to create the card you need.

Preview ios card-def-headref Preview android card-def-headref

Contents:

General Syntax

{% codetabs name="React Native", type="js" -%} import React, { Component } from 'react'; import { Container, Header, Content, Card, CardItem, Body, Text } from 'native-base'; export default class CardExample extends Component { render() { return (

//Your text here ); } } {%- language name="Vue Native", type="vue" -%} //Your text here
{%- endcodetabs %}

  • Card
    • This component adds a box-shadow by default.
    • Also provides default spacing and alignment between cards.
  • CardItem
    • This is the child component of Card.
    • Works very similar to the list items of list.
    • Takes input such as: Text, Button, Image, Thumbnail, Icon.
    • Card takes any number of CardItem.
  • Replacing Component

Configuration for Card

Property Default Option Description
transparent - - Removes card shadow from iOS and elevation from Android
dataArray Array user-defined array Array of data chunks to render iteratively.
renderRow Function - Callback which takes a chunk of data from dataArray and returns as a component.

Configuration for CardItem

Property Default Option Description
header - - Displays text as header for cards
cardBody - - Defines section for body of card. The child components are rendered with proper spacing and alignment.
footer - - Displays text as footer for cards
button - - To navigate on click of a card item.
bordered false boolean Adds border to the cardItems
first - - First CardItem, use in case of custom Card BorderRadius
last - - Last CardItem, use in case of custom Card BorderRadius