I would be astonished to find a jurisdiction that did not allow you to tell your partner. Many places, your partner cannot even be compelled to testify against you, so unless your partner passed the information along, nobody would ever know. That said, in telling your partner, you do become responsible for whomever they tell, if you're in a jurisdiction that provides a reason for you to not tell whomever you want.
In any event, you can at least tell your partner that you need to find a new job, along with any headhunters, recruiters, or potential employers. There's nothing that says you'd need to explain. If pressed, you could always say, "I can't keep working there. I can't talk about it."
Looking at some of the other answers, I see people talking about layoff situations that significantly differ from my experience. I'm used to layoffs where there's generally roughly four weeks (at least in the US) between when the layoff details are "finalized" and when they take effect. In the first two weeks after that, the people who will be laid off are talked to individually and asked to keep things quiet, so that there's not panic and undue rumors. Then there's an internal general announcement, followed shortly afterwards by a media announcement, after which there's no more secrecy. The media announcement will probably be as low key as possible, so if you're not paying attention to the right news source to hear it, you won't.
They probably won't announce when the secrecy is over, though if you ask about how long they want you to keep it secret, they'll probably explain this. The secrecy is just to prevent rumors from spreading during the period when they're letting the people laid off know, and having people they're not laying off do extra job searching and having some of them leave. The media secrecy is because they can't tell the media before the company employees without rumors, even if they told all of the affected employees first.
If you're laid off with a process that doesn't have a general announcement of a layoff before you actually leave, I would personally be inclined to let your coworkers know you'll be leaving, but not why. I'd also be inclined to take the opportunity to make sure I had the contact information of any coworkers I wanted to stay in contact with, as it's much easier to get while one still has contact.
I've known some people in non-key roles handling notifying people about their exit and dissemminating their contact information with an email their last day saying, "This is my last day. I've enjoyed working with you all. Good luck on everything. My personal email address is ..." I've never heard any complaints about those people doing that, though a few times people asked their boss about the lack of two weeks notice. Invariably, the answer to those queries was, "I got two weeks notice. It's fine."
If I were working in an environment where a sudden layoff were understood to be possible, I would do a better job of being sure the people I wanted to remain in contact with had my personal contact information, to reduce the likelihood I'd need to collect contact information on my supprise last day when I'd probably be too frazzled to remember to do it.
As far as layoffs that are never announced go... I'm not sure how that differs from being fired. A lawyer from a jurisdiction where such a thing happened might be able to clarify that.