The @justweb3/ui library provides a unified UI experience and handles theme generation for the @justweb3/widget package. It simplifies theming across widgets by dynamically generating color variations and supports custom theming through its context provider.
Table of Contents
Installation
Install the library using npm or yarn:
npm install @justweb3/ui
# or
yarn add @justweb3/ui
Usage
Setup with JustWeb3ThemeProvider
To enable the theme context for your widget, wrap your application or component with the JustWeb3ThemeProvider. This ensures consistent theming across components and allows you to customize colors dynamically.
The JustWeb3ThemeProvider offers a changeTheme function to dynamically change the primary, background, or destructive colors. Here's an example demonstrating dynamic theme switching.