UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

27 lines (26 loc) 1.07 kB
import { FieldOptions, WithoutLabel } from 'alinea/core/Field'; import { ScalarField } from 'alinea/core/field/ScalarField'; import type { ComponentType } from 'react'; /** Optional settings to configure a text field */ export interface TextOptions extends FieldOptions<string> { /** Width of the field in the dashboard UI (0-1) */ width?: number; /** Add instructional text to a field */ help?: string; /** Field is optional */ optional?: boolean; /** Allow line breaks */ multiline?: boolean; /** Display a minimal version */ inline?: boolean; /** An icon (React component) to display on the left side of the input */ iconLeft?: ComponentType; /** An icon (React component) to display on the right side of the input */ iconRight?: ComponentType; /** Focus this input automatically */ autoFocus?: boolean; } export declare class TextField extends ScalarField<string, TextOptions> { } /** Create a text field */ export declare function text(label: string, options?: WithoutLabel<TextOptions>): TextField;