Controls
Two controls on this page stand on their own rather than inside a boxed list. A
single-line entry takes typed text, and a drop down picks one value out
of a list. Both belong to GTK. They are Gtk.Entry and Gtk.DropDown,
libadwaita ships neither, and the Adwaita stylesheet gives them their GNOME look.
Each has a boxed-list twin, Adw.EntryRow and Adw.ComboRow, documented under
Boxed Lists. Which one you want is a question
about the surrounding layout rather than about the control. A preferences page
uses the rows, a toolbar or a dialog uses these.
Each block below is a stack of windows. The first one RUNS the widget: the preview
is the live browser port, so it follows the light and dark toggle the way a real
window would, and the HTML tab beside it holds the very markup that paints it —
one import '@gjsify/adwaita-web' registers every element in it. Then comes
one window per kind of implementation — Native TypeScript, the @girs program
that runs unchanged on GJS, Node, Bun and Deno, with the matching Blueprint
declaration beside it, UI frameworks, the same widget written in Solid, Vue and
React through @gjsify/gtk-host — or, where the widget is built imperatively rather
than declared, the recorded reason it has no such snippet — and NativeScript,
the port that runs on a phone. That last window splits the way the first one does. An
XML template holds the tree, and the TypeScript beside it is the loader.
GTK 4 is the reference here, typed by
@girs/gtk-4.0. The browser port
spells both controls the way the GIR does — <gtk-entry> and <gtk-drop-down>,
the same tags @gjsify/gtk-host uses — because a widget is named after the library
that owns it and the Adwaita part of these two is the stylesheet. The NativeScript
port names them by the same rule, GtkEntry and GtkDropDown. Where a port behaves
differently, its own window says so.
A single-line text field. Give it a placeholder to say what belongs in it
while it is empty, a value for the text itself, and disabled when it should
be read-only. For a field that belongs in a preferences group, use
Entry Row instead. It is the same
control in row presentation, and the label doubles as the row title.
Drop Down
Section titled “Drop Down”Pick one value from a list. The button shows the current selection and the list
opens in a popover; selected is the zero-based index of the chosen option,
and enable-search adds a filter field for a long list. For the same choice
presented as a boxed-list row, use
Combo Row.
Related
Section titled “Related”- Buttons: the plain button, its style classes and the menu button.
- Boxed Lists: the row twins of both controls, entry row, password entry row, combo row and spin row.
- Adwaita Storybook: the same widgets in a live component browser you can poke at.