GlueX widget comes in two variants - compact and drawer. Variants allow customization of the exterior of the widget, like the presenting as a drawer. There are also several subvariants that helps to customize the interior look and feel as well as functionality
The compact variant is ideal for scenarios where screen real estate is limited, such as smaller screens or integrated sections of your web application. It provides all essential functionalities in a condensed view, allowing easy embedding anywhere on your pageTo use the compact variant, set the variant option in the widget configuration
Copy
const config = { // .. rest of the configuration .. variant: "compact",};
The drawer variant presents the widget as a sliding side panel, offering a richer user experience. It can be dynamically shown or hidden based on user interaction and maintains the same layout as the compact variantTo use the drawer variant, set the variant option in the widget configuration
Copy
const config = { // .. rest of the configuration .. variant: "drawer",};
How do we control the drawer?The drawer doesn’t have a pre built button to open and close it. To control the drawer you need to create and assign a ref to the widgetHere is an example of controlling the drawer with ref:
Subvariants enable you to present different workflows or specialized functionalities to your users within the widgetTo use a specific subvariant, simply set the subvariant option in your widget configuration
The “router” (or default) subvariant provides the standard routing functionality in a compact view, allowing users to perform swaps or other core operations and is suitable for general purpose useTo use the router variant, set the subvariant option in the widget configuration
Copy
const config = { // .. rest of the configuration .. subvariant: "router",};