ant-design/components/alert/demo/smooth-closed.tsx
thinkasany fc97a4dd91
feat: ConfigProvider support classnames and styles for Alert (#52669)
* feat: ConfigProvider support classnames and styles for Alert

* empty commit

* update name and snap

* update
2025-02-07 17:39:31 +08:00

23 lines
526 B
TypeScript

import React, { useState } from 'react';
import { Alert, Switch } from 'antd';
const App: React.FC = () => {
const [visible, setVisible] = useState(true);
const handleClose = () => {
setVisible(false);
};
return (
<>
{visible && (
<Alert title="Alert Message Text" type="success" closable afterClose={handleClose} />
)}
<p>click the close button to see the effect</p>
<Switch onChange={setVisible} checked={visible} disabled={visible} />
</>
);
};
export default App;