Material Bread
v0.2.10
Home
Getting Started
React Native
Web
Electron
MacOS
Windows
NextJs
Expo
Vue Native
Style
Font
Icons
Theme
Components
Appbar
Searchbar
Appbar Bottom
Avatar
Backdrop
Badge
Banner
Bottom Navigation
Bottom Navigation Item
Button
Card
CardActions
CardContent
CardHeader
CardMedia
Checkbox
Chip
DataTable
DataTableCell
DataTableHeader
DataTablePagination
DataTableRow
Dialog
Divider
Drawer
DrawerHeader
DrawerItem
DrawerSection
DrawerBottom
Fab
Speed dial
Icon
IconButton
List
ListExpand
ListItem
ListSection
Menu
MenuItem
Paper
Progress Bar
Progress Circle
Radio Button
Ripple
Select
SheetBottom
SheetSide
Slider
Snackbar
SwipeNav
Switch
Tabs
Tab
Textfield
Searchfield
ToggleButton
ToggleButtonGroup
Tooltip
Typography
Utils
Anchor
Color
Hoverable
Shadow
Storybook
Showcase
Contributing
Library
Docs
About

Card Actions

Card action buttons displayed at the bottom of most the cards.

import { CardActions } from 'material-bread';

Component #

CardActions are split into leftActionItems and rightActionItems . Left action items display as full text Button s, right action items display as IconButton s. Both can be passed either as objects or nodes.
Fact: dogs make everything better
SHARE
LEARN MORE
Live Editing
<View style={{flexDirection: 'row', alignItems: 'center'}}>
  <Card style={{maxWidth: 400, width: '100%'}}>
    <CardMedia
        image={
            <Image
            style={{ flex: 1, width: '100%' }}
            source={{uri: 'https://images.pexels.com/photos/1938123/pexels-photo-1938123.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260'}}
            resizeMode="cover"
            />
        }
    />
    <CardContent >
      <Text style={{ color: 'rgba(0,0,0,.6)', fontSize: 14 }}>
        Fact: dogs make everything better
      </Text>
    </CardContent>
    <CardActions
      leftActionItems={[
        {name: 'share',},
        {name: 'learn more'}
      ]}
      rightActionItems={[
        {name: 'favorite',},
        {name: 'share'} 
      ]}
    />
  </Card>
</View>

Usage #

import React, { Component } from 'react';
import { Card,CardContent, CardActions, } from 'material-bread';

export default class FullCard extends Component {
  render() {
    return (
      <Card>
        <CardContent >
          <Text style={{ color: 'rgba(0,0,0,.6)', fontSize: 14 }}>
            This is some test card content, though it can anything.
          </Text>
        </CardContent>
        <CardActions
          leftActionItems={[
            {name: 'share',},
            {name: 'learn more'}
          ]}
          rightActionItems={[
            {name: 'favorite',},
            {name: 'share'} 
          ]}
        />
      </Card>
    );
  }
}

Props #

Name
Description
Type
Default
leftActionItems
Can be array of objects or nodes, shows on the left as buttons
array
rightActionItems
Can be array of objects or nodes, shows on the right as IconButtons
array
style
Styles root element
object

Demos #

You can see even more examples in the Storybook environment.

Custom #

You can pass arbitrary nodes to the array for each section to create something custom.
READ MORE
BUY
Live Editing
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<Card style={{maxWidth: 400, width: '100%'}}>
  <CardMedia
      image={
          <Image
          style={{ flex: 1, width: '100%' }}
          source={{uri: 'https://images.pexels.com/photos/280250/pexels-photo-280250.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260'}}
          resizeMode="cover"
          />
      }
  />
  <CardActions
    leftActionItems={[
      <IconButton name="bookmark-border" size={30} color={'#673AB7'} />
    ]}
    rightActionItems={[
      <Button text={'Read more'} type="outlined" textColor={'#009688'} style={{marginRight: 8}} dense/>,
      <Button text={'Buy'} type="flat"  dense/>
    ]}
  />
</Card>
</View>