Surface
Use the Surface component to structure and visually separate content on a page, or to create floating overlays such as menus, selects, and modals.
Note
See Accessibility in Design Foundations for explanations of key concepts and best practices.
Interactive elements and ARIA
Surface renders as a non-interactive div by default and can contain interactive elements such as buttons and links.
- Do polymorph the surface into a button or link when the whole surface should be clickable.
- Don't place other interactive elements inside an interactive
Surface. Nested interactive elements can fail WCAG 4.1.2, as described in the axe nested-interactive rule.
Drag and drop
Surface doesn't implement dragging. The dragged property only applies drag styles. If you make a Surface draggable in your app:
- Do provide an alternative that moves the surface with a single pointer and no dragging, such as a menu with move actions. This is required by WCAG 2.5.7.
- Do make sure the surface can be moved using only a keyboard. This is required by WCAG 2.1.1.