summaryrefslogtreecommitdiffstats
path: root/src/ui/objects/CollapseCard.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/objects/CollapseCard.tsx')
-rw-r--r--src/ui/objects/CollapseCard.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/objects/CollapseCard.tsx b/src/ui/objects/CollapseCard.tsx
new file mode 100644
index 0000000..27e1ce2
--- /dev/null
+++ b/src/ui/objects/CollapseCard.tsx
@@ -0,0 +1,27 @@
1import { Card, type Props as CardProps } from "./Card.tsx";
2import { CardBody } from "./CardBody.tsx";
3import { Heading } from "./Heading.tsx";
4
5export type Props = CardProps<"details"> & {
6 "heading-level": "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
7 "title"?: JSX.Element;
8 "header"?: JSX.Element;
9};
10
11export const CollapseCard = ({
12 "heading-level": headingLevel,
13 children,
14 title,
15 header,
16 ...props
17}: Props) => (
18 <Card as="details" {...props}>
19 <CardBody as="summary">
20 <Heading as={headingLevel} class="u-mbs-0" level="lg">
21 {title}
22 </Heading>
23 {header}
24 </CardBody>
25 <CardBody>{children}</CardBody>
26 </Card>
27);