UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

45 lines (44 loc) 1.31 kB
import { FieldRootProps } from '@ark-ui/react/field'; import { CerberusPrimitiveProps } from '../../system/types'; export interface FieldProps extends FieldRootProps { /** * The label of the field. */ label?: string; /** * The helper text of the field. */ helperText?: string; /** * A helper text positioned at the end of the field. Good for Textarea fields. */ secondaryHelperText?: string; /** * The error text of the field. Shown when the field is invalid. */ errorText?: string; /** * Whether to hide the label visually while keeping it accessible to screen readers. */ hideLabel?: boolean; } /** * The Field component is the context provider for all FieldParts and displays * the label, helperText, and ErrorText. * @description [Field Docs](https://cerberus.digitalu.design/react/field) * @example * ```tsx * <Field * ids={{ * control: 'firstName', * }} * label="Label" * helperText="This is what people will see on your profile." * errorText="A first name is required to create an account." * required * > * <Input name="firstName" type="text" /> * </Field> * ``` */ export declare function Field(props: CerberusPrimitiveProps<FieldProps>): import("react/jsx-runtime").JSX.Element;