Skip to main content

Styling

Available Style Props

The component provides several style props for customization:

PropTypeDescription
containerStyleViewStyleMain wrapper container style
inputContainerStyleViewStyleInput container style
inputStyleTextStyleTextInput field style
suggestionStyleViewStyleSuggestion item style
textStyleTextStyleText elements style
themeDeepPartial<LocationAutocompleteTheme>Theme configuration

Basic Styling Example

<PlacesAutocomplete
containerStyle={{
margin: 16,
backgroundColor: '#fff',
borderRadius: 8,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 4,
elevation: 3,
}}
inputContainerStyle={{
borderBottomWidth: 1,
borderBottomColor: '#e0e0e0',
paddingHorizontal: 16,
height: 50,
}}
inputStyle={{
fontSize: 16,
color: '#333',
}}
suggestionStyle={{
padding: 16,
borderBottomWidth: 1,
borderBottomColor: '#f0f0f0',
}}
textStyle={{
fontSize: 14,
color: '#666',
}}
/>

Theme Customization

<PlacesAutocomplete
theme={{
colors: {
primary: '#007AFF',
surface: '#FFFFFF',
onSurface: '#000000',
onSurfaceVariant: '#666666',
outline: '#E0E0E0',
shadow: '#000000'
},
typography: {
body: { fontSize: 16, fontWeight: '500' },
bodySmall: { fontSize: 14, fontWeight: '400' },
titleMedium: { fontSize: 16, fontWeight: '600' }
},
spacing: {
xs: 4,
sm: 8,
md: 12,
},
}}
/>