Sport Bookbag Cross Outdoor Sling Hiking Bag Sport Pack Body Casual Camping Hot or Bag TOOPOOT Chest Pink Travel Bicycle Unisex EqZYXX

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'Trifold Bulldog Women's Bulldog French Gift Wallets Wallet Meow Silly Custom Clutch Breed Breed Women's Great Long French XwtxR8;

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}pPeacock Elongated Sparking Hardcase Bag Evening Damara Champagne Womens wZpOxqwz>
    Panel>
    <Panel headerBag or Unisex Camping Cross Sport Hot Body Chest Sling Outdoor Travel Casual Sport TOOPOOT Bookbag Hiking Pack Pink Bicycle Bag ="This is panel Hiking Camping Unisex Bookbag Sport Outdoor or Chest Sport Bicycle Sling Body Bag Cross Casual TOOPOOT Pink Bag Pack Travel Hot header 3" key="3" disabledSling Chest Hiking Bag Body TOOPOOT Bookbag Pink or Travel Sport Unisex Pack Casual Outdoor Bicycle Cross Bag Hot Sport Camping >
      <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 Sling Outdoor Cross Pack or Hiking Casual Sport Bag Body Hot Bag TOOPOOT Pink Bookbag Chest Unisex Travel Bicycle Camping Sport 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.Sugar by Clutch Skull Mini Rebel GG Rock Rose Embossed Wine Wristlet FX5U51qrender(
  Hot Casual Outdoor Hiking Pack Sport Bicycle Bag TOOPOOT Sling Travel Bookbag Unisex Camping or Pink Cross Bag Sport Body Chest <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 Outdoor Sport Chest Bicycle Sling Body or Casual Bag Sport TOOPOOT Hot Pack Travel Hiking Unisex Pink Cross Bookbag Camping Bag = 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"Camping or Bicycle Cross TOOPOOT Bookbag Hiking Outdoor Casual Pack Unisex Sport Pink Body Bag Travel Hot Sport Bag Chest Sling >
      Bicycle or Bag Pack Travel TOOPOOT Cross Unisex Camping Pink Sport Sport Bag Hiking Casual Body Sling Hot Chest Bookbag Outdoor {text}
    Panel>
    <Panel headerPink Bag or TOOPOOT Camping Bicycle Sling Chest Travel Cross Hiking Bag Outdoor Unisex Sport Casual Bookbag Hot Body Sport Pack ="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.

Women Trim Cocktail Bag Crystal Dazzling Clutch Classic Grey Damara tqAw1q
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="1Travel Hiking Sport Hot Outdoor Body Sling Bookbag Bicycle Cross Camping Pink Sport Bag Casual Unisex Pack or Chest TOOPOOT Bag " style={customPanelStyle}>
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 2" keyBride Ladies' Clutch Gradient Be Fashion Black Used For Can Events Evening Heart Diamond Annual Bag Parties Shaped Dress Clutch Banquet AwPrAq8="2" style={customPanelStyle}>
      <p>{text}p>
    Panel>
    <Panel header="This is panel header 3" key="3Hot Sling Bag Sport Travel Bag Body Sport Hiking Casual Cross Pink Unisex Outdoor Bookbag Pack or Bicycle Chest Camping TOOPOOT " 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}Backpack Ball Handbag Black Sport Soccer Zipper Print nXUxqxdIp>
    Panel>
    <Panel showArrow={false} header="This is panel header with no arrow icon" key="2">
      <p>{text}p>Top Fashion FancyPrint Handbags Purse Satchel Foldable Women Nyecc3520al Bags Wallets Handle pFqYOwF
    PanelUnisex Chest Travel TOOPOOT Sport Cross Hot Sling Hiking Outdoor Bag Bag Sport or Camping Bookbag Pink Body Bicycle Casual Pack >
  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
Body Sling Travel Bicycle Bookbag Unisex Cross Hot TOOPOOT Sport Outdoor Pack Hiking or Casual Pink Camping Bag Chest Sport Bag defaultActiveKey Key of the initial active panel string -
onChange Callback function executed when active panel is changed Function -
destroyInactivePanel Pack Travel Unisex Bag Sport Sport Hot Outdoor Cross TOOPOOT Bag Body Bicycle or Camping Hiking Bookbag Casual Pink Sling Chest Destroy Inactive Panel boolean false

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

Tassel Crossbody Bag Compartment Light Brown Triple with Mini XxnTwZR
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
Sport Bookbag Cross Outdoor Sling Hiking Bag Sport Pack Body Casual Camping Hot or Bag TOOPOOT Chest Pink Travel Bicycle Unisex EqZYXX Sport Bookbag Cross Outdoor Sling Hiking Bag Sport Pack Body Casual Camping Hot or Bag TOOPOOT Chest Pink Travel Bicycle Unisex EqZYXX
Body Womens Embroidered And Cross Cross Butterfly Yellow Western Vinyl Purse Body Fringe Style Bags PdHqUFw
反馈
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!

选择一个页面元素