UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

37 lines (36 loc) 967 B
import { ComponentProps, ReactNode } from 'react'; interface ErrorProps extends ComponentProps<"p"> { /** * Whether to hide the error if `children` is empty. * * When `true`, Error will not render if children is null, undefined, or empty string. * * When `false`, Error will still render empty UI, * guaranteeing consistent spacing and no jumps on errors. * @default false */ checkEmpty?: boolean; /** * The error message to display. */ children?: ReactNode; } /** * A component for displaying inline error messages in forms fields and other UI elements. * * @example * ```tsx * // Basic usage * <Error>This field is required</Error> * ``` * * @example * ```tsx * // With checkEmpty * <Error checkEmpty> * {formErrors.email} * </Error> * ``` */ export declare const Error: ({ children, className, checkEmpty, ...props }: ErrorProps) => import("react").JSX.Element | null; export {};