Door unit for rail vehicles, in particular for trains or subway trains, comprising: - at least one sliding door, - means for supporting and guiding said at least one sliding door between a closed position and an open position, - means for controlling the movement of said at least one door between a closed position and an open position, - wherein said means for supporting and guiding, and said controlling means are carried on a support unit which defines an independent module with said at least one door, assembled before being mounted on the structure of the vehicle, wherein said support unit includes at least one frame (6; 7; 8) connectable to the vehicle structure and carrying said at least one door, and respective guiding and controlling means, wherein said at least one frame (6; 7; 8) includes an upper cross-member (6b; 7b; 8b), a lower cross-member (6c; 7c; 8c) and two uprights (6a; 7a; 8a) connecting these cross-members between them, so as to form a perimeter frame that defines a doorway and which surrounds the four sides of said at least one door when it is in a closed position, and wherein in said closed position said at least one door only cooperates with parts of said at least one perimeter frame (6; 7; 8) to achieve the closure of the compartment door, said door unit being characterized in that said at least one frame comprises: a first perimeter frame, rigidly connectable to the vehicle structure, and a second perimeter frame supporting said means for supporting and guiding said at least one door and said controlling means of said at least one door, the second perimeter frame being supported by said first frame so as to be displaceable with respect to it in a horizontal direction orthogonal to the general plane of the door, between a retracted position and an advanced position with respect to the side of the vehicle, in order, in use in a rail vehicle, to reduce or eliminate any gap in the horizontal direction between the vehicle floor and the station platform said unit further comprising actuating means carried by said first frame, to control the horizontal movement of said second frame with respect to said first frame between the retracted position and the advanced position. - at least one sliding door, - means for supporting and guiding said at least one sliding door between a closed position and an open position, - means for controlling the movement of said at least one door between a closed position and an open position, - wherein said means for supporting and guiding, and said controlling means are carried on a support unit which defines an independent module with said at least one door, assembled before being mounted on the structure of the vehicle, wherein said support unit includes at least one frame (6; 7; 8) connectable to the vehicle structure and carrying said at least one door, and respective guiding and controlling means, wherein said at least one frame (6; 7; 8) includes an upper cross-member (6b; 7b; 8b), a lower cross-member (6c; 7c; 8c) and two uprights (6a; 7a; 8a) connecting these cross-members between them, so as to form a perimeter frame that defines a doorway and which surrounds the four sides of said at least one door when it is in a closed position, and wherein in said closed position said at least one door only cooperates with parts of said at least one perimeter frame (6; 7; 8) to achieve the closure of the compartment door, said door unit being characterized in that said at least one frame comprises: a first perimeter frame, rigidly connectable to the vehicle structure, and a second perimeter frame supporting said means for supporting and guiding said at least one door and said controlling means of said at least one door, the second perimeter frame being supported by said first frame so as to be displaceable with respect to it in a horizontal direction orthogonal to the general plane of the door, between a retracted position and an advanced position with respect to the side of the vehicle, in order, in use in a rail vehicle, to reduce or eliminate any gap in the horizontal direction between the vehicle floor and the station platform said unit further comprising actuating means carried by said first frame, to control the horizontal movement of said second frame with respect to said first frame between the retracted position and the advanced position. a first perimeter frame, rigidly connectable to the vehicle structure, and a second perimeter frame supporting said means for supporting and guiding said at least one door and said controlling means of said at least one door, the second perimeter frame being supported by said first frame so as to be displaceable with respect to it in a horizontal direction orthogonal to the general plane of the door, between a retracted position and an advanced position with respect to the side of the vehicle, in order, in use in a rail vehicle, to reduce or eliminate any gap in the horizontal direction between the vehicle floor and the station platform said unit further comprising actuating means carried by said first frame, to control the horizontal movement of said second frame with respect to said first frame between the retracted position and the advanced position.