

Custom hook that manages a boolean toggle state in React components.

## Usage [#usage]

```tsx
import { useToggle } from "@tilt-legal/cubitt-components/utilities/hooks";

const [isToggled, toggle, setToggle] = useToggle(); // Initial value is false
// OR
const [isToggled, toggle, setToggle] = useToggle(true); // Initial value is true
// Use isToggled in your component, toggle to switch the state, setToggle to set the state explicitly.
```

## API [#api]

### Signature [#signature]

```ts
declare function useToggle(defaultValue?: boolean): [boolean, () => void, Dispatch<SetStateAction<boolean>>];
```

### Parameters [#parameters]

| Parameter        | Type      | Description                             | Default |
| ---------------- | --------- | --------------------------------------- | ------- |
| `[defaultValue]` | `boolean` | The initial value for the toggle state. | -       |

### Return Value [#return-value]

| Value    | Type                                                                      | Description                                                                                                       |
| -------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `return` | `[boolean, () =&gt; void, Dispatch&lt;SetStateAction&lt;boolean&gt;&gt;]` | A tuple containing the current state, a function to toggle the state, and a function to set the state explicitly. |
