That’s the problem template languages solve. That button could be a partial, and you include it where you want a button. And with grep, you can track it down.
The problem with frameworks is with feature/need fit. Sometimes you need something simple and using a framework results in a big percentage of dead code. Or you extend it enough that there’s no longer any benefits.