Merge pull request #271 from kagux/feature/components-in-card-title

allow passing components to card title and subtitle
old
Javi Velasco 2016-01-22 22:13:52 +01:00
commit 80b2abe11d
2 changed files with 23 additions and 2 deletions

View File

@ -47,8 +47,14 @@ CardTitle.propTypes = {
PropTypes.array
]),
className: PropTypes.string,
subtitle: PropTypes.string,
title: PropTypes.string
subtitle: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element
]),
title: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element
])
};
export default CardTitle;

View File

@ -45,6 +45,21 @@ const cards = {
</CardActions>
</Card>
)
}, {
name: 'Customized header',
component: (
<Card className={style.card}>
<CardTitle
title={<u>Title component</u>}
subtitle={<u>Subtitle component</u>}
/>
<CardText>{dummyText}</CardText>
<CardActions>
<Button label="Action 1" />
<Button label="Action 2" />
</CardActions>
</Card>
)
}],
media: [{
name: '16:9 Card Media Area',