Skip to content

artboard-deluxe / ArtboardScrollIntoViewOptions

ArtboardScrollIntoViewOptions

ArtboardScrollIntoViewOptions = AnimationOptions & object

Defined in: types/index.ts:348

Options for scrolling an area of the artboard into view.

Type declaration

area?

optional area: "viewport" | "blocking"

Defines the effective horizontal area used for positioning.

  • viewport: Use the full root element (minus padding). Default.
  • blocking: Use the non-blocked area computed from blocking rects. This positions the target within the available space without affecting scaling. Implied automatically when scale is 'blocking'.

axis?

optional axis: "x" | "y" | "both"

Which axis to scroll.

behavior?

optional behavior: "smooth" | "instant" | "auto"

The scroll behaviour.

  • Smooth: Always animates the transition.
  • Instant: Directly apply the transform and scale.
  • Auto: Uses smooth, but switches to instant if an animation is currently running.

block?

optional block: "start" | "center" | "end" | "nearest" | "auto"

Vertical alignment of the target rect within the effective viewport area.

  • start: Align the top edge of the target with the top of the viewport.
  • center: Center the target vertically (default).
  • end: Align the bottom edge of the target with the bottom of the viewport.
  • nearest: Scroll the minimum distance needed. No-op if already visible. If larger than the viewport, aligns start.
  • auto: Center if the target fits within the viewport, otherwise align start.

inline?

optional inline: "start" | "center" | "end" | "nearest" | "auto"

Horizontal alignment of the target rect within the effective viewport area.

  • start: Align the left edge of the target with the left of the viewport.
  • center: Center the target horizontally (default).
  • end: Align the right edge of the target with the right of the viewport.
  • nearest: Scroll the minimum distance needed. No-op if already visible. If larger than the viewport, aligns start.
  • auto: Center if the target fits within the viewport, otherwise align start.

padding?

optional padding: number | Partial<Edge>

Padding insets from the viewport edges defining the effective area for both positioning and scaling.

Accepts a uniform number or per-edge values using the Edge type.

scale?

optional scale: "none" | "full" | "blocking"

Define whether the artboard should be scaled.

  • None: Keeps the current artboard scale.
  • Full: Scales the artboard so that the target element fully covers the available space.
  • Blocking: Scales the artboard so that the target element covers the non-blocking area.