ant-design/components/typography/demo/copyable.tsx
afc163 0c97250db3
style: fix Typography copyable style and update demos (#46748)
* style: fix Typography copyable style and update demos

* chore: update jest snapshot
2024-01-02 21:36:10 +08:00

25 lines
734 B
TypeScript

import React from 'react';
import { SmileFilled, SmileOutlined } from '@ant-design/icons';
import { Typography } from 'antd';
const { Paragraph, Text } = Typography;
const App: React.FC = () => (
<>
<Paragraph copyable>This is a copyable text.</Paragraph>
<Paragraph copyable={{ text: 'Hello, Ant Design!' }}>Replace copy text.</Paragraph>
<Paragraph
copyable={{
icon: [<SmileOutlined key="copy-icon" />, <SmileFilled key="copied-icon" />],
tooltips: ['click here', 'you clicked!!'],
}}
>
Custom Copy icon and replace tooltips text.
</Paragraph>
<Paragraph copyable={{ tooltips: false }}>Hide Copy tooltips.</Paragraph>
<Text copyable />
</>
);
export default App;