mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-13 02:20:06 -04:00
Create ExpandButton.svelte
This commit is contained in:
parent
122d2c3a7d
commit
486bbf9a60
3 changed files with 53 additions and 72 deletions
27
src/components/ExpandButton.svelte
Normal file
27
src/components/ExpandButton.svelte
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script>
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
let expanded = false
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="w-4 h-4 flex justify-center align-middle text-gray-500 hover:text-blue-600 dark:text-gray-100 dark:hover:text-blue-600 shrink-0"
|
||||
on:click={() => {
|
||||
expanded = !expanded
|
||||
dispatch('click', { state: expanded })
|
||||
}}
|
||||
area-label={expanded ? 'Collapse' : 'Expand'}
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4"
|
||||
class:rotate-90={expanded}
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
||||
</svg>
|
||||
</button>
|
Loading…
Add table
Add a link
Reference in a new issue