UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

37 lines 1.12 kB
import type { GenericSnapElement, SnapsChildren } from "../../component.cjs"; /** * The props of the {@link Form} component. * * @property children - The children of the form. * @property name - The name of the form. This is used to identify the form in * the event handler. */ export type FormProps = { children: SnapsChildren<GenericSnapElement>; name: string; }; /** * A form component, which is used to create a form. * * @param props - The props of the component. * @param props.children - The form fields. This should be a single field or an * array of fields. * @param props.name - The name of the form. This is used to identify the form * in the event handler. * @returns A form element. * @example * <Form name="my-form"> * <Field label="Username"> * <Input name="username" type="text" /> * </Field> * <Button type="submit">Submit</Button> * </Form> */ export declare const Form: import("../../component.cjs").SnapComponent<FormProps, "Form">; /** * A form element. * * @see Form */ export type FormElement = ReturnType<typeof Form>; //# sourceMappingURL=Form.d.cts.map