# SettingsPageState

**Category:** Base Components/Pages/Settings Page/State

## API

### Overview

`SettingsPageState` is the state object that drives a [`SettingsPage`](./?path=/story/base-components-pages-settings-page--settingspage). It is created by the [`useSettingsPage`](./?path=/story/base-components-pages-settings-page-hooks-usesettingspage--usesettingspage) hook and manages:

- **Settings fetching** — loads the current settings from the server via `fetch`
- **Form state** — integrates with `react-hook-form` for editing
- **Save / cancel flow** — calls `onSave` and `onCancel` with success/error toasts
- **Dirty-form protection** — warns on `beforeunload` when the form has unsaved changes

Pass the returned state to ``.

```tsx
import { useSettingsPage } from '@wix/patterns';
// Returns SettingsPageState
```

