# Menu URL: /components/menu Source: https://github.com/daangn/seed-design/blob/dev/docs/content/components/menu.mdx A component that provides a list of options or actions that users can take. ## Anatomy ![Menu Anatomy image. Composed of Container, Menu Group, Menu Group Label, Menu Item, and Divider.]() - **Container:** Wraps all internal elements and determines background, shadow, and border values. - **Menu Group:** A collection unit of related items. Contains Header and Items within the group. - **Menu Group Label:** A text area indicating the nature of the group. It is in an inactive state and serves as a visual guide. - **Menu Item:** The smallest unit of an option that users can actually click or focus on. Contains Prefix Icon / Label / Badge / Suffix Icon. - **Divider:** A dividing line that creates a visual boundary between Menu Groups. Dividers are not used between Menu Items and are displayed between all Menu Groups. ## Properties ### Size ![Menu Size Property - Small, Medium]() Set based on the balance between user eye movement flow and text readability. - **Small:** Used at `lg` breakpoint and above. The optimal width to minimize cursor movement distance and increase vertical scan speed. - **Medium:** Used at breakpoints below `lg`. The minimum touch width that ensures thumb operation range and readability of menu names in Korean/English. ### Width ![Menu Width Property - Fixed, Stretch]() Defines how the container expands horizontally. - **Fixed (Default)**: Follows the width specified for each Size. - **Stretch (100% of Trigger):** Matches the width of the trigger (e.g., Field Button) to emphasize visual dependency. ### Height & Quantity ![Menu Height & Quantity - maximum height and scroll policy]() The number of menu items should be set within a range that users can grasp and remember at a glance. Height and scroll behavior are determined based on the number of items. - **Grouping:** If there are more than 7 items, separate them with Menu Group and Divider. - **Order:** Place the most important action group at the top and destructive actions (such as delete) at the bottom. The menu height is set to the smaller of a maximum of 480px and the remaining screen space around the Trigger. If there are more options, the menu scrolls within itself. Select with many options is designed assuming a scrolling state within the menu. ### Menu Item ![Menu Item Variant and State]() The smallest unit of an option that users can actually click or focus on. #### Variant - **Default:** General actions or information provision - **Destructive:** Dangerous actions such as delete or withdraw (red color applied) #### State - **Enabled:** Selectable state - **Hover/Pressed:** Light background highlight on mouse over or click/touch - **Focused:** Focus ring displayed on keyboard focus - **Disabled:** Non-selectable state ### Placement ![Menu Placement - Bottom-Start example]() ![Menu Placement - Left-Start example]() Menu provides appropriate positioning options based on the Trigger element. The Placement Prop is composed of a Side - Alignment combination. There is always a gap of x2 (8px) between the trigger and the menu to ensure visual separation and ease of interaction. - **Side:** "Top" | "Bottom" | "Right" | "Left" - **Alignment:** "Top" | "Bottom" | "Right" | "Left" | "Center" ### Smart Positioning ![Menu Smart Positioning - Flip behavior]() Intelligently adjusts position to prevent content from being cut off at the browser viewport boundary. - **Flip (reversal):** If there is insufficient space on the specified Side, immediately switch direction to the opposite side. (Example: Bottom → Top if there is insufficient space at the bottom) - **Shift (fine adjustment):** If the menu's edge extends beyond the screen due to Alignment, it shifts horizontally/vertically to keep the entire menu on screen, even if it breaks the alignment with the trigger. - **Viewport Margin:** A minimum safety margin of x2 (8px) is maintained between the menu and the screen edge to prevent the menu from being pressed against the browser edge. ### Elevation ![Menu Elevation - Level 1 and Level 2 layers]() Menu occupies Level 2 in the system and applies a soft Light Shadow to distinguish the boundary with surrounding elements. ## Guidelines ### Icon Usage Icons in Menu Items are optional, and the following rules apply when used. #### Icon Position - **Prefix:** When indicating the meaning or category of an item - **Suffix:** When indicating direction, such as submenus or external links - Do not use Prefix and Suffix simultaneously. (chevron is an exception) - Icons must be used together with labels. (standalone use is prohibited) - For items at the same level, use icons consistently or not at all. - In Disabled state, apply inactive color the same way as the label. ### Label Writing Labels clearly and concisely convey item functionality, and Descriptions are used supplementarily when Label alone is insufficient to convey meaning. - **Label:** 2-6 characters or less, written in verb form - **Description:** One line or less, supplementary explanation that complements the Label - Unify the tone and format of labels within the same menu. - Use Description selectively only for items that need it. (avoid blanket application to all items) - Avoid abbreviations, technical jargon, and mixed English. - Apply Critical Tone to Destructive items (such as delete). #### Line Break Policy ![Menu Item line break case examples]() Single-line display is recommended by default, but considering font scaling and multilingual (English, etc.) environments, display with line breaks without truncation. ## Specification ### Menu Component spec (JSON): /rootage/components/menu.json ### Menu Item Component spec (JSON): /rootage/components/menu-item.json