Madeleine Westerhout's office was in front of the Oval Office.

Donald Trump's personal assistant Madeleine Westerhout resigned on Thursday after she shared information about the president's family with journalists, US media reported.

Westerhout's unexpected departure came after Trump learned that she had talked about his family and White House matters with reporters at an off-the-record session during the president's recent working vacation in New Jersey, The New York Times reported citing unnamed sources.

Later, other outlets -- including CNN and Politico -- also reported her departure citing unnamed sources.

CNN said Westerhout had failed to make clear during the interaction with journalists that her comments were off the record, and one reporter disclosed the conversation to the White House.

Westerhout's office was in front of the Oval Office and she had been described as Trump's "gatekeeper" in US media. She had been his personal assistant from the beginning of his presidency.

The Trump administration has been particularly sensitive about staff leaking information to the media, with the president railing against both officials and journalists over reports about the state of affairs in the White House.

The New York Times said Westerhout was now a "separated employee" and would not be allowed into the White House.

A former administration official described Trump and Westerhout's relationship as "close", CNN said, but added that talking about his family was "a red line".

Westerhout was not a high-profile staffer, but her exit adds to a long list of administration officials who have quit since Donald Trump was elected president in 2016.