# hostinger/3.0.78/vue-frontend/src/composables/useToggle.ts

Hostinger Tools, version 3.0.78. 19 lines.

- Page: https://pluginprobe.com/plugins/hostinger/3.0.78/code/vue-frontend/src/composables/useToggle.ts
- Raw: https://pluginprobe.com/plugins/hostinger/3.0.78/raw/vue-frontend/src/composables/useToggle.ts
- Modified: 2025-09-09T07:18:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/hostinger/3.0.78/code/vue-frontend/src/composables/useToggle.ts#L10-L20`.

```typescript
import { ref } from "vue";

export const useToggle = (isDefaultToggled = false) => {
	const isToggled = ref(isDefaultToggled);

	const toggle = () => (isToggled.value = !isToggled.value);

	const toggleOn = () => (isToggled.value = true);

	const toggleOff = () => (isToggled.value = false);

	return {
		isToggled,
		toggle,
		toggleOff,
		toggleOn
	};
};

```
