> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devdeia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage

> Resetting preferences and accessing them programmatically.

## Resetting preferences

The settings modal includes a reset button in its header. It restores every customization — primary color, font family, font size, layout, and mode (if enabled) — to the values defined in `config/ui-switcher.php` under `defaults`.

## Programmatic access

Read or write preferences directly, outside the settings modal:

```php theme={null}
use Andreia\FilamentUiSwitcher\Support\UiPreferenceManager;

// Get a preference
$font = UiPreferenceManager::get('ui.font', 'Inter');

// Set a preference
UiPreferenceManager::set('ui.color', '#10b981');
```

If you're using [database storage](/filament/filament-ui-switcher/database-storage) with the `HasUiPreferences` trait, the same operations are available on the user model:

```php theme={null}
// Get the user's preference
$font = auth()->user()->getUiPreference('ui.font', 'Inter');

// Set the user's preference
auth()->user()->setUiPreference('ui.color', '#10b981');
```
