A needle assembly (1) comprising a needle unit (2), where the needle unit (2) comprises a hub (6) with a skirt (3) having a longitudinal central axis (A), where the skirt (3) is having a proximal (7) and a distal end (8). The skirt is also having an internal surface adapted to interface with a mounting portion of a drug delivery device. The needle unit further comprises a needle cannula (30) having a proximal (31) and a distal (32) end, a central hub portion (5) holding the needle cannula (30), a transition portion (4) attached to the skirt portion (3), and wherein the transition portion (4) connects the skirt (3) with the central hub portion (5). The needle unit (2) is adapted to be switched between a retracted mode and an ejected mode. In the retracted mode, the distal end (32) of the needle cannula (30) is in a position which is proximal to the distal end (8) of the skirt (3), and the needle cannula (30) may be safely accommodated within the skirt (3). In the ejected mode, the distal end (32) of the needle cannula (30) is in a position which is distal to the distal end (8) of the skirt (3), and the needle cannula (30) may be ready for insertion. The transition portion (4) is adapted to deform, and thereby enable the switching between the modes, by allowing the central hub portion (5) to be moved in a longitudinal direction.