> ## 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.

# Configuration

> Config file options and the plugin's fluent API for defaults, fonts, colors, and layouts.

Every setting can be set two ways: in `config/ui-switcher.php` (published in [Installation](/filament/filament-ui-switcher/installation)), or fluently on the plugin instance. A fluent call always overrides the config file for that panel.

## Which sections show

Toggle any section of the settings modal independently:

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

FilamentUiSwitcherPlugin::make()
    ->displayFontFamily(false)
    ->displayFontSize(false)
    ->displayColor(false)
    ->displayLayout(false)
```

All four default to `true`.

## Default preferences

The values users start with (and land on after "Reset All"):

```php config/ui-switcher.php theme={null}
'defaults' => [
    'font' => 'Inter',
    'color' => '#6366f1',
    'layout' => 'sidebar',
    'font_size' => 16,
    'density' => 'default',
],
```

Or fluently:

```php theme={null}
FilamentUiSwitcherPlugin::make()
    ->defaults([
        'font' => 'Poppins',
        'color' => '#10b981',
        'layout' => 'topbar',
        'font_size' => 15,
    ])
```

## Fonts

### Basic list

Plain strings use Filament's default font provider (Google Fonts):

```php config/ui-switcher.php theme={null}
'fonts' => [
    'Inter',
    'Poppins',
    'Public Sans',
    'DM Sans',
    'Nunito Sans',
    'Roboto',
    // Add any Google Font:
    // 'Montserrat',
],
```

### Extended form (per-font provider, including local fonts)

To pin a specific label, family, provider, or stylesheet URL per font — for example to mix Google Fonts with a locally hosted one — use the extended array form instead of a plain string:

```php config/ui-switcher.php theme={null}
'fonts' => [
    'inter' => [
        'label' => 'Inter',
        'family' => 'Inter',
        'provider' => \Filament\FontProviders\LocalFontProvider::class,
        'url' => '/css/fonts.css',
    ],
],
```

### Fluent API

```php theme={null}
FilamentUiSwitcherPlugin::make()
    ->fonts(
        fonts: ['Inter', 'Poppins'],
        url: '/css/fonts.css',
        provider: \Filament\FontProviders\LocalFontProvider::class,
    )
```

`url` and `provider` here set the *default* provider/stylesheet applied to any font option that doesn't define its own — you can also set them independently:

```php theme={null}
FilamentUiSwitcherPlugin::make()
    ->fontProvider(\Filament\FontProviders\LocalFontProvider::class)
    ->fontUrl('/css/fonts.css')
```

## Font size range

Min/max for the font size slider, in pixels (defaults 12–20):

```php config/ui-switcher.php theme={null}
'font_size_range' => [
    'min' => 12,
    'max' => 20,
],
```

```php theme={null}
FilamentUiSwitcherPlugin::make()
    ->fontSizeRange(min: 12, max: 24)
```

## Custom colors

The swatches shown in the color picker:

```php config/ui-switcher.php theme={null}
'custom_colors' => [
    '#6366f1', '#3b82f6', '#0ea5e9', '#10b981',
    '#22c55e', '#84cc16', '#eab308', '#f59e0b',
    '#f97316', '#ef4444', '#ec4899', '#8b5cf6',
    // Add your brand colors:
    // '#yourBrandColor',
],
```

```php theme={null}
FilamentUiSwitcherPlugin::make()
    ->customColors(['#84C225', '#92D148'])
```

## Layouts

Which layout options users can choose between:

```php config/ui-switcher.php theme={null}
'layouts' => [
    'sidebar',               // Full sidebar with icons and labels
    'sidebar-collapsed',     // Collapsed sidebar (icons only)
    'sidebar-no-topbar',     // Sidebar without topbar (Filament v4.1+)
    'topbar',                // Top navigation bar
],
```

```php theme={null}
FilamentUiSwitcherPlugin::make()
    ->layouts(['sidebar', 'topbar'])
```

## Settings icon

```php config/ui-switcher.php theme={null}
'icon' => 'heroicon-o-cog-6-tooth',
```

There's no dedicated fluent setter for the icon itself — set it in the config file, or use [`iconRenderHook()`](/filament/filament-ui-switcher/installation#customize-icon-position) to change where the icon appears.

## Storage driver

```php config/ui-switcher.php theme={null}
'driver' => env('UI_SWITCHER_DRIVER', 'session'),
'database_column' => 'ui_preferences',
```

See [Database Storage](/filament/filament-ui-switcher/database-storage) for the full setup to persist preferences per user.
