Playground GitHub npm

Input

Single-line text field with focus ring and placeholder.

ui form

Preview

Installation

npx slintcn@latest add input

Usage

import { Input } from "slintcn/components/input.slint";

Input {
    placeholder: "you@example.com";
    text <=> email;
    edited(t) => { /* … */ }
}

Properties

text in-out string

Two-way bound to the field contents.

placeholder in string

Hint shown when the field is empty.

enabled in bool

When false, the input dims and stops accepting keystrokes.

read-only in bool

When true, the user can focus but not edit.

password in bool

When true, characters render as bullets.

auto-focus in bool

When true, the input grabs focus on mount.

edited callback (string)

Fired on every keystroke with the current text.

accepted callback (string)

Fired on Enter with the current text.

API

Accessibility
focusableyes
keyboardtext entry

Dependencies

theme only

Installed automatically as transitive dependencies of slintcn add input.