Skip to content

Selectors

Selectors are the behavior layer of the Form Definition API. While gui.inputs.*, gui.layouts.*, etc. describe the form’s structure, gui.selectors.* describes how those widgets should look and behave — by type, by tag, or by uid — without you having to weave that behavior into every shortcut call.

A selector is built by chaining methods off the gui.selectors root, then matching a target type and supplying a config:

import { gui } from '@golemui/gui-shared';
const formSelectors = [
// Suppress auto-labels on every input
gui.selectors.inputs({ suppressAutomaticLabels: true }),
// For inputs tagged 'identity', also suppress auto-placeholders
gui.selectors.tag('identity').inputs({ suppressAutomaticPlaceholders: true }),
// Hide a specific dropdown by uid in a particular state
gui.selectors.state('loaded').dropdownByUid('country', { disabled: false }),
];

Pass the array as formSelectors on <gui-form>.