hotelblockstest
v1.0.23
Published
--- title: Web Component Library ---
Downloads
5
Readme
title: Web Component Library
This is a library of web components that can be easily consumed and used in web projects. It provides components for displaying hotel blocks and related functionality. The library supports both plain web usage and integration with React.
Table of Contents
Web Consumption
To consume the web components in a web project, follow these steps:
- Add the following HTML markup where you want to display the hotel blocks:
<div id="hotelblocks-container"></div>
- Include the library's JavaScript file using the following script tag in your HTML file:
<script src="https://www.unpkg.com/hotelblockstest@latest/dist/web/index.js"></script>
- Create an instance of the button component using the following JavaScript code:
<script> var Button = HotelBlocksComponents.Render("hotelblocks-container"); </script>
React Consumption
- Install the library using npm or yarn:
npm install hotelblockstest
- Import the required components from the library in your React component file:
import { ThemeProvider, Button, SearchCard, } from "hotelblockstest/dist/react";
- Wrap your React components with the ThemeProvider component to set the desired theme color:
<ThemeProvider color="blue"> <Button label="hello" /> <SearchCard /> </ThemeProvider>