mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* refactor: improve dx for writing a docs component (#2544) * refactor: improve dx for write a docs component Signed-off-by: Innei <i@innei.in> * refactor(docs): switch to contentlayer2 * chore(docs): rename to avoid conflict * refactor(docs): switch to next-contentlayer2 * refactor(docs): revise docs lib * chore(deps): bump docs related dependencies * fix(use-aria-multiselect): type issue due to ts version bump --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: WK Wong <wingkwong.code@gmail.com> * refactor(docs): accordion codes * feat(docs): declare module `*.jsx?raw` * feat(docs): include `**/*.jsx` * fix(docs): incorrect content * chore(docs): add new lines * refactor(docs): lint --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: Innei <tukon479@gmail.com>
25 lines
1005 B
TypeScript
25 lines
1005 B
TypeScript
import type {Selection} from "@nextui-org/react";
|
|
|
|
import React from "react";
|
|
import {Accordion, AccordionItem} from "@nextui-org/react";
|
|
|
|
export default function App() {
|
|
const [selectedKeys, setSelectedKeys] = React.useState<Selection>(new Set(["1"]));
|
|
const defaultContent =
|
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
|
|
|
|
return (
|
|
<Accordion selectedKeys={selectedKeys} onSelectionChange={setSelectedKeys}>
|
|
<AccordionItem key="1" aria-label="Accordion 1" title="Accordion 1">
|
|
{defaultContent}
|
|
</AccordionItem>
|
|
<AccordionItem key="2" aria-label="Accordion 2" title="Accordion 2">
|
|
{defaultContent}
|
|
</AccordionItem>
|
|
<AccordionItem key="3" aria-label="Accordion 3" title="Accordion 3">
|
|
{defaultContent}
|
|
</AccordionItem>
|
|
</Accordion>
|
|
);
|
|
}
|