Expandable content sections with ASCII-style indicators for organizing information.
Import components and start building your retro interface:
import { AsciiButton, AsciiInput } from 'react-ascii-ui';npm install react-ascii-ui
import { AsciiAccordion } from 'react-ascii-ui';
const items = [
{
title: "Section 1",
content: "Content for the first section",
defaultOpen: true
},
{
title: "Section 2",
content: "Content for the second section"
}
];
export default function Example() {
return <AsciiAccordion items={items} />;
}const items = [
{ title: "First Item", content: "Content of the first item" },
{ title: "Second Item", content: "Content of the second item" }
];
<AsciiAccordion items={items} />const items = [
{ title: "Always Closed", content: "This starts closed" },
{ title: "Initially Open", content: "Expanded by default", defaultOpen: true }
];
<AsciiAccordion items={items} /><AsciiAccordion
items={items}
allowMultiple
/>| Prop | Type | Default | Description |
|---|---|---|---|
| items | AsciiAccordionItem[] | - | Array of accordion items to display |
| allowMultiple | boolean | false | Whether multiple sections can be open simultaneously |
| className | string | "" | Additional CSS classes |
| Property | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | The header text for the accordion item |
| content | React.ReactNode | Yes | The content to show when expanded |
| defaultOpen | boolean | No | Whether this item should start expanded |
AsciiAccordion extends all HTML div attributes and React.HTMLAttributes.