Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Component: Swapper #202

Closed
endigo9740 opened this issue Sep 7, 2022 · 4 comments
Closed

New Component: Swapper #202

endigo9740 opened this issue Sep 7, 2022 · 4 comments
Assignees
Labels
feature request Request a feature or introduce and update to the project.

Comments

@endigo9740
Copy link
Contributor

endigo9740 commented Sep 7, 2022

Reference:
https://daisyui.com/components/swap/

Implementation should be as follows:

Should use the context API to communicate between parent/child components. This allows for an infinite number of items to toggle through. This would be useful for things like dark mode toggles where you have multiple states: system | dark | light

<Swapper state={stringValue}>
    <SwapperItem value="a">Item A</SwapperItem>
    <SwapperItem value="b">Item B</SwapperItem>
    <SwapperItem value="c">Item C</SwapperItem>
</Swapper>

Please follow our contribution guidelines when implementing any new component!
https://skeleton.brainandbonesllc.com/docs/contributions

@endigo9740 endigo9740 added the feature request Request a feature or introduce and update to the project. label Sep 7, 2022
@endigo9740
Copy link
Contributor Author

endigo9740 commented Sep 19, 2022

Alternative idea: apply a Svelte action to a parent element. Then follow the same logic flow. Initially only the first item is visible, each tap toggles to the next, and when you reach the end it returns to the start to loop again.

@ryceg
Copy link
Contributor

ryceg commented Sep 22, 2022

I'll take this

@endigo9740
Copy link
Contributor Author

I've assigned it to you. Thanks!

@endigo9740
Copy link
Contributor Author

This is kind of fluff, so I'm going to retire it. We can always revisit another time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a feature or introduce and update to the project.
Projects
None yet
Development

No branches or pull requests

2 participants