Is it possible to set Badge
to Panel
next to 'Info' in ant design
?
<div>
<Collapse>
<Panel header="Info" key="1">
<Badge
count={4}
style={{
backgroundColor: "#fff",
color: "#999",
boxShadow: "0 0 0 1px #d9d9d9 inset"
}}
/>
</Panel>
</Collapse>
</div>
Yes, Collapse.Panel
- header
prop accepts ReactNode
so you can render whatever you want, for example , using antd Grid
:
export default function App() {
return (
<Collapse>
<Collapse.Panel
header={
<Row type="flex" gutter={10}>
<Col>Info</Col>
<Col>
<Badge
count={4}
style={{
backgroundColor: '#fff',
color: '#999',
boxShadow: '0 0 0 1px #d9d9d9 inset'
}}
/>
</Col>
</Row>
}
key="1"
/>
</Collapse>
);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.