skeleton icon indicating copy to clipboard operation
skeleton copied to clipboard

New Component: Swapper

Open endigo9740 opened this issue 1 year ago • 3 comments

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 avatar Sep 07 '22 19:09 endigo9740

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.

endigo9740 avatar Sep 19 '22 07:09 endigo9740

I'll take this

ryceg avatar Sep 22 '22 01:09 ryceg

I've assigned it to you. Thanks!

endigo9740 avatar Sep 22 '22 01:09 endigo9740