UNPKG

@theme-ui/components

Version:

Primitive layout, typographic, and other components for use with Theme UI.

24 lines (23 loc) 699 B
import React from 'react'; import { InputProps } from './Input'; import { MarginProps } from './util'; export interface FieldOwnProps extends MarginProps { /** * Text for Label component */ label?: string; /** * Used for the for, id, and name attributes */ name?: string; } export declare type FieldProps<T extends React.ElementType> = FieldOwnProps & Omit<React.ComponentPropsWithRef<T>, 'as' | keyof FieldOwnProps> & { /** * form control to render, default Input */ as?: T; }; export interface Field { <T extends React.ElementType = React.ComponentType<InputProps>>(props: FieldProps<T>): JSX.Element; } export declare const Field: Field;