# Elevation URL: /foundations/elevation Source: https://github.com/daangn/seed-design/blob/dev/docs/content/foundations/elevation.mdx A design principle that visually expresses the relative depth and hierarchy between UI elements. ## Principle ![Image showing Elevation principles - hierarchy between elements (surface depth)]() Elevation is a design principle that visually expresses the relative depth and hierarchy between UI elements. By borrowing the concept of 'height' from the physical world, it helps users understand and interact with the interface more intuitively. ## Stacking Context: Global, Local ![Screen divided by Global and Local Stacking Context]() To effectively manage the Elevation system, the key is to define levels as 'Global' and 'Local'. - **Global**: The structural layers of the application - the entire product screen (Viewport) or components and layers serving as containers. - **Local**: Visual depth within a specific context - components that represent content within the screen. They are always positioned above the Global level. ## Global Level: Container Component ### Level 0: layer-basement ![Example image of Level 0 $color.bg.layer-basement]() The background layer positioned at the bottom of the screen. It underlies all scrolling content and creates the visually deepest sense of depth. ### Level 1: layer-default ![Example image of Level 1 $color.bg.layer-default]() The layer that forms the basic layout of the page. Individual content blocks that form the page, such as Card, [List](/components/list), and [TextField](/components/text-input), or key layout elements like [Top Navigation](/components/top-navigation), are displayed on this layer. ### Level 2: Bottom Sheet, Menu Sheet ![Example image of Level 2 Bottom Sheet]() Components like [Bottom Sheet](/components/bottom-sheet) and [Menu Sheet](/components/menu-sheet) that cover the screen and create independent 'Stacking Context'. In this case, [Bottom Sheet](/components/bottom-sheet) becomes a new Global Context by itself. Therefore, [List](/components/list) positioned on top of it is recognized as a Local component stacked on this reference base, and is clearly displayed on the Bottom Sheet surface. ### Level 3: Alert Dialog ![Example image of Level 3 Alert Dialog]() [Alert Dialog](/components/alert-dialog) is the 'topmost modal (Critical Modal)' that handles the most urgent information in the system. This level forces immediate and complete user attention. Therefore, it must be displayed above all UI elements, including other already-active modals like [Bottom Sheet](/components/bottom-sheet) (Level 2). ## Representing Page Over Page ![Example image showing Page-over-Page structure]() The context of Global and Local creates a flexible structure where pages stack 'page-over-page'. A newly overlaid page immediately becomes a new reference (Context), so tooltips and menus within it work correctly according to this reference. ## Local Level: Content Component ![Diagram comparing levels between components within Local Level]() Components that represent content, such as [Action Button](/components/action-button), [List](/components/list), and [Tabs](/components/tabs), inherit the level of their parent surface (Global) with a Local nature, but are divided into Levels 1-3 within to distinguish visual hierarchy and importance. ### Level 1: Main Contents ![Example image of Level 1 Main Contents]() Level 1 components, including [List](/components/list), [Callout](/components/callout), [Tabs](/components/tabs), and [Top Navigation](/components/top-navigation), are elements that form the basic layout (skeleton) of the page. ### Level 2: Floating Actions ![Example image of Level 2 Floating Actions]() Level 2 is positioned in a layer above the basic layout (Level 1), and includes components of surfaces floating on the page. ### Level 3: Transient Feedback ![Example image of Level 3 Transient Feedback]() Level 3 includes components that deliver transient feedback and system notifications that require immediate acknowledgment without disrupting the user flow. ## Visual Distinction Within the Same Level ![Top Navigation maintained even during scroll]() Even with the same Elevation Level, you can refine the hierarchy within to define a clear stacking order. [Top Navigation](/components/top-navigation) and [List](/components/list) are both Level 1, but should be arranged so that List naturally scrolls under Top Navigation. In this case, when content overlaps, we do not raise [Top Navigation](/components/top-navigation)'s elevation level. Instead, we add shadows or lines (styling) to provide 'visual distinction'. This visual distinction is expressed using one of three methods to represent Elevation. ## Three Ways to Express Elevation ![Three ways to express Elevation: color, shadow, and border]() There are various visual elements to express Elevation. In Crispy, elevation is visualized in three ways. ### Surface color ![Snackbar example]() ![Floating Action Button example]() A method of expressing elevation by changing the background color. [Snackbar](/components/snackbar) and [Floating Action Button](/components/floating-action-button) are typical examples. You can adjust the brightness or saturation of the base background color. Or, in a specific context, you can use a completely different color as the background color to express elevation, rather than a tonal difference. ### Shadow ![Contextual Floating Button example]() The most traditional and intuitive way to express Elevation. [Contextual Floating Button](/components/contextual-floating-button) is a typical example. Assuming there is light, how high an element is floating is expressed through shadow size, blur, and opacity. | Token | theme-light | theme-dark | | --- | --- | --- | | $shadow.s1 | [{"color":"#00000014","offsetX":{"value":0,"unit":"px"},"offsetY":{"value":1,"unit":"px"},"blur":{"value":4,"unit":"px"},"spread":{"value":0,"unit":"px"}}] | [{"color":"#00000080","offsetX":{"value":0,"unit":"px"},"offsetY":{"value":1,"unit":"px"},"blur":{"value":4,"unit":"px"},"spread":{"value":0,"unit":"px"}}] | | $shadow.s2 | [{"color":"#0000001a","offsetX":{"value":0,"unit":"px"},"offsetY":{"value":2,"unit":"px"},"blur":{"value":10,"unit":"px"},"spread":{"value":0,"unit":"px"}}] | [{"color":"#000000ad","offsetX":{"value":0,"unit":"px"},"offsetY":{"value":2,"unit":"px"},"blur":{"value":10,"unit":"px"},"spread":{"value":0,"unit":"px"}}] | | $shadow.s3 | [{"color":"#0000001f","offsetX":{"value":0,"unit":"px"},"offsetY":{"value":4,"unit":"px"},"blur":{"value":16,"unit":"px"},"spread":{"value":0,"unit":"px"}}] | [{"color":"#000000cc","offsetX":{"value":0,"unit":"px"},"offsetY":{"value":4,"unit":"px"},"blur":{"value":16,"unit":"px"},"spread":{"value":0,"unit":"px"}}] | **Shadows have a limitation of not being very visible in dark mode. Shadows are only used in areas where they should be used (rare elements with high prominence on the entire screen).** ### Stroke ![Bottom Navigation example]() A method of distinguishing areas and implying elevation by adding a border to the edge of the surface. [Bottom Navigation](/components/bottom-navigation) is a typical example. ## Color: Layer Token ![Layer Token colors (Light mode)]() ![Layer Token colors (Dark mode)]() Layer Token defines the surface color of 'containers that hold content'. This token focuses only on creating the basic 'canvas' and hierarchy of the UI, not individual elements like text or icons. Each token has a unique 'Color Layer' value, and in dark mode, it follows the rule that higher elevation becomes brighter. | Token | theme-light | theme-dark | | --- | --- | --- | | $color.bg.layer-basement | $color.palette.gray-200 | $color.palette.gray-00 | | $color.bg.layer-default | $color.palette.gray-00 | $color.palette.gray-100 | | $color.bg.layer-default-pressed | $color.palette.gray-100 | $color.palette.gray-300 | | $color.bg.layer-fill | $color.palette.gray-100 | $color.palette.gray-200 | | $color.bg.layer-floating | $color.palette.gray-00 | $color.palette.gray-200 | | $color.bg.layer-floating-pressed | $color.palette.gray-100 | $color.palette.gray-300 | ## `$color.bg.layer-basement` vs. `$color.bg.neutral-weak` ![$color.bg.layer-basement Light mode]() ![$color.bg.layer-basement Dark mode]() ![$color.bg.neutral-weak Light mode]() ![$color.bg.neutral-weak Dark mode]() The tokens [`$color.bg.layer-basement`](/foundations/design-token/reference/%24color.bg.layer-basement) and [`$color.bg.neutral-weak`](/foundations/design-token/reference/%24color.bg.neutral-weak) may look similar in light mode but behave differently in dark mode. [`$color.bg.layer-basement`](/foundations/design-token/reference/%24color.bg.layer-basement) has a color value that can represent the lowest level 0 ground in dark mode. This token can be used as the background on the default screen. Conversely, [`$color.bg.neutral-weak`](/foundations/design-token/reference/%24color.bg.neutral-weak) appears in a corresponding tone in dark mode that matches the brightness tone displayed in light mode. Use this token when the background needs to be adjusted to various elevations.