I published my very first npm package:
This post intends to be a helper document for the same, and will be kept upto date, if the package ever changes. As of writing this post, v2.0.0 is the latest and stable version of the package. The source code is in a private repository right now, will be open sourced soon!
react-opentable is a React wrapper for opentable's reservation widget.
react-opentable is not affiliated to
Opentable Inc., or it's employees.
Works only with React v16.8 and above.
react-opentable uses hooks and will not work with previous versions (comment below if you need one)
There are two main exports from
rid is a required prop, the component won't function correctly without it.
|type='standard'||Uses the standard widget type|
|theme='standard'||Default standard theme|
|iframe=true||opens the widget in an iframe (recommended)|
|newtab=false||widget won't open reservation in a new tab|
|position='bottom-left'||widget opens in the |
The widget can be positioned in one of 5 positions namely 'top-left', 'top-right' ,'bottom-left' (default), 'bottom-right' and 'unset' (if you want to position the element through css, use this).
To avoid typos you can use the
positions object with keys
For further customisations, pass
customClassName, this className gets attached to the container of component.
Here's a code sandbox for you to tinker with:
Do let me know how can I make this components more useful for you 😁