import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";
import * as AccordionStories from "./src/accordion.stories";
import packageInfo from "./package.json";
Accordion
Version {packageInfo.version}
Showcase
Properties
Installation
Via NPM
Add the dependency to your consumer app like "@purpurds/purpur": "^x.y.z"
In MyApp.tsx
import "@purpurds/purpur/styles";
In MyComponent.tsx
Default
import { Accordion } from "@purpurds/purpur";
export const MyComponent = () => {
return (
<Accordion title="Accordion title" titleVariant="title-100">
<Accordion.Item title="Section title" value="1">
Place body text here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at
rutrum nulla.
</Accordion.Item>
<Accordion.Item title="Section title" value="2">
Place body text here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at
rutrum nulla.
</Accordion.Item>
</Accordion>
);
};
Negative with custom content
export const MyComponent = () => {
return (
<Accordion negative title="Accordion title">
<Accordion.Item title="Section title1">
Place body text here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at
rutrum nulla.
<a href="https://telia.se">Link1</a>
</Accordion.Item>
<Accordion.Item title="Section title2">
Place body text here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at
rutrum nulla.
<a href="https://telia.se">Link2</a>
</Accordion.Item>
</Accordion>
);
};