import QtQuick 2.15 import QtQuick.Controls 2.15 TextField { id: field property bool reveal: false signal revealClicked() implicitHeight: 52 leftPadding: 14 rightPadding: 46 echoMode: reveal ? TextInput.Normal : TextInput.Password color: "#ffffff" placeholderTextColor: "#5b6270" font.pixelSize: 15 background: Rectangle { radius: 7 color: "#303030" border.color: field.activeFocus ? "#3d7839" : "#303030" border.width: field.activeFocus ? 1.5 : 1 } Text { text: "\uD83D\uDC41" font.pixelSize: 16 color: field.reveal ? "#3d7839" : "#9ca3af" anchors.right: parent.right anchors.rightMargin: 14 anchors.verticalCenter: parent.verticalCenter } MouseArea { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter width: 40 height: 40 cursorShape: Qt.PointingHandCursor onClicked: field.revealClicked() } }