프리뷰 또는 이전 버전의 문서를 보고 있습니다.seed-design.io 방문
우리는 왜 디자인 엔지니어를 찾게 됐을까
Skip to Content
Lynx

Menu Sheet

사용자 작업에 관련된 선택지를 화면 하단의 드래그 가능한 시트로 제공합니다.

Engine ≥ 3.6<overlay>
사용 가능 버전@seed-design/[email protected], @seed-design/[email protected]
Lynx 예제를 불러오는 중입니다.

Installation

npx @seed-design/cli@latest add ui:menu-sheet

Usage

MenuSheetTrigger는 자식을 native <view>로 감싸며 asChild를 제공하지 않습니다.

import { useState } from "@lynx-js/react";
import { ActionButton } from "@seed-design/lynx-react";
import {
  MenuSheetContent,
  MenuSheetGroup,
  MenuSheetItem,
  MenuSheetRoot,
  MenuSheetTrigger,
} from "@/components/ui/menu-sheet";

export function App() {
  const [open, setOpen] = useState(false);

  function handleEdit() {
    "background only";
    setOpen(false);
  }

  return (
    <MenuSheetRoot open={open} onOpenChange={setOpen}>
      <MenuSheetTrigger accessibility-label="게시글 관리 메뉴 열기">
        <ActionButton variant="neutralSolid">메뉴 열기</ActionButton>
      </MenuSheetTrigger>
      <MenuSheetContent title="게시글 관리">
        <MenuSheetGroup>
          <MenuSheetItem label="수정하기" bindtap={handleEdit} />
          <MenuSheetItem label="삭제하기" tone="critical" />
        </MenuSheetGroup>
      </MenuSheetContent>
    </MenuSheetRoot>
  );
}

Item의 bindtap은 작업만 수행하며 시트를 자동으로 닫지 않습니다. 작업 후 닫아야 하면 위 예제처럼 open을 제어하세요. open을 제어하지 않는다면 MenuSheetRoot ref의 close()를 호출합니다. ref 메서드로 바꾼 열림 상태는 onOpenChange로 알리지 않으므로, open을 제어할 때는 ref 대신 open 값을 바꿉니다. title을 전달하지 않는 Content에는 native 보조 기술이 읽을 이름을 알 수 있도록 accessibility-label을 지정해야 합니다.

Props

Prop

Type

enableRTL?boolean | undefined

Whether the Sheet should use RTL direction. This sets the Sheet viewport direction to rtl by default and resolves logical drawer sides in RTL mode. When false, start means left and end means right. When true, start means right and end means left. Physical left and right sides are not affected by enableRTL.

Default

false

initialSnap?number | undefined

The initial snap point index.

onSnapChange?((index: number, value: number) => void) | undefined

Callback when the snap point changes. value is the resolved snap point in pixels.

onActiveSnapChange?((index: number, value: number) => void) | undefined

시트가 스냅 지점으로 움직이기 시작할 때 목표를 알린다. 애니메이션이 끝나면 onSnapChange가 이어서 불린다. 목표 index가 직전 목표와 다를 때만 불리며, 열릴 때의 첫 스냅은 항상 알린다. 닫힘은 알리지 않는다. 진행 중인 스냅이 새 스냅에 끊기면 새 목표만 알리고, 끊긴 스냅의 onSnapChange는 불리지 않는다. value는 px로 환산한 스냅 지점이다.

fadeFromIndex?number | undefined

배경(Backdrop)이 어두워지는 snap 지점 index다. 시트가 snapPoints[fadeFromIndex] 위치 이상이면 배경 농도가 1, 그보다 작은 snap 지점 중 가장 큰 위치(없으면 닫힌 위치) 이하이면 0이고, 그 사이에서는 위치에 비례해 바뀐다. snap 지점이 크기 순서가 아니어도 위치로 비교한다. 범위를 벗어난 index는 가까운 끝 지점으로 맞추며, 지정하지 않거나 아직 측정하지 않은 'fit' 지점이면 가장 크게 열린 크기를 기준으로 0에서 1로 바뀐다.

screenHeight?number | undefined

The height of the Sheet container (screen height). Used in vertical sheet mode (top / bottom) for percentage snap points and dismissal calculations. Defaults to the measured height of the SheetView layer; percentage snap points wait for that measurement before entering.

screenWidth?number | undefined

The width of the Sheet container (screen width). Used in horizontal drawer mode (left / right / start / end) for percentage snap points and dismissal calculations. Defaults to the measured width of the SheetView layer; percentage snap points wait for that measurement before entering.

rubberBand?number | boolean | { coeff?: number; max?: number; } | undefined

The rubber band effect configuration. By default, rubber band over-drag is enabled for vertical sheets (top / bottom) and disabled for horizontal drawers (left / right / start / end). If true, enables default rubber band effect (coefficient 0.5). If false, disables rubber band effect. If number, enables rubber band effect with the specified coefficient. If object, allows specifying coefficient and max distance.

dragDisabled?boolean | undefined

Whether to disable dragging on the Sheet.

dismissThreshold?number | undefined

The threshold to dismiss the Sheet.

handleOnly?boolean | undefined

Whether to restrict dragging to the handle only.

enableDragToClose?boolean | undefined

Whether to enable dragging to close the Sheet. If true, dragging from the lowest snap point toward the closed edge will move the sheet linearly and allow dismissal. If false, dragging toward the closed edge will trigger rubber band effect and snap back.

Default

true

flingEnabled?boolean | undefined

드래그를 놓을 때 속도로 위치를 투사해 snap 지점을 고를지 정한다. false면 놓은 위치에서 가장 가까운 snap 지점(또는 닫힘 기준선 아래면 닫힘)으로 간다.

Default

true

resolveRelease?((info: SheetReleaseInfo) => SheetReleaseDecision) | undefined

드래그를 놓을 때 기본 판정보다 먼저 불려 결과를 정한다. main thread에서 실행되므로 함수 본문 첫 줄에 "main thread" directive가 있어야 한다. { snap }이면 fling 없이 그 index로 snap하고, { close: true }이면 놓은 자리에서 닫으며(enableDragToClose와 관계없이), undefined이면 기본 판정을 쓴다. delta·velocity는 양수가 더 열리는 방향이다.

onPositionChange?((position: number) => void) | undefined

시트 위치(열린 크기, px)가 바뀔 때마다 불린다. 드래그, snap, 열림·닫힘 애니메이션의 매 프레임을 포함한다. main thread에서 실행되므로 함수 본문 첫 줄에 "main thread" directive가 있어야 한다. 시트 위치에 맞춰 시트 안의 요소 크기를 바꿀 때 쓴다.

claimedGestureAngles?[number, number][] | undefined

Angle ranges (in degrees) where gestures should be claimed by the Sheet. Each entry is [minAngle, maxAngle]. Gestures within these angle ranges will trigger sheet movement, while gestures outside these ranges are passed through. see https://lynxjs.org/api/elements/built-in/view#consume-slide-event for more

children?React.ReactNode

children

forceMount?boolean | undefined

Mount the sheet and render its content even when not shown. The sheet remains in closed state.

Default

false

onOpen?(() => void) | undefined

Called when the sheet has fully opened and any enter animation has finished.

onClose?(() => void) | undefined

Called when the sheet has fully closed and any exit animation has finished.

open?boolean | undefined

Whether the sheet is open (controlled mode). Internally mapped to show of the internal sheet engine.

defaultOpen?boolean | undefined

Whether the sheet is open by default (uncontrolled mode). Internally mapped to defaultShow.

Default

false

onOpenChange?((open: boolean, details: BottomSheetOpenChangeDetails) => void) | undefined

Called once when Trigger, CloseButton, Backdrop or a drag changes the open state, with the reason of the change. Changes made through the Root ref or the open prop are not reported.

onAnimationEnd?((open: boolean) => void) | undefined

Called when the sheet finishes opening (true) or closing (false), whatever changed the open state. false comes after the layer is removed from the screen, so UI shown from it (such as a snackbar) is not covered by or attached to the closing layer. With forceMount the layer stays mounted, so false only means the close finished and the layer is still on screen.

skipAnimation?boolean | undefined

Default

false

고유 prop이 없습니다. className, style, children, bindtap을 받습니다.

showCloseButton의 기본값은 false입니다. 닫기 버튼이 없어도 배경 탭이나 아래 방향 드래그로 닫을 수 있습니다.

Prop

Type

title?React.ReactNode
description?React.ReactNode
container?"bullet" | "bulletPopup" | "spark" | (string & {}) | undefined
overlayLevel?1 | 2 | 3 | 4 | undefined
showCloseButton?boolean | undefined

Default

false

Lynx는 웹과 달리 숨겨진 close button fallback을 제공하지 않습니다.

snapAnimation?SheetTransition | undefined

The transition configuration for the Sheet snap animation.

enterAnimation?SheetTransition | undefined

The enter animation configuration.

exitAnimation?SheetTransition | undefined

The exit animation configuration.

innerClassName?string | undefined

CSS class name for the inner layer. Use this for content layout and sizing styles. In horizontal drawer mode, the drawer width should be set here so 'fit' can resolve from the measured drawer width.

innerStyle?CSSProperties | undefined

Inline styles for the inner layer. Use this for content layout and sizing styles. Note: Visual styles (background, borderRadius, etc.) should be set via the main style prop which applies to the moving surface layer. In horizontal drawer mode, set drawer width here so 'fit' can resolve from the measured drawer width.

children?React.ReactNode

children

labelAlign?MenuSheetLabelAlign | undefined

Prop

Type

labelAlign?MenuSheetLabelAlign | undefined

Prop

Type

prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
labelReact.ReactNode
description?React.ReactNode
tone?MenuSheetItemTone | undefined
labelAlign?MenuSheetLabelAlign | undefined

Examples

Trigger

MenuSheetTrigger를 탭하면 시트가 열립니다. 열린 상태는 배경 탭, 아래 방향 드래그, 또는 showCloseButton으로 표시한 닫기 버튼으로 닫을 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Controlled

open과 onOpenChange로 Trigger 외의 방식에서도 열린 상태를 제어합니다. 배경 탭과 드래그로 닫힐 때도 새 open 값을 반영해야 합니다.

Lynx 예제를 불러오는 중입니다.

With Title

Lynx 예제를 불러오는 중입니다.

With Title and Description

Lynx 예제를 불러오는 중입니다.

Long Content

항목이 많으면 시트가 최대 높이에서 멈추고 목록만 스크롤됩니다. 목록이 스크롤된 상태에서 시작한 제스처는 목록만 움직이고, 목록이 맨 위에 있을 때 아래로 끌어야 시트가 움직입니다.

Lynx 예제를 불러오는 중입니다.

Close Button

Lynx 예제를 불러오는 중입니다.

Label Align

labelAlign은 Item, Group, Content 순서로 적용됩니다.

labelAlign="left" with Prefix Icon

Prefix icon이 있는 항목은 왼쪽 정렬을 사용할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

labelAlign="center" without Prefix Icon

Prefix icon이 없는 항목은 가운데 정렬을 사용할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Overriding labelAlign

Group이나 Item의 labelAlign으로 상위 정렬을 덮어쓸 수 있습니다.

Lynx 예제를 불러오는 중입니다.

onOpenChange Details

onOpenChange의 두 번째 인자는 { reason }입니다. 열릴 때는 "trigger"이고, 닫힐 때는 "closeButton", "interactOutside", "drag" 중 하나입니다. 닫히는 중에 시트를 다시 끌어 올리면 open이 true인 "drag"가 전달됩니다. Item 탭, Root ref의 메서드, open prop으로 바꾼 상태에는 호출되지 않습니다.

Lynx 예제를 불러오는 중입니다.

Portalled

container를 지정하지 않으면 Menu Sheet는 Lynx view 안에 렌더링됩니다. container="window"처럼 native container 이름을 지정하면 host 화면까지 덮는 native overlay에 렌더링됩니다. overlayLevel은 overlay의 표시 순서를 정합니다. container를 지정하면 시트의 Safe Area 여백은 SeedProvider에 넘긴 windowSafeAreaInsets를 따릅니다. 값을 넘기지 않았으면 safeAreaInsets를 따릅니다.

Lynx 예제를 불러오는 중입니다.

Skip Animation

skipAnimation을 설정하면 enter/exit 애니메이션 없이 즉시 열고 닫습니다.

Lynx 예제를 불러오는 중입니다.

웹 버전과의 차이

  • Lynx MenuSheet는 React의 SwipeableMenuSheet에 해당합니다.
  • Trigger는 자식을 native <view>로 감싸며 asChild를 제공하지 않습니다.
  • Item은 native bindtap을 사용하며 탭해도 자동으로 닫히지 않습니다.
  • ESC 키와 상위 레이어 연쇄 닫힘이 없어 escapeKeyDown과 cascadeDismiss reason을 제공하지 않습니다.
  • closeOnInteractOutside, closeOnEscape, lazyMount, unmountOnExit은 제공하지 않습니다.
  • container와 overlayLevel로 native overlay의 위치와 표시 순서를 지정합니다.

Last updated on 2026. 12. 3.