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

Hostinger Tools, version 3.0.39. 19 lines.

- Page: https://pluginprobe.com/plugins/hostinger/3.0.39/code/vue-frontend/src/composables/useToggle.ts
- Raw: https://pluginprobe.com/plugins/hostinger/3.0.39/raw/vue-frontend/src/composables/useToggle.ts
- Modified: 2025-03-03T08:32:52+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.39/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
  };
};

```
