formkit-react
Version:
FormKit is a React library for building forms with ease.
10 lines (9 loc) • 728 B
JavaScript
import React from 'react';
export default function FormKitInput(_a) {
var name = _a.name, label = _a.label, _b = _a.type, type = _b === void 0 ? "text" : _b, _c = _a.required, required = _c === void 0 ? false : _c, placeholder = _a.placeholder, defaultValue = _a.defaultValue, pattern = _a.pattern;
return (React.createElement("div", { className: "formkit-input-container" },
label && (React.createElement("label", { htmlFor: name },
label,
required && React.createElement("span", { className: "required" }, "*"))),
React.createElement("input", { id: name, name: name, type: type, required: required, placeholder: placeholder, defaultValue: defaultValue, pattern: pattern })));
}