|
| 1 | +import React from "react"; |
| 2 | +import { |
| 3 | + Accordion, |
| 4 | + AccordionHeader, |
| 5 | + AccordionBody, |
| 6 | +} from "@material-tailwind/react"; |
| 7 | + |
| 8 | +export function AccordionCustomStyles() { |
| 9 | + const [open, setOpen] = React.useState(1); |
| 10 | + |
| 11 | + const handleOpen = (value) => setOpen(open === value ? 0 : value); |
| 12 | + |
| 13 | + return ( |
| 14 | + <> |
| 15 | + <Accordion |
| 16 | + open={open === 1} |
| 17 | + className="mb-2 rounded-lg border border-blue-gray-100 px-4" |
| 18 | + > |
| 19 | + <AccordionHeader |
| 20 | + onClick={() => handleOpen(1)} |
| 21 | + className={`border-b-0 transition-colors ${ |
| 22 | + open === 1 ? "text-blue-500 hover:!text-blue-700" : "" |
| 23 | + }`} |
| 24 | + > |
| 25 | + What is Material Tailwind? |
| 26 | + </AccordionHeader> |
| 27 | + <AccordionBody className="pt-0 text-base font-normal"> |
| 28 | + We're not always in the position that we want to be at. |
| 29 | + We're constantly growing. We're constantly making mistakes. |
| 30 | + We're constantly trying to express ourselves and actualize our |
| 31 | + dreams. |
| 32 | + </AccordionBody> |
| 33 | + </Accordion> |
| 34 | + <Accordion |
| 35 | + open={open === 2} |
| 36 | + className="mb-2 rounded-lg border border-blue-gray-100 px-4" |
| 37 | + > |
| 38 | + <AccordionHeader |
| 39 | + onClick={() => handleOpen(2)} |
| 40 | + className={`border-b-0 transition-colors ${ |
| 41 | + open === 2 ? "text-blue-500 hover:!text-blue-700" : "" |
| 42 | + }`} |
| 43 | + > |
| 44 | + How to use Material Tailwind? |
| 45 | + </AccordionHeader> |
| 46 | + <AccordionBody className="pt-0 text-base font-normal"> |
| 47 | + We're not always in the position that we want to be at. |
| 48 | + We're constantly growing. We're constantly making mistakes. |
| 49 | + We're constantly trying to express ourselves and actualize our |
| 50 | + dreams. |
| 51 | + </AccordionBody> |
| 52 | + </Accordion> |
| 53 | + <Accordion |
| 54 | + open={open === 3} |
| 55 | + className="rounded-lg border border-blue-gray-100 px-4" |
| 56 | + > |
| 57 | + <AccordionHeader |
| 58 | + onClick={() => handleOpen(3)} |
| 59 | + className={`border-b-0 transition-colors ${ |
| 60 | + open === 3 ? "text-blue-500 hover:!text-blue-700" : "" |
| 61 | + }`} |
| 62 | + > |
| 63 | + What can I do with Material Tailwind? |
| 64 | + </AccordionHeader> |
| 65 | + <AccordionBody className="pt-0 text-base font-normal"> |
| 66 | + We're not always in the position that we want to be at. |
| 67 | + We're constantly growing. We're constantly making mistakes. |
| 68 | + We're constantly trying to express ourselves and actualize our |
| 69 | + dreams. |
| 70 | + </AccordionBody> |
| 71 | + </Accordion> |
| 72 | + </> |
| 73 | + ); |
| 74 | +} |
0 commit comments