coreui-free-react-admin-template
177 строк · 9.6 Кб
1import React from 'react'2import {3CCard,4CCardBody,5CCardHeader,6CCol,7CRow,8CAccordion,9CAccordionBody,10CAccordionHeader,11CAccordionItem,12} from '@coreui/react'13import { DocsExample } from 'src/components'14
15const Accordion = () => {16return (17<CRow>18<CCol xs={12}>19<CCard className="mb-4">20<CCardHeader>21<strong>React Accordion</strong>22</CCardHeader>23<CCardBody>24<p className="text-body-secondary small">25Click the accordions below to expand/collapse the accordion content.26</p>27<DocsExample href="components/accordion">28<CAccordion activeItemKey={2}>29<CAccordionItem itemKey={1}>30<CAccordionHeader>Accordion Item #1</CAccordionHeader>31<CAccordionBody>32<strong>This is the first item's accordion body.</strong> It is hidden by33default, until the collapse plugin adds the appropriate classes that we use to34style each element. These classes control the overall appearance, as well as the35showing and hiding via CSS transitions. You can modify any of this with custom36CSS or overriding our default variables. It's also worth noting that just37about any HTML can go within the <code>.accordion-body</code>, though the38transition does limit overflow.39</CAccordionBody>40</CAccordionItem>41<CAccordionItem itemKey={2}>42<CAccordionHeader>Accordion Item #2</CAccordionHeader>43<CAccordionBody>44<strong>This is the second item's accordion body.</strong> It is hidden by45default, until the collapse plugin adds the appropriate classes that we use to46style each element. These classes control the overall appearance, as well as the47showing and hiding via CSS transitions. You can modify any of this with custom48CSS or overriding our default variables. It's also worth noting that just49about any HTML can go within the <code>.accordion-body</code>, though the50transition does limit overflow.51</CAccordionBody>52</CAccordionItem>53<CAccordionItem itemKey={3}>54<CAccordionHeader>Accordion Item #3</CAccordionHeader>55<CAccordionBody>56<strong>This is the second item's accordion body.</strong> It is hidden by57default, until the collapse plugin adds the appropriate classes that we use to58style each element. These classes control the overall appearance, as well as the59showing and hiding via CSS transitions. You can modify any of this with custom60CSS or overriding our default variables. It's also worth noting that just61about any HTML can go within the <code>.accordion-body</code>, though the62transition does limit overflow.63</CAccordionBody>64</CAccordionItem>65</CAccordion>66</DocsExample>67</CCardBody>68</CCard>69<CCard className="mb-4">70<CCardHeader>71<strong>React Accordion</strong> <small>Flush</small>72</CCardHeader>73<CCardBody>74<p className="text-body-secondary small">75Add <code>flush</code> to remove the default <code>background-color</code>, some76borders, and some rounded corners to render accordions edge-to-edge with their parent77container.78</p>79<DocsExample href="components/accordion#flush">80<CAccordion flush>81<CAccordionItem itemKey={1}>82<CAccordionHeader>Accordion Item #1</CAccordionHeader>83<CAccordionBody>84<strong>This is the first item's accordion body.</strong> It is hidden by85default, until the collapse plugin adds the appropriate classes that we use to86style each element. These classes control the overall appearance, as well as the87showing and hiding via CSS transitions. You can modify any of this with custom88CSS or overriding our default variables. It's also worth noting that just89about any HTML can go within the <code>.accordion-body</code>, though the90transition does limit overflow.91</CAccordionBody>92</CAccordionItem>93<CAccordionItem itemKey={2}>94<CAccordionHeader>Accordion Item #2</CAccordionHeader>95<CAccordionBody>96<strong>This is the second item's accordion body.</strong> It is hidden by97default, until the collapse plugin adds the appropriate classes that we use to98style each element. These classes control the overall appearance, as well as the99showing and hiding via CSS transitions. You can modify any of this with custom100CSS or overriding our default variables. It's also worth noting that just101about any HTML can go within the <code>.accordion-body</code>, though the102transition does limit overflow.103</CAccordionBody>104</CAccordionItem>105<CAccordionItem itemKey={3}>106<CAccordionHeader>Accordion Item #3</CAccordionHeader>107<CAccordionBody>108<strong>This is the second item's accordion body.</strong> It is hidden by109default, until the collapse plugin adds the appropriate classes that we use to110style each element. These classes control the overall appearance, as well as the111showing and hiding via CSS transitions. You can modify any of this with custom112CSS or overriding our default variables. It's also worth noting that just113about any HTML can go within the <code>.accordion-body</code>, though the114transition does limit overflow.115</CAccordionBody>116</CAccordionItem>117</CAccordion>118</DocsExample>119</CCardBody>120</CCard>121<CCard className="mb-4">122<CCardHeader>123<strong>React Accordion</strong> <small>Always open</small>124</CCardHeader>125<CCardBody>126<p className="text-body-secondary small">127Add <code>alwaysOpen</code> property to make accordion items stay open when another128item is opened.129</p>130<DocsExample href="components/accordion#flush">131<CAccordion alwaysOpen>132<CAccordionItem itemKey={1}>133<CAccordionHeader>Accordion Item #1</CAccordionHeader>134<CAccordionBody>135<strong>This is the first item's accordion body.</strong> It is hidden by136default, until the collapse plugin adds the appropriate classes that we use to137style each element. These classes control the overall appearance, as well as the138showing and hiding via CSS transitions. You can modify any of this with custom139CSS or overriding our default variables. It's also worth noting that just140about any HTML can go within the <code>.accordion-body</code>, though the141transition does limit overflow.142</CAccordionBody>143</CAccordionItem>144<CAccordionItem itemKey={2}>145<CAccordionHeader>Accordion Item #2</CAccordionHeader>146<CAccordionBody>147<strong>This is the second item's accordion body.</strong> It is hidden by148default, until the collapse plugin adds the appropriate classes that we use to149style each element. These classes control the overall appearance, as well as the150showing and hiding via CSS transitions. You can modify any of this with custom151CSS or overriding our default variables. It's also worth noting that just152about any HTML can go within the <code>.accordion-body</code>, though the153transition does limit overflow.154</CAccordionBody>155</CAccordionItem>156<CAccordionItem itemKey={3}>157<CAccordionHeader>Accordion Item #3</CAccordionHeader>158<CAccordionBody>159<strong>This is the second item's accordion body.</strong> It is hidden by160default, until the collapse plugin adds the appropriate classes that we use to161style each element. These classes control the overall appearance, as well as the162showing and hiding via CSS transitions. You can modify any of this with custom163CSS or overriding our default variables. It's also worth noting that just164about any HTML can go within the <code>.accordion-body</code>, though the165transition does limit overflow.166</CAccordionBody>167</CAccordionItem>168</CAccordion>169</DocsExample>170</CCardBody>171</CCard>172</CCol>173</CRow>174)175}
176
177export default Accordion178