Home > Enterprise >  How to add custom close button for antd modal?
How to add custom close button for antd modal?

Time:07-30

I want to add custom close button for antd modal. How can I do so?

This is my current close button

1

I want to add a custom image in place of it like this one.

This is the icon I want to add

2

CodePudding user response:

You can use API property called closeIcons on Model div like this:

<Modal
    title="Modal 1000px width"
    centered
    visible={visible}
    closeIcon={<LogoutOutlined />} // Choose any icon you need.
  >
    <p>some contents...</p>
    <p>some contents...</p>
    <p>some contents...</p>
  </Modal>

Reference: antd API

  • Related