3.90.0 • Published 10 months ago

@lvble/react v3.90.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

⚛️⚡ Lvble react component

@lvble/react is a React package that provides a set of core functionalities for building interactive web applications with the lvble platform. It includes widgets.

⚡️ Quick start

NPM

You can install @lvble/react using npm (Node Package Manager). Make sure you have Node.js and npm installed on your machine. Open your terminal or command prompt and run the following command:

npm install @lvble/react

You can then import the react package and start using our great widgets. In your App.js file you create a LvbleProvider:

import CssBaseline from "@mui/material/CssBaseline";
import { ThemeProvider } from "@mui/material/styles";
import theme from "~/theme";
import { UserProvider } from "./hooks/user";
import rainbow from "~/lib/rainbow";
import MainContent from "./components/MainContent";
import Snackbar from "@mui/material/Snackbar";
import { LvbleProvider, Environment } from "@lvble/react";
import { useState, useCallback } from "react";

function App() {
  const onEvent = useCallback((eventType: string, data: any) => {
    console.debug(`Lvble event: ${eventType} with ${data}`);
    switch (eventType) {
      case "EXPERIENCE_OPENED":
        ...
        break;
      case "EXPERIENCE_CLOSED":
        ...
        break;
      default:
        console.log("Got unknown event", eventType, data);
        break;
    }
  }, []);

  return (
    <LvbleProvider environment={Environment.Local} onEvent={onEvent}>
      <MainContent />
    </LvbleProvider>
  );
}

export default App;

And then you can use the LvbleWidget component:

import { LvbleWidget } from "@lvble/react";

export default function Home() {
  return (
    <div className="flex flex-col gap-12">
      <h1>Home</h1>
      <div className="flex flex-wrap">
        <LvbleWidget token="token" />
      </div>
    </div>
  );
}

License

MIT

3.60.0

11 months ago

3.20.0

12 months ago

0.70.8

10 months ago

0.70.7

10 months ago

0.70.9

10 months ago

2.0.71

11 months ago

2.0.72

11 months ago

2.0.70

1 year ago

3.90.0

10 months ago

0.70.4

10 months ago

0.70.3

10 months ago

0.70.6

10 months ago

0.70.5

10 months ago

3.0.0

1 year ago

0.70.2

10 months ago

0.70.1

10 months ago

3.50.0

11 months ago

3.40.0

12 months ago

3.80.0

10 months ago

3.70.0

11 months ago

3.30.0

12 months ago

3.1.0

1 year ago

1.0.59

11 months ago

2.0.60

2 years ago

2.0.59

2 years ago

2.0.57

2 years ago

2.0.56

2 years ago

2.0.53

2 years ago

2.0.54

2 years ago

2.0.52

2 years ago

2.0.50

2 years ago

2.0.49

2 years ago

2.0.48

2 years ago

2.0.47

2 years ago

2.0.46

2 years ago

2.0.45

2 years ago

2.0.44

2 years ago

2.0.43

2 years ago

2.0.42

2 years ago

2.0.41

2 years ago

2.0.40

2 years ago

2.0.39

2 years ago

2.0.38

2 years ago

2.0.37

2 years ago

2.0.36

2 years ago

2.0.35

2 years ago

2.0.34

2 years ago

2.0.33

2 years ago

2.0.31

2 years ago

2.0.30

2 years ago

2.0.28

2 years ago

2.0.27

2 years ago

2.0.25

2 years ago

2.0.24

2 years ago

2.0.23

2 years ago

2.0.22

2 years ago

2.0.21

2 years ago

2.0.20

2 years ago

2.0.19

2 years ago

2.0.18

2 years ago

2.0.17

2 years ago

2.0.16

2 years ago

2.0.15

2 years ago

2.0.14

2 years ago

2.0.12

2 years ago

2.0.11

2 years ago

2.0.10

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago