diff options
Diffstat (limited to 'src/ui/objects/Figure.tsx')
| -rw-r--r-- | src/ui/objects/Figure.tsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/objects/Figure.tsx b/src/ui/objects/Figure.tsx new file mode 100644 index 0000000..7f5e20a --- /dev/null +++ b/src/ui/objects/Figure.tsx | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | import type { HTMLAttributes } from "corvos/plugins/jsx.ts"; | ||
| 2 | |||
| 3 | export type Props = HTMLAttributes<"figure"> & { | ||
| 4 | children?: JSX.Element; | ||
| 5 | caption?: JSX.Element; | ||
| 6 | }; | ||
| 7 | |||
| 8 | export const Figure = ({ children, caption, class: cls, ...props }: Props) => ( | ||
| 9 | <figure class:list={["o-figure", cls]} {...props}> | ||
| 10 | {children} | ||
| 11 | {caption && <figcaption class="o-figure__caption">{caption}</figcaption>} | ||
| 12 | </figure> | ||
| 13 | ); | ||
