idyll-langidyll
DocsTutorialsGalleryEditor
menu

Overview

  • Introduction
  • Getting started
  • Markup syntax
  • HTML tags
  • Options and styles
  • Plugin system
  • Multipage template

Interactivity

  • Built-in components
  • Using components from npm
  • Make your own component
  • Scrolling and Refs

Publishing

  • Deploying to the web
  • Embedding Idyll

Useful Links

  • Github
  • Chat
  • Twitter
  • Support Us
← Back

Scroller

The Scroller component is used to create scroll-based presentations. See this example for more details.

Scroller

Props

  • currentStep variable

    The index of the currently selected step.

    • Example: x
  • fullWidth boolean

    Is this component fullWidth.

    • Example: true
  • currentState object

    The state value associated with the currently selected step. Note you must set the state property on the step components for this value to update.

    • progress number

      The percent of completion (0-1) of the currently selected step

      • offset number

        (number 0 - 1, or string with "px"): How far from the top of the viewport to trigger a step. (default: 0.5) (middle of screen)

        • debug boolean

          Show scroller debug information.

          Example Code

          [Scroller currentStep:scrollerIndex]
            [Graphic style:`{padding: 50}`]
                [Chart type:`"line"` data:`scrollerChartData.slice(0, scrollerIndex + 2)` /]
            [/Graphic]
          
            [Step]## Hey, neat, here's some data![/Step]
            [Step]## ...   [/Step]
            [Step]## ...  What's that more data?![/Step]
            [Step]## Hmm...[/Step]
            [Step]## Too much data.[/Step]
            [Step]## Stop.[/Step]
            [Step]## that.[/Step]
            [Step]## data[/Step]
          
          [/Scroller]