Actions give you the ability to control your button after initialization. One can hide, show, disable, enable, and change a button's label, only by knowing its action name.
Although in most cases this won't be needed, this plug-in still gives you the ability to fine-control and dynamically update your buttons.
In the following example, we've given the "Update Rows" button an action name of "custom-update-rows". Make sure the action name you provide does not conflict with an already existing action name from the list mentioned above.
Then separately, in its own Dynamic Action listening on selection change of the grid, we execute the following:
var actionName = 'custom-update-rows';
var regionId = this.triggeringElement.id;
var region = apex.region(regionId);
var selCount = this.data.selectedRecords.length;
// change the button label
region.call('getActions').lookup(actionName).label = `Update ${selCount} Row${selCount != 1 ? 's' : ''}`;
region.call('getToolbar').toolbar('refresh');
Take it for a spin! As you select or deselect records, the button will update accordingly.
Note: disabling/enabling the button could also be done via JavaScript in a similar way, but this plug-in provides a declarative option, namely "Disable On No Selection" that does it for you. It is toggled on for this example.