shelving
Version:
Toolkit for using data in JavaScript.
16 lines (15 loc) • 863 B
TypeScript
import type { ReactElement, ReactNode } from "react";
import type { ImmutableArray } from "../../util/array.js";
import type { ValueInputProps } from "./Input.js";
export interface ArrayRadioInputsProps<T> extends ValueInputProps<T> {
/** Array of values to show in the list of radios. */
items: ImmutableArray<T>;
/** Function that formats an obscure item into a `ReactNode` for display. */
formatter?: ((value: T) => ReactNode) | undefined;
}
/**
* Output a list of `<RadioInput>` elements for each item in an array.
* - The items can be any type, and can be formatted for output through an optional `formatter()` function.
* - A `placeholder` option is shown at the bottom if `required=false`.
*/
export declare function ArrayRadioInputs<T>({ value, onValue, required, items, formatter, ...props }: ArrayRadioInputsProps<T>): ReactElement;