{"id":284,"date":"2019-10-04T05:48:36","date_gmt":"2019-10-04T05:48:36","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/reactify\/?page_id=284"},"modified":"2019-10-10T08:21:16","modified_gmt":"2019-10-10T08:21:16","slug":"expansion-panel","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/reactify\/expansion-panel\/","title":{"rendered":"Expansion Panel"},"content":{"rendered":"\n<p>You can add the component on any page in the template. You need to follow the steps given below: \u200c<\/p>\n\n\n\n<p><strong>Step 1:<\/strong> You need to create a state and function to handle it&#8217;s event. Also you need to add the code of expansion panel in the page where you want to add the component. Please check the code snippet given below, we have added the expansion panel in the Ecommerce Dashboard:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/**<br> * Ecommerce Dashboard<br> *\/<br> <br>import React, { Component } from 'react'<br>...<br> <br>export default class EcommerceDashboard extends Component {<br>    \/\/ Expansion Panel State<br>    state = {<br>      expanded: null,<br>    };<br> <br>   \/\/ Expansion Panel Function<br>   handleChange = panel => (event, expanded) => {<br>      this.setState({<br>          expanded: expanded ? panel : false,<br>      });<br>   };<br>   render() {<br>      ...<br>      return (<br>          &lt;div className=\"ecom-dashboard-wrapper\"><br>             ...<br>             \/\/ Expansion Panel Code<br>             &lt;div><br>                &lt;ExpansionPanel><br>                   &lt;ExpansionPanelSummary expandIcon={&lt;i className=\"zmdi zmdi-chevron-down\">&lt;\/i>}><br>                       &lt;Typography>Expansion Panel 1&lt;\/Typography><br>                   &lt;\/ExpansionPanelSummary><br>                   &lt;ExpansionPanelDetails><br>                       &lt;Typography>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,sit amet blandit leo lobortis eget.&lt;\/Typography><br>                   &lt;\/ExpansionPanelDetails><br>               &lt;\/ExpansionPanel><br>               ...<br>            &lt;\/div><br>          &lt;\/div><\/pre>\n\n\n\n<p><strong>Step 2:<\/strong> Now Import the component from its parent library.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import ExpansionPanel from '@material-ui\/core\/ExpansionPanel';<br>import ExpansionPanelDetails from '@material-ui\/core\/ExpansionPanelDetails';<br>import ExpansionPanelSummary from '@material-ui\/core\/ExpansionPanelSummary';<br>import Typography from '@material-ui\/core\/Typography';\u200c<br><\/pre>\n\n\n\n<p>We have given you an example of adding an expansion panel on the Ecommerce Dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"372\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/expansionpnl-1024x372.png\" alt=\"\" class=\"wp-image-502\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/expansionpnl-1024x372.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/expansionpnl-300x109.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/expansionpnl-768x279.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/expansionpnl.png 1304w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can check some other layouts of expansion panel below. For adding any of the below layout in the template, please check their relative code in the <code>src->routes->components->expansion-panel->components<\/code> folder.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"327\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl2-1024x327.png\" alt=\"\" class=\"wp-image-503\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl2-1024x327.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl2-300x96.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl2-768x245.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl2-1568x500.png 1568w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl2.png 1612w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"195\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl3-1024x195.png\" alt=\"\" class=\"wp-image-504\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl3-1024x195.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl3-300x57.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl3-768x146.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl3-1568x298.png 1568w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/exp-pnl3.png 1614w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"284\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">1    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"284\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>You can add the component on any page in the template. You need to follow the steps given below: \u200c Step 1: You need to create a state and function to handle it&#8217;s event. Also you need to add the code of expansion panel in the page where you want to add the component. Please [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":26,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/284"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/comments?post=284"}],"version-history":[{"count":4,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/284\/revisions"}],"predecessor-version":[{"id":505,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/284\/revisions\/505"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/media?parent=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}