How do you ensure cross-browser compatibility and mobile responsiveness when implementing custom UI components?