Skip to main content
KVSelect(source, placeholder="Select a value", type="secret")

Example

from mirmod.controls import KVSelect

@wob.receiver("value", "api_key", control=KVSelect(source="https://api.example.com/keys", placeholder="Select an API key", type="secret"))
def receive_key(self, key):
  self.api_key = key

How It Works

The source URL should return a JSON array of objects with key and value properties:
[
  { "key": "Option 1", "value": "opt1" },
  { "key": "Option 2", "value": "opt2" }
]
When the user types in the search box, a ?search=<query> parameter is appended to the source URL, enabling server-side filtering.

Parameters

NameTypeDescription
sourcestringRequired. URL to a JSON endpoint returning key-value options.
placeholderstringHint text displayed when no option is selected. Default: “Select a value”.
typestringData type: "secret" or "model". Default: “secret”.