😍
Framer API 中文版
  • 写在前面
  • 从这里开始
    • 介绍
      • 快速开始
      • 基础
    • 教程
      • 准备 Setup
      • 引入 Slider 组件
      • Slider组件的元素
      • 拖动 & MotionValue
      • Hooks & 传递数据
      • 完成
      • 回顾
    • 简要案例
      • Frame
      • Stack
      • Animate
      • Gestures
      • Dragging 拖拽
      • Scrolling 滚动
      • Paging 翻页
      • Tranforms 变换
      • Variants 动画状态组
  • LIBRARY 库
    • Frame
      • Layout 布局
      • Visual 视觉
      • Transform 变换
      • Animation 动画
      • Transition 过渡
      • Variants 动画状态组
      • Tap 点击
      • Hover 悬浮
      • Pan
      • Drag
      • Types
    • Animation
      • Overview
      • Animation controls
      • Tween
      • Spring
      • Inertia 惯性
      • Orchestration
      • Types
    • Color
      • Create
      • Modify
      • Convert
      • Compare
      • Models
    • Page
      • Content
      • Padding
      • Events
      • Effects
      • PageEffectInfo
    • Scroll
      • Sizing
      • Content
      • Events
    • Stack
      • Content
      • Padding
    • Utilities
      • Transfrom
      • useTransform
      • useAnimation
      • useCycle
      • useMotionValue
      • useSpring
      • useViewportScroll
  • FRAMER X
    • Assets
      • Functions
    • Data & Overrides
    • CanvasComponents
      • Canvas.tsx
      • Layout
      • Colors
    • PropertyControls
      • Adding Controls
      • Hiding Controls
      • Array
      • Boolean
      • Color
      • ComponentInstance
      • Enum
      • File
      • FusedNumber
      • Image
      • Number
      • SegmentedEnum
      • String
    • Render Target
      • Properties
      • Functions
Powered by GitBook
On this page

Was this helpful?

  1. LIBRARY 库

Scroll

为桌面端或者移动创建一个可滚动的区域,支持鼠标和触摸操作。

Scroll组件是基于Frame的,因此它支持所有Frame的属性。它让我们可以快速创建一个可滚动的区域。当包含的Frame的尺寸在水平方向上或者垂直方向是超过包含它的Scroll组件的,那么就可以实现水平或者垂直方向上的滚动。

- 创建水平或者垂直方向的可滚动区域

- 创建包裹的滚动区域

- 可用滚轮实现桌面端的滚动

- 可以通过控制momentum和overdrag实现更高级的控制

Scroll组件并不是一个简单的带了overflow属性的div标签,它自定了很多基于真实物理效果的设置去模拟真实的类似于iOS系统的滚动效果。它可以在全平台通用,你可以通过各种方式控制它。它能让你探索更多新的、自定一的交互方式。

import * as React from "react"
import { Frame, Scroll } from "framer"

export function MyComponent() {
  return (
    <Scroll height={200} width={200}>
      <Frame size={300}>Hello World!</Frame>
    </Scroll>
  )
}

PreviousPageEffectInfoNextSizing

Last updated 5 years ago

Was this helpful?