A React component that allows you to embed an Airbnb listing in your web application. Compatible with server-side rendering using Next.js.
You can install the package via npm:
npm install react-airbnb-embed
Once installed, you can use the Airbnb
component by importing it in your code and passing the necessary props.
import React from 'react'
import { Airbnb } from 'react-airbnb-embed'
const MyComponent = () => {
return <Airbnb id='123456' name='Listing' />
}
export default MyComponent
The Airbnb component accepts the following props:
-
id
(required): The ID of the Airbnb listing that you want to embed. -
name
(required): The name of the Airbnb listing that you want to embed. -
reviews
(optional, default true): Whether to show or hide the reviews section. -
nofollow
(optional, default false): Whether to add the nofollow attribute to the links.
This package is open-sourced software licensed under the MIT license.