For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/ui/components/swipe-action.md.
lynx-ui logo
lynx-ui
  • English
  • SwipeAction

    A SwipeAction component for ReactLynx. It provides swipeable list item primitives via main-thread gestures.
    • Key Composition:

    • displayArea: Visible content section

    • actionArea: Hidden actionable area (e.g. for swipe-to-delete functionality)

    • Use Cases:

    • Implement swipe gestures (e.g. delete/archive actions)

    • Build interactive touch controls

    Info

    You can check the source code to understand how it works, and you're welcome to submit MRs to enhance its capabilities.

    Basic Usage

    Structure

    SwipeAction exposes displayArea and actionArea as structural slots.

    <SwipeAction
      displayArea={displayArea}
      actionArea={actionArea}
    />

    Component API

    SwipeAction

    actionAreaiOSAndroid
    TypeReactElement
    Action area of the SwipeAction. The content of this area will be displayed on the right side of the SwipeAction. Before swipe or showActionArea called, this area will be hidden.
    classNameiOSAndroidHarmony
    Typestring
    className
    debugLogiOSAndroid
    Typeboolean
    Display debug logs. Open it when you find a bug.
    displayAreaiOSAndroid
    TypeReactElement
    Display area of the SwipeAction. The content of this area will be displayed on the left side of the SwipeAction.
    enableSwipeiOSAndroid
    Typeboolean·Defaulttrue
    Whether allow swipe action. When it set to false, this item can only be used to display content.
    estimatedActionAreaSizeiOSAndroid
    Typenumber·Default0
    The size of the action area. If the swipeAction is used inside List, the reuse of the List may cause the actionArea to have wrong size. You can use this property to set the initial size of the actionArea.
    iosEnableSimultaneousTouchiOS
    Typeboolean·Defaulttrue
    Force touch event to send to SwipeAction.
    onActioniOSAndroid
    Type(id: string) => void
    Triggered when the actionArea was tapped. Can be used to delete or other actions.
    onSwipeEndiOSAndroid
    Type(id: string) => void
    Triggered when the SwipeAction swipe ends.
    onSwipeStartiOSAndroid
    Type(id: string) => void
    Triggered when the SwipeAction is swiped.
    ref
    TypeForwardedRef<SwipeActionRef>
    styleiOSAndroidHarmony
    TypeCSSProperties
    style
    swipeActionIdiOSAndroid
    Typestring
    Id of the SwipeAction. The onSwipeStart, onSwipeEnd and onAction will be called with this id.

    SwipeActionRef

    closeActionAreaiOSAndroid
    Type(animated: boolean) => void
    Call to hide the actionArea. If animated is true, the actionArea will be hidden with animation.
    showActionAreaiOSAndroid
    Type(animated: boolean) => void
    Call to display the actionArea. If animated is true, the actionArea will be displayed with animation.
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.