How specialised should research prior to tenure be?
This answer warns against being too narrow; see aeismail's answer for reasons not to be too broad.

The precise answer is going to depend on your institution and your field.  But as a first order approximation, you must establish yourself as an independent intellectual leader in a broad enough research area to attract good tenure letters.  An obscure subsubfield beloved by only ten researchers probably isn't going to be enough, because not all of those people will be credible references — well-known, active, full professors (preferably with named positions and Academy memberships) at top-ranked US departments (assuming you're at a US institution) who are not your advisor (and preferably are not your coauthors or from your PhD department either).

So your question becomes:


How large a field do you need to consider to include a sufficient number of viable tenure writers?
How you establish a world-class reputation within that field?


As a general rule in my field, you should move as far away from your PhD thesis as possible while still being visible and productive.  But other fields may have different expectations.