forked from mui/material-ui
/
Card.js
43 lines (38 loc) · 946 Bytes
/
Card.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import Paper from '../Paper';
import withStyles from '../styles/withStyles';
export const styles = {
/* Styles applied to the root element. */
root: {
overflow: 'hidden',
},
};
const Card = React.forwardRef(function Card(props, ref) {
const { classes, className, raised = false, ...other } = props;
return (
<Paper
className={clsx(classes.root, className)}
elevation={raised ? 8 : 1}
ref={ref}
{...other}
/>
);
});
Card.propTypes = {
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* If `true`, the card will use raised styling.
*/
raised: PropTypes.bool,
};
export default withStyles(styles, { name: 'MuiCard' })(Card);