The structure たとたん(に) expresses that immediately after one event occurs, another event happens – often unexpectedly or suddenly. It emphasizes the surprising or involuntary nature of what follows. The kanji form is とたん途端.
Unlike other "as soon as" expressions such as ~たらすぐ or ~や否や, たとたん strongly implies that the second event was unplanned, involuntary, or surprising. Because of this, the second clause should not describe something the speaker intentionally decided to do.
✓
✗ 家に帰ったとたん、テレビをつけた。 (Unnatural – turning on the TV is intentional.)The particle に after とたん is optional. Both たとたん and たとたんに are used interchangeably with no significant difference in meaning.
The verb before とたん is always in the た-form (past tense). The overall sentence can describe past events (most common) or general observations. It is not typically used for future plans.