You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
import { Collapse, Space } from 'antd';
|
|
import React from 'react';
|
|
|
|
const text = `
|
|
A dog is a type of domesticated animal.
|
|
Known for its loyalty and faithfulness,
|
|
it can be found as a welcome guest in many households across the world.
|
|
`;
|
|
|
|
const App: React.FC = () => (
|
|
<Space direction="vertical">
|
|
<Collapse
|
|
collapsible="header"
|
|
defaultActiveKey={['1']}
|
|
items={[
|
|
{
|
|
key: '1',
|
|
label: 'This panel can only be collapsed by clicking text',
|
|
children: <p>{text}</p>,
|
|
},
|
|
]}
|
|
/>
|
|
<Collapse
|
|
collapsible="icon"
|
|
defaultActiveKey={['1']}
|
|
items={[
|
|
{
|
|
key: '1',
|
|
label: 'This panel can only be collapsed by clicking icon',
|
|
children: <p>{text}</p>,
|
|
},
|
|
]}
|
|
/>
|
|
<Collapse
|
|
collapsible="disabled"
|
|
items={[
|
|
{
|
|
key: '1',
|
|
label: "This panel can't be collapsed",
|
|
children: <p>{text}</p>,
|
|
},
|
|
]}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|
|
|