ButtonIcon.md
1.25 KB
Icon
Button components can contain an Icon. This is done by setting the icon property or placing an Icon component within the Button
If you want specific control over the positioning and placement of the Icon, then that should be done by placing the Icon component within the Button rather than using the icon property.
- Edit Online :
https://codesandbox.io/s/1o624ny0k7
import { Button } from 'antd'
ReactDOM.render(
<div>
<Button type="primary" shape="circle" icon="search" />
<Button type="primary" icon="search">
Search
</Button>
<Button shape="circle" icon="search" />
<Button icon="search">Search</Button>
<br />
<Button shape="circle" icon="search" />
<Button icon="search">Search</Button>
<Button type="dashed" shape="circle" icon="search" />
<Button type="dashed" icon="search">
Search
</Button>
</div>,
mountNode
)
| Property | Description | Type | Deault |
|---|---|---|---|
| type | can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default) | string | default |