completion-table-dynamic
Dynamic completion tables (completion-table-dynamic, completion-table-in-turn, …) work well with Vertico. The requirement is that the ‘basic’ completion style is enabled. The ‘basic’ style performs prefix filtering by passing the input to the completion table (or the dynamic completion table function). The ‘basic’ completion style must not necessarily be configured with highest priority, it can also come after other completion styles like ‘orderless’, ‘substring’ or ‘flex’.
emacs-lisp
(setq completion-styles '(orderless basic))
(completing-read "Dynamic: "
(completion-table-dynamic
(lambda (str)
(list (concat str "1")
(concat str "2")
(concat str "3")))))