UseActiveElement

A function that returns the currently active element.

Demo

Currently active element: No active element found

Usage

	<script lang="ts">
	import { useActiveElement } from "runed";
 
	const activeElement = useActiveElement();
</script>
 
<div class="rounded-md bg-card p-8">
	<p>
		Currently active element:
		<span class="font-bold">
			{activeElement.value !== null
				? activeElement.value.localName
				: "No active element found"}
		</span>
	</p>
</div>	
MIT

© 2024 Svecosystem Team