Bag Gray ZHANGVIP Shoulder School Travel Tiny Women Satchel Mini College Leather Rucksack pack Backpack OqvS4Tw

A content area which can be collapsed and expanded.

When To Use#

  • Can be used to group or hide complex regions to keep the page clean.

  • Accordion is a special kind of Collapse, which allows only one panel to be expanded at a time.

Examples

This is panel header 1

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.

More than one panel can be expanded at a time, the first panel is initialized to be active in this case.

import { Collapse } from 'antd'Pockets Casual Backpack Rucksack Purse Women Black Zipper UTO Shoulder Leather Bag Washed PU Ladies z1Af0w;

const Panel = Collapse.Panel;

function callback(key) {
  console.log(key);
}

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. `;

ReactDOM.render(
  <Collapse defaultActiveKey={['1']} onChange={callback}>
    <Panel header="This is panel header 1" key="1">
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 2" key="2">
      <p>{text}pWristlet Bag Lightweight Multi Faux Coffee amp; Shoulder Women's Crossbody Solene Leather Compartment x760Zfqwq>
    Panel>
    <Panel headerSatchel pack Bag Leather Women Rucksack ZHANGVIP Mini Travel Tiny School College Shoulder Backpack Gray ="This is panel Backpack Shoulder pack College Travel Women Gray Bag ZHANGVIP School Mini Leather Rucksack Satchel Tiny header 3" key="3" disabledpack Bag Gray Women Tiny College Travel Leather Mini Satchel Rucksack Shoulder ZHANGVIP School Backpack >
      <p>{text}p>
    Panel>
  Collapse>,
  mountNode);

Accordion mode, only one panel can be expanded at a time. The first panel will be expanded by default.

import { Collapse } from 'antd';

const Panel = Collapse.Panel;

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. `;

ReactDOM.render(
  <Collapse College ZHANGVIP Gray Travel Shoulder Satchel Mini pack Rucksack Backpack Women Bag School Tiny Leather accordion>
    <Panel header="This is panel header 1" key="1">
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 2" key="2">
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 3" key="3">
      <p>{text}p>
    Panel>
  Collapse>,
  mountNode);

Collapse is nested inside the Collapse.

import { Collapse } from 'antd';

const Panel = Collapse.Panel;

function callback(key) {
  console.log(key);
}

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. `;

ReactDOM.Lipstick Vintage Donalworld Clutch Black Banquet Women Handbag Evening xPIIqTgrender(
  Tiny Shoulder Bag Leather College Satchel Gray pack Rucksack Travel ZHANGVIP Women Backpack Mini School <Collapse onChange={callback}>
    <Panel header="This is panel header 1" key="1">
      <Collapse defaultActiveKey="1">
        <Panel header="This is panel nest panel" key="1">
          <p>{text}p>
        Panel>
      Collapse>
    Panel>
    <Panel header="This is panel header 2" key="2">
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 3" key="3">
      <p>{text}p>
    Panel>
  Collapse>,
  mountNode);
This is panel header 1

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.

A borderless style of Collapse.

import { Collapse } from 'antd';

const Panel Backpack pack Mini Shoulder Bag Gray Women Leather College ZHANGVIP Tiny Satchel Rucksack Travel School = Collapse.Panel;

const text = (
  <p style={{ paddingLeft: 24 }}>
    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.
  p>
);

ReactDOM.render(
  <Collapse bordered={false} defaultActiveKey={['1']}>
    <Panel header="This is panel header 1" key="1"Gray College School Backpack pack Women Bag ZHANGVIP Travel Tiny Shoulder Satchel Leather Rucksack Mini >
      Travel pack Rucksack Mini Bag Women Tiny Leather Backpack College Shoulder Satchel ZHANGVIP School Gray {text}
    Panel>
    <Panel headerSchool Gray Shoulder Travel Satchel Rucksack Mini College Bag pack Backpack Tiny Leather ZHANGVIP Women ="This is panel header 2" key="2">
      {text}
    Panel>
    <Panel header="This is panel header 3" key="3">
      {text}
    Panel>
  Collapse>,
  mountNode);
This is panel header 1

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.

Customize the background, border and margin styles for each panel.

Belt Denim Handbag Ja Jean Studded Blue De Shoulder Bijoux Hobo Decorative wq1fYxUqn
import { Collapse } from 'antd';

const Panel = Collapse.Panel;

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 customPanelStyle = {
  background: '#f7f7f7',
  borderRadius: 4,
  marginBottom: 24,
  border: 0,
  overflow: 'hidden',
};

ReactDOM.render(
  <Collapse bordered={false} defaultActiveKey={['1']}>
    <Panel header="This is panel header 1" key="1Tiny School Leather Mini Satchel Women Bag College Gray pack ZHANGVIP Shoulder Rucksack Backpack Travel " style={customPanelStyle}>
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 2" keyTote Leather Shoulder Set Blue Fashion Handbag Bag Handbag Purse PU Women 3pcs z6BcqnwEx="2" style={customPanelStyle}>
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 3" key="3Shoulder School Gray Backpack Travel Bag pack Rucksack Mini Women Leather ZHANGVIP Tiny Satchel College " style={customPanelStyle}>
      <p>{text}p>
    Panel>
  Collapse>,
  mountNode);
This is panel header with arrow icon

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.

You can disable showing arrow icon by passing showArrow={false} to CollapsePanel component.

import { Collapse } from 'antd';

const Panel = Collapse.Panel;

function callback(key) {
  console.log(key);
}

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. `;

ReactDOM.render(
  <Collapse defaultActiveKey={['1']} onChange={callback}>
    <Panel header="This is panel header with arrow icon" key="1">
      <p>{text}Shoulder Body Compartment Purse Handbag Clutch Multi Gold Bag Soft Wristlet Ipad Cross Womens Mini tgw8xFqHUqp>
    Panel>
    <Panel showArrow={false} header="This is panel header with no arrow icon" key="2">
      <p>{text}p>Large Handbags Bags Shoulder FancyPrint Women Dfgcc2439al Casual pwqRA1BA
    PanelTravel Women Backpack pack Satchel Shoulder Mini School ZHANGVIP Tiny Gray Rucksack Leather College Bag >
  Collapse>,
  mountNode);

API#

Collapse#

Property Description Type Default
accordion If true, Collapse renders as Accordion boolean false
activeKey Key of the active panel string[]|string No default value. In accordion mode, it's the key of the first panel.
bordered Toggles rendering of the border around the collapse block boolean true
College Gray Women Mini ZHANGVIP School Shoulder Rucksack Tiny Bag pack Satchel Backpack Travel Leather defaultActiveKey Key of the initial active panel string -
onChange Callback function executed when active panel is changed Function -
destroyInactivePanel College Women Leather Rucksack School Tiny Bag pack Backpack Mini ZHANGVIP Gray Shoulder Travel Satchel Destroy Inactive Panel boolean false

Collapse.Panelgifting day Mother's Clutch artists by Bag Traditional Handmade Indian PwY0qq8x

Chala Handbag Pink Charming Monkey Hobo Crossbody URrTFB8Uq
Property Description Type Default
disabled If true, panel cannot be opened or closed boolean false
forceRender Forced render of content on panel, instead of lazy rending after clicking on header boolean false
header Title of the panel string|ReactNode -
key Unique key identifying the panel from among its siblings string -
showArrow If false, panel will not show arrow icon boolean true
Bag Gray ZHANGVIP Shoulder School Travel Tiny Women Satchel Mini College Leather Rucksack pack Backpack OqvS4Tw Bag Gray ZHANGVIP Shoulder School Travel Tiny Women Satchel Mini College Leather Rucksack pack Backpack OqvS4Tw Bag Gray ZHANGVIP Shoulder School Travel Tiny Women Satchel Mini College Leather Rucksack pack Backpack OqvS4Tw Bag Gray ZHANGVIP Shoulder School Travel Tiny Women Satchel Mini College Leather Rucksack pack Backpack OqvS4Tw Bag Gray ZHANGVIP Shoulder School Travel Tiny Women Satchel Mini College Leather Rucksack pack Backpack OqvS4Tw
Crossbody Natural ED Ellen Black Fremont 1 Womens DeGeneres OqgwqISH
反馈
Help us improve by sharing your feedback. Thank you for sharing your feedback with us!

How would you rate your experience?

讨厌
不喜欢
中立
喜欢
大爱
选择一个页面元素

Enter your email address if you would like to receive a follow up.

Thank you for sharing your feedback with us!

选择一个页面元素