Files
Laravel-boiler-plate/resources/js/components/ui/sidebar/SidebarTrigger.vue
T
Shaun Collins fdd3c55323
linter / quality (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
Init
2026-02-23 13:19:27 +00:00

29 lines
737 B
Vue

<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { PanelLeftClose, PanelLeftOpen } from "lucide-vue-next"
import { cn } from "@/lib/utils"
import { Button } from '@/components/ui/button'
import { useSidebar } from "./utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
const { isMobile, state, toggleSidebar } = useSidebar()
</script>
<template>
<Button
data-sidebar="trigger"
data-slot="sidebar-trigger"
variant="ghost"
size="icon"
:class="cn('h-7 w-7', props.class)"
@click="toggleSidebar"
>
<PanelLeftOpen v-if="isMobile || state === 'collapsed'" />
<PanelLeftClose v-else />
<span class="sr-only">Toggle Sidebar</span>
</Button>
</template>