mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +08:00
1.1 KiB
1.1 KiB
order | title | ||||
---|---|---|---|---|---|
6.1 |
|
zh-CN
配合 react-text-loop-next 或 react-fast-marquee 实现消息轮播通知栏。
en-US
Show a loop banner by using with react-text-loop-next or react-fast-marquee.
import { Alert } from 'antd';
import React from 'react';
import Marquee from 'react-fast-marquee';
import { TextLoop } from 'react-text-loop-next';
const App: React.FC = () => (
<>
<Alert
banner
message={
<TextLoop mask>
<div>Notice message one</div>
<div>Notice message two</div>
<div>Notice message three</div>
<div>Notice message four</div>
</TextLoop>
}
/>
<Alert
banner
message={
<Marquee pauseOnHover gradient={false}>
I can be a React component, multiple React components, or just some text.
</Marquee>
}
/>
</>
);
export default App;