@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
36 lines (35 loc) • 1.21 kB
TypeScript
import type { ComponentType, KeyboardEvent, MouseEvent, Ref } from 'react';
import type { CardProps } from './CardInner';
export type CardActionProps = Omit<CardProps, 'onClick' | 'element'> & {
/**
* The URL to navigate to. When set, renders an anchor element.
*/
href?: string;
/**
* Route path for use with a router Link component (e.g. react-router). Pass a custom `element` that accepts `to`.
*/
to?: string;
/**
* The anchor target attribute.
*/
target?: string;
/**
* The anchor rel attribute.
*/
rel?: string;
/**
* Click handler. When used without `href`/`to`, renders a button-like wrapper with keyboard support (Enter/Space).
*/
onClick?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;
/**
* Custom element to render as the wrapper. Defaults to `a` when `href`/`to` is set.
* Use this for router Link components.
*/
element?: 'a' | ComponentType<any>;
/**
* Ref forwarded to the wrapper element.
*/
ref?: Ref<HTMLElement>;
};
declare function CardAction(props: CardActionProps): import("react/jsx-runtime").JSX.Element;
export default CardAction;