Files
antigravity-skills-reference/skills/hig-components-layout/references/ornaments.md

5.1 KiB
Raw Blame History

title: "Ornaments | Apple Developer Documentation" source: https://developer.apple.com/design/human-interface-guidelines/ornaments # Ornaments In visionOS, an ornament presents controls and information related to a window, without crowding or obscuring the windows contents. A stylized representation of an ornament at the bottom of a window shown on top of a grid that suggests the canvas of a design tool. The image is tinted red to subtly reflect the red in the original six-color Apple logo. An ornament floats in a plane thats parallel to its associated window and slightly in front of it along the z-axis. If the associated window moves, the ornament moves with it, maintaining its relative position; if the windows contents scroll, the controls or information in the ornament remain unchanged. Ornaments can appear on any edge of a window and can contain UI components like buttons, segmented controls, and other views. The system uses ornaments to create and manage components like toolbars, tab bars, and video playback controls; you can use an ornament to create a custom component. ## Best practices Consider using an ornament to present frequently needed controls or information in a consistent location that doesnt clutter the window. Because an ornament stays close to its window, people always know where to find it. For example, Music uses an ornament to offer Now Playing controls, ensuring that these controls remain in a predictable location thats easy to find. In general, keep an ornament visible. It can make sense to hide an ornament when people dive into a windows content — for example, when they watch a video or view a photo — but in most cases, people appreciate having consistent access to an ornaments controls. If you need to display multiple ornaments, prioritize the overall visual balance of the window. Ornaments help elevate important actions, but they can sometimes distract from your content. When necessary, consider constraining the total number of ornaments to avoid increasing a windows visual weight and making your app feel more complicated. If you decide to remove an ornament, you can relocate its elements into the main window. Aim to keep an ornaments width the same or narrower than the width of the associated window. If an ornament is wider than its window, it can interfere with a tab bar or other vertical content on the windows side. Consider using borderless buttons in an ornament. By default, an ornaments background is glass, so if you place a button directly on the background, it may not need a visible border. When people look at a borderless button in an ornament, the system automatically applies the hover affect to it (for guidance, see Eyes). Use system-provided toolbars and tab bars unless you need to create custom components. In visionOS, toolbars and tab bars automatically appear as ornaments, so you dont need to use an ornament to create these components. For developer guidance, see Toolbars and TabView. ## Platform considerations Not supported in iOS, iPadOS, macOS, tvOS, or watchOS. ## Resources #### Related Layout Toolbars #### Developer documentation ornament(visibility:attachmentAnchor:contentAlignment:ornament:) — SwiftUI #### Videos Design for spatial user interfaces ## Change log Date| Changes
---|---
February 2, 2024| Added guidance on using multiple ornaments.
December 5, 2023| Removed a statement about using ornaments to present supplementary items.
June 21, 2023| New page.