@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
29 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Input = void 0;
const component_1 = require("../../component.cjs");
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} />
*/
exports.Input = (0, component_1.createSnapComponent)(TYPE);
//# sourceMappingURL=Input.cjs.map