Web Components
The Solid SDK can register widgets as web components (custom elements) for use in any framework or vanilla HTML/JavaScript.Registration
CallregisterWebComponents once at application startup:
Registration Options
| Option | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Your organization ID |
publishableKey | string | Yes | Your publishable API key |
locale | Locale | No | Default language locale |
translations | PartialTranslationMessages | No | Custom translation overrides |
themeConfig | ExperienceTheme | No | Default theme configuration |
variant | WidgetVariant | No | Default visual variant |
Full Configuration Example
Available Web Components
| Web Component | SolidJS Component | Description |
|---|---|---|
<fanfare-queue-widget> | QueueWidget | Virtual waiting room |
<fanfare-draw-widget> | DrawWidget | Lottery/raffle |
<fanfare-auction-widget> | AuctionWidget | Real-time bidding |
<fanfare-waitlist-widget> | WaitlistWidget | Pre-registration |
<fanfare-timed-release-widget> | TimedReleaseWidget | Flash sale |
<fanfare-experience-widget> | ExperienceWidget | Full journey |
Usage in Different Frameworks
React
Vue
Angular
Vanilla HTML/JavaScript
Attribute Mapping
Web component attributes use kebab-case and are strings:| SolidJS Prop | Web Component Attribute | Type Conversion |
|---|---|---|
queueId | queue-id | String (direct) |
showHeader | show-header | String to Boolean |
autoStart | auto-start | String to Boolean |
checkoutUrl | checkout-url | String (direct) |
Boolean Attributes
Boolean props accept string values:"true"or"1"=true"false"or"0"or absent =false
Event Handling
Web components emit custom events that bubble up the DOM:Event Reference
Queue Widget Events
| Event | Detail |
|---|---|
fanfare-queue-enter | { queueId: string } |
fanfare-queue-leave | { queueId: string } |
fanfare-queue-position-change | { queueId, position } |
fanfare-queue-admitted | { queueId, token } |
Draw Widget Events
| Event | Detail |
|---|---|
fanfare-draw-enter | { drawId: string } |
fanfare-draw-withdraw | { drawId: string } |
fanfare-draw-result | { drawId, won: boolean } |
fanfare-draw-proceed | { drawId, token } |
Auction Widget Events
| Event | Detail |
|---|---|
fanfare-auction-bid | { auctionId, amount } |
fanfare-auction-outbid | { auctionId, newBid } |
fanfare-auction-win | { auctionId, amount } |
fanfare-auction-proceed | { auctionId, token } |
Experience Widget Events
| Event | Detail |
|---|---|
fanfare-journey-change | { snapshot } |
fanfare-admitted | { token: string } |
fanfare-error | { error: string } |
Styling Web Components
CSS Variables
Web components can be styled via CSS custom properties:Scoped Styles
Target specific widgets:Container Classes
Use thecontainer-class attribute:
TypeScript Declarations
Add type declarations for your framework:React
Vue
Lazy Loading
Register web components lazily:Related
- Overview - Solid SDK overview
- Components - SolidJS components
- Widgets Overview - Widget architecture
- Styling - CSS styling options