@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
26 lines • 1.11 kB
JavaScript
import { createSnapComponent } from "../../component.mjs";
const TYPE = 'Input';
/**
* An input component, which is used to create an input field.
*
* @param props - The props of the component.
* @param props.name - The name of the input field. This is used to identify the
* input field in the form data.
* @param props.type - The type of the input field.
* @param props.value - The value of the input field.
* @param props.placeholder - The placeholder text of the input field.
* @param props.min - The minimum value of the input field.
* Only applicable to the type `number` input.
* @param props.max - The maximum value of the input field.
* Only applicable to the type `number` input.
* @param props.step - The step value of the input field.
* Only applicable to the type `number` input.
* @param props.disabled - Whether the input is disabled.
* @returns An input element.
* @example
* <Input name="username" type="text" />
* @example
* <Input name="numeric" type="number" min={1} max={100} step={1} />
*/
export const Input = createSnapComponent(TYPE);
//# sourceMappingURL=Input.mjs.map