Hi Davi,
This is avaliable as-is in the control toolbar.
Look at the "Button" control in the toolbar: it has a super-small down arrow. If you click on it, you will have a lot of buttons available. You will see one with a contextual menu and the description says something like "button with contextual menu".
This is the one you are looking for.
Best regards.