2017-01-23 22:24:36 +08:00
|
|
|
---
|
|
|
|
order: 8
|
|
|
|
title:
|
|
|
|
zh-CN: 幽灵按钮
|
|
|
|
en-US: Ghost Button
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2018-08-22 16:17:33 +08:00
|
|
|
幽灵按钮将按钮的内容反色,背景变为透明,常用在有色背景上。
|
2017-01-23 22:24:36 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2019-08-07 17:26:39 +08:00
|
|
|
`ghost` property will make button's background transparent, it is commonly used in colored background.
|
2017-01-23 22:24:36 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2017-01-23 22:24:36 +08:00
|
|
|
import { Button } from 'antd';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React from 'react';
|
2017-01-23 22:24:36 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2019-12-23 16:36:40 +08:00
|
|
|
<div className="site-button-ghost-wrapper">
|
2019-05-07 14:57:32 +08:00
|
|
|
<Button type="primary" ghost>
|
|
|
|
Primary
|
|
|
|
</Button>
|
2017-03-18 16:33:55 +08:00
|
|
|
<Button ghost>Default</Button>
|
2020-01-03 15:22:16 +08:00
|
|
|
<Button type="dashed" ghost>
|
2020-05-31 23:02:59 +08:00
|
|
|
Dashed
|
2019-11-22 12:02:35 +08:00
|
|
|
</Button>
|
2021-08-13 09:31:38 +08:00
|
|
|
<Button type="primary" danger ghost>
|
|
|
|
Danger
|
|
|
|
</Button>
|
2022-04-03 23:27:45 +08:00
|
|
|
</div>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2019-12-23 16:36:40 +08:00
|
|
|
|
2019-12-23 17:16:26 +08:00
|
|
|
```css
|
|
|
|
.site-button-ghost-wrapper {
|
|
|
|
padding: 26px 16px 16px;
|
2021-01-30 19:39:02 +08:00
|
|
|
background: rgb(190, 200, 200);
|
2019-12-23 17:16:26 +08:00
|
|
|
}
|
|
|
|
```
|