import type { StringLike } from "@ariakit/core/form/types"; import type { ElementType } from "react"; import type { CollectionItemOptions } from "../collection/collection-item.tsx"; import type { Props } from "../utils/types.ts"; import type { FormStore } from "./form-store.ts"; declare const TagName = "div"; type TagName = typeof TagName; /** * Returns props to create a `FormDescription` component. * @see https://ariakit.com/components/form * @example * ```jsx * const store = useFormStore({ defaultValues: { password: "" } }); * const props = useFormDescription({ store, name: store.names.password }); *
* Password * * Password with at least 8 characters. * * ``` */ export declare const useFormDescription: import("../utils/types.ts").Hook<"div", FormDescriptionOptions<"div">>; /** * Renders a description element for a form field, which will automatically * receive an `aria-describedby` attribute pointing to this element. * @see https://ariakit.com/components/form * @example * ```jsx {10-12} * const form = useFormStore({ * defaultValues: { * password: "", * }, * }); * *
* Password * * * Password with at least 8 characters. * * * ``` */ export declare const FormDescription: (props: FormDescriptionProps) => import("react").ReactElement>; export interface FormDescriptionOptions extends CollectionItemOptions { /** * Object returned by the * [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not * provided, the closest [`Form`](https://ariakit.com/reference/form) or * [`FormProvider`](https://ariakit.com/reference/form-provider) components' * context will be used. */ store?: FormStore; /** * Name of the field described by this element. This can either be a string or * a reference to a field name from the * [`names`](https://ariakit.com/reference/use-form-store#names) object in the * store, for type safety. * @example * ```jsx * * Password with at least 8 characters. * * ``` */ name: StringLike; } export type FormDescriptionProps = Props>; export {};