How to make antd modal have rounded corners

Viewed 2151
  <Modal
    title=""
    visible={isModalVisible}
    onOk={handleOk}
    onCancel={handleCancel}
    cancelButtonProps={{ style: { display: "none" } }}
  >
    <img src="./test.svg" alt="" style={{ marginLeft: "8.5rem" }} />
    <p>It has been added!</p>
  </Modal>

I tried added style to the Modal,

style ={{borderRadius:"20px",overflow:"auto"}}

But that made on the top corners rounded and cutting off the bottom.

2 Answers

You need to overwrite both .ant-modal and .ant-modal-content following way:

.ant-modal {
  border-radius: 20px;
  /* Only border-radius here */
}

.ant-modal-content {
  border-radius: 20px;
  /* border: 10px solid black; */
}

That way you get both corners rounded

Related