Skip to content

Conversation

@SudevKiyadaTR
Copy link
Contributor

What's in this pull request

Adds HorizonalScroller component (fixes #281)

Before submitting, please check that you've ...

  • Read our contributing guide
  • Documented any new components or features
  • Tagged an editor to review this PR

@SudevKiyadaTR SudevKiyadaTR added the new feature New feature or request label Jan 7, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

⚠️ No Changeset found

Latest commit: 45d480b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@MinamiFunakoshiTR MinamiFunakoshiTR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! I left some initial questions, suggestions and so on. Let me know if you have questions about them.

@SudevKiyadaTR
Copy link
Contributor Author

@MinamiFunakoshiTR I have tweaked the code and made the clamp/map thing simpler. Also added a story which demonstrates how that might be useful and it comes under advance stuff. With default values all set, this is something not many will need to touch.

Copy link
Contributor

@MinamiFunakoshiTR MinamiFunakoshiTR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just one tiny tweak to the documentation. I like the new ai2svelte advanced demo. Go ahead and release this!

/** Array of numbers desired as stops for the scroller */
stops?: number[];
/** Should the component handle scroll events? Set it to `false` when using inside ScrollerBase. */
handleScroll?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this specifically handle whether handleStops fires? If so, can we get rid of it and make it fire only if stops and/or whatever other prop you need is set?
I thought initially that handleScroll handles a custom scroll function, which isn't the case.
If we're not using ScrollerBase -- which I don't think we ever will -- maybe we don't need this option at all?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@SudevKiyadaTR SudevKiyadaTR Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleScroll tells whether the progress should be handled by the component based on the scroll height or whether the progress should be dictated by the user-fed progress binding.

In case of ScrollerBase, the user needs to feed the progress value based on ScrollerBase's progress.

I'll add a lil disclaimer on the ScrollerBase integration and keep the prop (to be on safer side).


### Captions fading in/out

Caption boxes are exported as `htext` [tagged layers](https://reuters-graphics.github.io/ai2svelte/users/tagged-layers/) in ai2svelte. In this example, we use the `handleScroll()` function to check the position of each caption box relative to the viewport width and set its opacity to `1` (visible) or `0` (hidden) based on whether the caption box is within the `threshold` of the viewport. Set `override_text: true` in the ai2svelte export settings to allow custom HTML content in tagged text layers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's edit this to:

In Adobe Illustrator, let override_text: true in the ai2svelte export settings to allow custom HTML content in tagged text layers.

Separately, I couldn't find any documentation on tagged text layers in the ai2svelte documentation. It would be great to have that in there at some point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a part of ai2svelte v1.0.3 and should be updated when we release it soon.

@SudevKiyadaTR SudevKiyadaTR changed the base branch from main to sk-release January 13, 2026 14:12
@SudevKiyadaTR SudevKiyadaTR merged commit 4d8b6e4 into sk-release Jan 13, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add horizontal scrolly component

3 participants