tiny-location-input
v1.0.0
Published
Ultra-lightweight React location autocomplete input with inline styling, geonames integration, and full TypeScript support — perfect for modern UIs.
Maintainers
Readme
tiny-location-input
A tiny, customizable React location input with autocomplete using GeoNames data.
📦 Installation
npm install tiny-location-input🚀 Usage
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
