skeleton
skeleton copied to clipboard
New Component: Swapper
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
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.
I'll take this
I've assigned it to you. Thanks!
This is kind of fluff, so I'm going to retire it. We can always revisit another time.