tiny-location-input
Version:
Ultra-lightweight React location autocomplete input with inline styling, geonames integration, and full TypeScript support — perfect for modern UIs.
49 lines (35 loc) • 1.2 kB
Markdown
# tiny-location-input
A tiny, customizable React location input with autocomplete using GeoNames data.
## 📦 Installation
```bash
npm install tiny-location-input
```
## 🚀 Usage
```jsx
import LocationInput from 'tiny-location-input';
function App() {
const handleLocationChange = (location) => {
console.log('Selected location:', location);
};
return (
<LocationInput
onSelect={handleLocationChange}
classNames={{ container: 'shadow-container' }}
styles={{ input: { fontSize: '1.2rem' } }}
/>
);
}
```
## ✨ Features
- Inline styles with override support via props
- Lightweight: no external CSS or dependencies
- Fully React-compatible with TypeScript support
## 🛠 Props
| Prop | Type | Description |
|-------------|-----------|----------------------------------------------|
| onSelect | Function | Called with the selected location object |
| classNames | Object | Optional class names for each component part |
| styles | Object | Optional inline styles for each part |
| placeholder | String | Input placeholder text |
## 📄 License
MIT