UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

51 lines (50 loc) 1.94 kB
/** * Web RadioGroup Component */ import React from 'react'; import type { FormStatusBaseProps, FormStatusText, FormStatusState } from '../FormStatus'; import type { SkeletonShow } from '../Skeleton'; import type { SpacingProps } from '../../shared/types'; export type RadioGroupLabelPosition = 'left' | 'right'; export type RadioGroupSize = 'default' | 'medium' | 'large'; export type RadioGroupSuffix = string | React.ReactNode; export type RadioGroupLayoutDirection = 'column' | 'row'; export type RadioGroupAttributes = string | Record<string, unknown>; export type RadioGroupChildren = string | React.ReactNode; export type RadioGroupChangeEvent = { value: string; event: React.SyntheticEvent; }; export type RadioGroupProps = { label?: React.ReactNode; labelDirection?: 'vertical' | 'horizontal'; labelSrOnly?: boolean; labelPosition?: RadioGroupLabelPosition; title?: string; disabled?: boolean; skeleton?: SkeletonShow; id?: string; name?: string; size?: RadioGroupSize; status?: FormStatusText; statusState?: FormStatusState; statusProps?: FormStatusBaseProps; statusNoAnimation?: boolean; globalStatus?: FormStatusBaseProps['globalStatus']; suffix?: RadioGroupSuffix; vertical?: boolean; layoutDirection?: RadioGroupLayoutDirection; value?: string; attributes?: RadioGroupAttributes; style?: React.CSSProperties; className?: string; children?: RadioGroupChildren; onChange?: (event: RadioGroupChangeEvent) => void; } & SpacingProps; declare const parseChecked: (state: string | boolean | null | undefined) => boolean; /** * The radio component is our enhancement of the classic radio button. It acts like a radio. Example: On/off, yes/no. */ declare function RadioGroup(ownProps: RadioGroupProps): import("react/jsx-runtime").JSX.Element; export { parseChecked as RadioGroupParseChecked }; export default RadioGroup;