In the 2011 District Council elections, Hui successfully succeeded veteran Yuen Bun-keung's Central and Western District Council seat in the Chung Wan constituency which covers the Central area. Hui first caught media attention for his protests in the council. In 2014, he was ejected from a meeting of the council's working group on civic education when protesting the council's decision to grant HK$150,000 to pro-Beijing groups. Hui complained that there was a conflict of interest because several of the councillors were members of or advisers to the recipients. In the process of ejection, he was injured by council security personnel, resulting in his party's demand for an apology from the district office. Hui was considered to be quite radical within the Democratic Party. He opposed the party's meetings with Beijing officials. In 2015, when the party's central committee member Wong Sing-chi publicly called on pan-democrats to back Beijing's restrictive reform model for the 2017 Chief Executive election, Hui led a call for the party to investigate whether Wong had violated any of its internal rules. Wong was expelled from the party.
Legislative Council
Hui ran in the Democratic Party's intra-party primary for candidacy in Hong Kong Island in the 2016 Legislative Council Elections and won against Wilfred Chong Wing-fai and officially assumed office on 1 October 2016. Hui has been vocal on environmental issues, education, human rights and democracy. He was very much involved in pushing for the banning of ivory trade in Hong Kong. Hui also shows high concerns on the erosion of freedoms in Hong Kong and encourages the international community to speak up for Hong Kong. He was also active during the debate over the controversial Hong Kong Express Rail Link co-location controversy. In April 2018, Hui was under police investigation for snatching a Security Bureau executive officer's phone and taking it to a Legislative Council Complex toilet on 24 April 2018. The Democratic Party suspended the lawmaker and criticized him for seriously tarnishing the reputation of lawmakers. Hui later apologized to the executive officer and admitted that his action was "not appropriate". Hui, however, claimed that the employee had been "recording the entry and exit time of lawmakers", including himself, into a meeting room and the Legco complex. He alleged that there was a breach of the privacy ordinance. Hui was charged with three offences, including common assault, dishonest access to a computer and obstructing a public officer in the execution of their duties. Hui pleaded not guilty to all three charges. In May 2019, Hui was found guilty of one count of common assault on a senior executive officer. In July 2020, Hui faces a censure motion at the Legislative Council for phone snatching. On 28 May 2020, Hui disrupted the second reading of the National Anthem Bill in the Legislative Council by dropping a container containing rotten plant matter inside the chamber. A fellow lawmaker was taken to hospital after being exposed to the smell. On 4 June 2020, Hui and two other lawmakers, Eddie Chu and Raymond Chan, were alleged with hindering the business of the Legislative Council and violating the Powers and Privileges Ordinance, with Hui having dropped foul smelling liquid during the LegCo session on that day. Hui was subsequently fined HK$52,000 for his misconduct.
Personal life
Hui blogs about his two children and promotes family-friendly policies.