UNPKG

@payfit/unity-components

Version:

35 lines (34 loc) • 1.3 kB
import { ComponentPropsWithoutRef, ReactNode } from 'react'; import { DefinitionListContextValue } from './DefinitionList.context.js'; import * as React from 'react'; export interface DefinitionListProps extends Omit<ComponentPropsWithoutRef<'dl'>, 'children'> { /** * The layout of the definition list. * @default 'horizontal' */ layout?: DefinitionListContextValue['layout']; /** * Selects the visual treatment for definition rows. * @default 'default' */ variant?: DefinitionListContextValue['variant']; /** * Controls the row padding. * @default 'default' */ density?: DefinitionListContextValue['density']; /** * The content of the definition list, typically DefinitionItem components. */ children: ReactNode; } /** * DefinitionList provides a semantic HTML structure for displaying key-value pairs. * It uses a `<dl>` tag and manages the layout for its `DefinitionItem` children. * @example * <DefinitionList layout="horizontal"> * <DefinitionItem term="Last name" description="Doe" /> * <DefinitionItem term="First name" description="John" /> * </DefinitionList> */ export declare const DefinitionList: React.ForwardRefExoticComponent<DefinitionListProps & React.RefAttributes<HTMLDListElement>>;