How to create a chooser button to choose categories?

See how the categories chooser is implemented on a backend product’s screen.