Skip to content

Commit 7bec885

Browse files
authored
Merge pull request #35 from TappNetwork/update_layout_view_to_group
Allow the use of different form layouts
2 parents 513aac1 + 898731a commit 7bec885

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,30 @@ GoogleAutocomplete::make('google_search')
104104
]),
105105
```
106106

107+
### Using form layouts
108+
109+
The Google autocomplete fields can be wrapped in a Form layout like `Fieldset` or `Section`:
110+
111+
```php
112+
Forms\Components\Fieldset::make('Address')
113+
->schema([
114+
GoogleAutocomplete::make('google_search')
115+
// ...
116+
]),
117+
```
118+
119+
![Fieldset Layout](https://raw.githubusercontent.com/TappNetwork/filament-google-autocomplete-field/main/docs/fieldset_layout.png)
120+
121+
```php
122+
Forms\Components\Section::make('Address')
123+
->schema([
124+
GoogleAutocomplete::make('google_search')
125+
// ...
126+
]),
127+
```
128+
129+
![Section Layout](https://raw.githubusercontent.com/TappNetwork/filament-google-autocomplete-field/main/docs/section_layout.png)
130+
107131
## Places API (original) and Places API (New)
108132

109133
Both the **[Places API (original)](https://developers.google.com/maps/documentation/places/web-service/autocomplete)** and the **[Places API (New)](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete)** are supported.

docs/fieldset_layout.png

179 KB
Loading

docs/section_layout.png

318 KB
Loading

src/Forms/Components/GoogleAutocomplete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class GoogleAutocomplete extends Component
2525
/**
2626
* @var view-string
2727
*/
28-
protected string $view = 'filament-forms::components.fieldset';
28+
protected string $view = 'filament-forms::components.group';
2929

3030
protected bool|Closure $isRequired = false;
3131

0 commit comments

Comments
 (0)