@theme-ui/components
Version:
Primitive layout, typographic, and other components for use with Theme UI.
24 lines (23 loc) • 697 B
TypeScript
import React from 'react';
import { InputProps } from "./Input.js";
import { MarginProps } from "./util.js";
export interface FieldOwnProps extends MarginProps {
/**
* Text for Label component
*/
label?: string;
/**
* Used for the for, id, and name attributes
*/
name?: string;
}
export 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;