ant-design/components/flex/demo/combination.tsx
zhoulixiang 6ed0254ad5
feat: Add classNames and styles prop for card (#46811)
* feat: support classNames and styles for card

* feat: add lost info

* docs: update context of card

* feat: optimize classNames and styles code of card

* test: update card test case

* feat: remove headWrapper

* test: correct test

* feat: remove redundant snapshot

* feat: update config provider for card

* feat: update classNames and styles of card

* feat: add warning for headStyle and bodyStyle of card

* test: replace bodyStyle to styles.body in demo of flex

* docs: add jsDoc about deprecated for headStyle and bodyStyle

* snap: update table counts of card from 3 to 4

* docs: update version for styles and classnames of card

---------

Signed-off-by: zhoulixiang <18366276315@163.com>
Co-authored-by: vagusX <vagusxl@gmail.com>
2024-01-30 15:00:25 +08:00

34 lines
944 B
TypeScript

import React from 'react';
import { Button, Card, Flex, Typography } from 'antd';
const cardStyle: React.CSSProperties = {
width: 620,
};
const imgStyle: React.CSSProperties = {
display: 'block',
width: 273,
};
const App: React.FC = () => (
<Card hoverable style={cardStyle} styles={{ body: { padding: 0, overflow: 'hidden' } }}>
<Flex justify="space-between">
<img
alt="avatar"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
style={imgStyle}
/>
<Flex vertical align="flex-end" justify="space-between" style={{ padding: 32 }}>
<Typography.Title level={3}>
antd is an enterprise-class UI design language and React UI library.
</Typography.Title>
<Button type="primary" href="https://ant.design" target="_blank">
Get Started
</Button>
</Flex>
</Flex>
</Card>
);
export default App;