Skip to content
โ Password Input
Edit Password Input
Name
Also known as (comma separated)
Brief definition
Obscured text input.
Notes
**Authentication & Security UI:** Password entry control.
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "label", "type": "text", "label": "Label", "default": "Password" }, { "id": "placeholder", "type": "text", "label": "Placeholder", "default": "Enter your password" }, { "id": "showToggle", "type": "toggle", "label": "Show reveal button", "default": true }, { "id": "accent", "type": "color", "label": "Focus colour", "default": "#241430", "presets": [ "#241430", "#A8E6C1", "#F5C2E0", "#BFD9F2", "#D9C8F0", "#E8A020" ] }, { "id": "required", "type": "toggle", "label": "Required", "default": true } ]
Templates (JSON object keyed by format)
{ "html": "<label class=\"pw\" for=\"pw-1\">\n <span class=\"pw__label\">{{label}}{{#if required}} <span class=\"pw__req\">*</span>{{/if}}</span>\n <span class=\"pw__row\">\n <input class=\"pw__input\" id=\"pw-1\" type=\"password\" placeholder=\"{{placeholder}}\" autocomplete=\"current-password\" style=\"--accent:{{accent}};\"{{#if required}} required{{/if}}>\n {{#if showToggle}}<span class=\"pw__reveal\" tabindex=\"0\" role=\"button\" aria-label=\"Show password\">👁</span>{{/if}}\n </span>\n</label>\n<style>\n.pw { display: block; font: 14px system-ui, sans-serif; color: #241430; max-width: 260px; }\n.pw__label { display: block; margin-bottom: 6px; font-weight: 500; }\n.pw__req { color: #241430; }\n.pw__row { position: relative; display: block; }\n.pw__input { width: 100%; box-sizing: border-box; padding: 10px 38px 10px 12px; font: inherit; color: #241430; background: #FAF7F2; border: 1.5px solid #24143040; border-radius: 8px; }\n.pw__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }\n.pw__reveal { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; }\n.pw__reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }\n</style>", "tailwind": "<label class=\"block max-w-[260px] font-sans text-sm text-[#241430]\" for=\"pw-tw-1\">\n <span class=\"block mb-1.5 font-medium\">{{label}}{{#if required}} <span>*</span>{{/if}}</span>\n <span class=\"relative block\">\n <input id=\"pw-tw-1\" type=\"password\" placeholder=\"{{placeholder}}\" autocomplete=\"current-password\"{{#if required}} required{{/if}}\n class=\"w-full box-border pl-3 pr-10 py-2.5 bg-[#FAF7F2] border-[1.5px] border-[#24143040] rounded-lg focus-visible:outline-none\" style=\"border-color:{{accent}};\">\n {{#if showToggle}}<span tabindex=\"0\" role=\"button\" aria-label=\"Show password\" class=\"absolute right-2.5 top-1/2 -translate-y-1/2 cursor-pointer\">👁</span>{{/if}}\n </span>\n</label>", "react": "export function PasswordInput({\n label = \"{{label}}\",\n placeholder = \"{{placeholder}}\",\n showToggle = {{showToggle}},\n accent = \"{{accent}}\",\n required = {{required}},\n}) {\n return (\n <label style={{ display: \"block\", maxWidth: 260, fontFamily: \"system-ui, sans-serif\", fontSize: 14, color: \"#241430\" }}>\n <span style={{ display: \"block\", marginBottom: 6, fontWeight: 500 }}>{label}{required && \" *\"}</span>\n <span style={{ position: \"relative\", display: \"block\" }}>\n <input type=\"password\" placeholder={placeholder} autoComplete=\"current-password\" required={required} style={{\n width: \"100%\", boxSizing: \"border-box\", padding: \"10px 38px 10px 12px\", font: \"inherit\", color: \"#241430\",\n background: \"#FAF7F2\", border: `1.5px solid ${accent}`, borderRadius: 8,\n }} />\n {showToggle && (\n <span tabIndex={0} role=\"button\" aria-label=\"Show password\" style={{ position: \"absolute\", right: 10, top: \"50%\", transform: \"translateY(-50%)\", cursor: \"pointer\" }}>\n ๐\n </span>\n )}\n </span>\n </label>\n );\n}" }
Save
History