@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
23 lines (22 loc) • 833 B
TypeScript
import type { JSX } from 'preact';
import type { PresentationalProps } from '../../types';
type ComponentProps = {
title?: string;
/**
* Optional callback for close-button click. When present, a close button
* will be rendered.
*/
onClose?: () => void;
/**
* Make the header take the full width of the Card, with a full-width border
*/
fullWidth?: boolean;
variant?: 'primary' | 'secondary';
};
type HTMLAttributes = JSX.HTMLAttributes<HTMLElement>;
export type CardHeaderProps = PresentationalProps & ComponentProps & HTMLAttributes;
/**
* Render a header area in a Card with optional title and/or close button
*/
export default function CardHeader({ children, classes, elementRef, fullWidth, onClose, title, variant, ...htmlAttributes }: CardHeaderProps): JSX.Element;
export {};