Answer
It is both. It neutralises stomach acid and can also retain water in the bowel to relieve occasional constipation.
Sources for this answer
- Magnesium Hydroxide Mixture BP — Current selected SmPCemc · Summary of Product Characteristics
General medicine information. Follow the instructions for your own medicine and speak to a pharmacist or clinician about your individual circumstances.