Search field

Search for the page you are on, named by what it covers. It is quiet until you use it: a symbol and two words, which grow into a field.

Part of a window whose header holds an open search field with the word lease in it and a clear button, over two files whose names start with Lease.

Use it in a page header, at the right of the page's path. It searches the page you are on and names what that covers: "Search Downloads" searches the folder and below, "Search Music" the whole library. It is not a command line, and what it finds is shown on the page, in the list the page already has.

Anatomy

An open search field with the word lease in it. Numbered callouts above it name the symbol, the words and the clear button, and one under it names the field's fill.
An open field with text in it.
  1. SymbolThe search symbol, 10 pixels from the left. It stays where it is as the field opens.
  2. WordsAt rest, "Search" and the scope, in the secondary ink; once the field is in use, what you typed, in the main ink.
  3. ClearA round button at the right, once there is text. It clears the text and keeps the keyboard in the field.
  4. FieldThe field's own colour fades in behind the same symbol and words, and the field grows to its open width.

States

Nothing moves when the field opens: the symbol and words stay where they were, and only the fill and the width change.

The search field five times, numbered: quiet, under the pointer, open and empty, with text and a clear button, and with the keyboard ring.
  1. QuietThe symbol and the words, with no fill. The field is as wide as the words and its padding.
  2. Pointer over itThe hover wash on the field's shape, and the symbol goes to the main ink. An open field has no hover wash: it already has its fill.
  3. OpenPressed, focused or holding text: the fill fades in and the field grows over 250 ms (arriveSmall).
  4. With textThe same, with the clear button.
  5. Keyboard focusThe ring around the field, corner 12 inside it. It shows only after a key.

Sizes

An open search field at one and a half times its size with its height of 36 pixels, its open width of 300, 10 pixels before the symbol and 26 from there to the words.
The field at 1.5 times its size.
PartValue
Height36
Open width300 by default (fieldWidth)
Quiet width36 before the words, the words, and 14 after
SymbolStarts 10 from the left
WordsStart 36 from the left; 15 pixels
Clear button32 pixels square, 2 from the right; its symbol 18 pixels
Corner12
FillThe container colour, at the window's own see-through

Keys and pointer

The field is one stop for Tab.

Do thisTo
Click, or Tab to itOpen it and type
EnterAccept (accepted)
↓Give the keyboard to the page's list (down)
EscClear the text; on an empty field, give the keyboard back and close (dismissed)

Accessibility

Writing

Name the scope in the field's words: "Search Downloads", "Search Music". Give the name of the place, not a general word, so a person sees what a search will cover before typing. No example query, no "Type to search".

Do and don't

A quiet search field reading Search Downloads.
DoSay what it covers. The field's scope becomes the end of its words and its name.
A quiet search field reading only Search.
Don'tLeave the scope out. Nobody can tell whether it searches this folder, this drive or everything.

Code

import Tacit.Kit

PageHeader {
    crumbs: ["Home"]; here: "Downloads"
    SearchField {
        id: search
        anchors.verticalCenter: parent.verticalCenter
        scope: "Downloads"                    // the field reads "Search Downloads"
        fieldWidth: 300
        onTextChanged: files.filter = text
        onDown: list.forceActiveFocus()       // ↓ goes to the list
    }
}
Property or signalWhat it does
scopeWhat the page covers: the field's words and its name
textWhat was typed
fieldWidthThe open width (300)
accepted(), dismissed(), down()Enter; Esc on an empty field; ↓
selectAll()Select the text, for a shortcut that focuses the field
openTrue while the field is in use (read only)

Experimental, in Tacit.Kit 0.1. Changed 25 October 2026: first version.