2020-07-08 14:47:07 +08:00
|
|
|
---
|
2021-08-02 12:22:30 +08:00
|
|
|
order: 10
|
2020-07-08 14:47:07 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 缎带
|
|
|
|
en-US: Ribbon
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
使用缎带型的徽标。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Use ribbon badge.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2020-07-08 14:47:07 +08:00
|
|
|
import { Badge, Card } from 'antd';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React from 'react';
|
2020-07-08 14:47:07 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2021-07-14 12:34:42 +08:00
|
|
|
<>
|
|
|
|
<Badge.Ribbon text="Hippies">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="pink">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="red">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="cyan">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="green">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="purple">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="volcano">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
|
|
|
<Badge.Ribbon text="Hippies" color="magenta">
|
|
|
|
<Card title="Pushes open the window" size="small">
|
|
|
|
and raises the spyglass.
|
|
|
|
</Card>
|
|
|
|
</Badge.Ribbon>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2020-07-08 14:47:07 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2020-07-08 14:47:07 +08:00
|
|
|
```
|
2021-07-14 12:34:42 +08:00
|
|
|
|
|
|
|
```css
|
2022-06-01 21:47:44 +08:00
|
|
|
#components-badge-demo-ribbbon .ant-card {
|
2021-07-14 12:34:42 +08:00
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
```
|