SHANGHAI, Aug 7 (Reuters) - China stocks edged up on Wednesday as the country's trade data showed a robust growth in imports, while weaker-than-expected export data capped gains. Hong Kong shares also rose.

** China's exports climbed 7.0% in July from a year earlier, a slower pace of growth than June and missing forecasts of a 9.7% increase. However, imports rose at a robust 7.2% rate, customs data showed on Wednesday.

** Exports benefited from a low base of comparison and more working days in the month compared with last year, said UBS analysts.

"So a note of caution is warranted for the outlook on exports, which are so far a key support for China's weak economy."

** By the midday break, the Shanghai Composite index rose 0.31% at 2,876.17 points and the blue-chip CSI 300 index rose 0.18%.

** The CSI energy index was up 1.8%, but consumer staples slipped 0.16%, real estate lost 1.55% and healthcare fell 0.44%.

** Chinese H-shares listed in Hong Kong rose 1.34% to 5,931.17, while the Hang Seng Index was up 1.31% at 16,864.92.

** Tech giants listed in Hong Kong were up 1.2%.

** The smaller Shenzhen index was unchanged, the start-up board ChiNext Composite index slipped 0.16% and Shanghai's tech-focused STAR50 index fell 0.34%.

** Around the region, MSCI's Asia ex-Japan stock index was firmer by 1.81% while Japan's Nikkei index was up 2.79%.

** The yuan was quoted at 7.183 per U.S. dollar, 0.39% weaker than the previous close of 7.155. (Reporting by Shanghai Newsroom; Editing by Varun H K)