Summary
Searchable IANA timezone picker with a Gravity UI clock icon on the trigger and in menu rows. Stores a single timezone identifier string.| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\TimezoneField |
| State type | string|null — IANA timezone identifier |
| Model cast | 'timezone' => 'string' |
| FieldType | (no dedicated FieldType mapping yet — use the class directly) |
| Playground | timezone-field slug in Flex Fields playground |
Basic usage
Standard timezone picker
Browser-aware detection
State & validation
Stored value
State is a single IANA identifier string.Validation rules
Built-in validation ensures the submitted identifier is in the resolved timezone list.| Rule | Detail |
|---|---|
nullable | Always (unless required()) |
in(...) | Value must match a configured IANA identifier |
Configuration API
All methods acceptClosure unless noted.
| Method | Type | Default | Description |
|---|---|---|---|
timezones(array|Closure|null $timezones) | Setup | null | Whitelist of IANA identifiers |
exceptTimezones(array|Closure $timezones) | Setup | [] | Blacklist of IANA identifiers |
defaultTimezone(string|Closure|null $timezone) | Setup | null | Fallback IANA identifier |
browserTimezoneDefault(bool|Closure $condition = true) | Setup | false | Pre-select from browser settings |
browserTimezoneSortFirst(bool|Closure $condition = true) | Setup | false | Sort browser timezone to top of list |
showOffset(bool|Closure $condition = true) | Setup | true | Show UTC offset badge (e.g. UTC+02:00) |
searchable(bool|Closure $condition = true) | Setup | true | Show search input in dropdown |
prefixIcon(...) | Setup | Clock | Custom leading icon |
variant(string|Closure $variant) | Setup | 'primary' | Visual style: primary, secondary, flat, soft |
size(string|ControlSize|Closure $size) | Setup | 'md' | Control size: sm, md, lg |
rounding(string|Closure|null $rounding) | Setup | config | Border radius token |
timezones() / exceptTimezones()
Limit the list to specific regions or exclude problematic zones:
browserTimezoneDefault()
When enabled and state is empty, it attempts to detect the user’s timezone via Alpine/JS.
Real-world examples
User profile settings
Event scheduler
Playground
/admin/flex-fields-playground/timezone-field
See Playground for setup.
Related components
| Component | When to use instead |
|---|---|
| CountryField | For picking a country instead of a specific timezone |
| FlexDateTimePicker | For picking a date/time with optional timezone support |
| SelectField | For a generic dropdown if IANA identifiers aren’t needed |
CSS classes (reference)
| Class | Role |
|---|---|
fff-timezone-field | Root wrapper |
fff-timezone-field--{sm|md|lg} | Size modifier |
fff-timezone-field__trigger | Picker button |
fff-timezone-field__offset | UTC offset badge |
fff-timezone-field__menu | Dropdown panel |
fff-timezone-field__search | Search input |
Performance
| Mechanism | What it does |
|---|---|
| Virtual Scroll | Efficiently renders long lists of timezones (~400+ zones) |
| SSR Label | Renders the selected timezone label server-side for zero layout flash |
| Teleport | Uses x-teleport="body" to avoid overflow clipping in modals |