Overview
The contact widget provides a floating button that opens a modal contact form. Visitors can submit their name, email, an optional subject, and a message — all without leaving your page. Messages appear in your SeggWat dashboard for review and follow-up.The contact widget uses the same modular architecture as the feedback and rating widgets. The core library loads only once when multiple widgets are on the same page.
Quick Start
Add the contact widget to your page with a single script tag:Configuration Options
Customize the widget’s appearance and behavior using data attributes:Required Attributes
Your unique project identifier from the SeggWat dashboard
Optional Attributes
Button layout and position
bottom-right(default) — Horizontal button with icon and text at bottom-rightright-side— Vertical text button on right side of screenicon-only— Round icon-only button at bottom-right (compact design)
Custom text for the button label. Translated automatically based on language if not set.Example:
Hex color code for the button and form accent elementsThe widget automatically generates hover states.Example:
Show an optional subject field in the contact formWhen enabled, adds a “Subject” text input between the email and message fields.Example:
Language code for the widget UISupported languages:
en, de, svFalls back to English if unsupported. Auto-detects from browser if not specified.Track contact submissions against specific application versions (e.g.,
1.2.3, v2.0.0-beta)Show or hide the “Powered by SeggWat” branding in the modal footerSet to
false, 0, or no to hide the branding.Override the API endpoint (useful for self-hosted or staging environments)
Examples
Basic Usage
With Subject Field
Custom Button Text
Right-Side Position
Icon-Only (Compact)
German Language
Full Configuration
JavaScript API
The widget exposes a global API for programmatic control:Set User ID
Associate contact submissions with specific users:- Max 255 characters
- Alphanumeric characters, hyphens, and underscores only
- Examples:
user_12345,cust-abc-123,USR_98765
Open Modal
Programmatically open the contact form:Close Modal
Close the contact form:Reset Widget
Reset the widget to its initial state (same as close):Form Fields
The contact form includes the following fields:| Field | Required | Max Length | Validation |
|---|---|---|---|
| Name | Yes | 200 chars | Must not be empty |
| Yes | 320 chars | Must contain @ and . | |
| Subject | No | 200 chars | Optional (enable with data-show-subject) |
| Message | Yes | 2000 chars | Minimum 3 characters |
How It Works
- The script loads and creates a floating button
- Core library loads automatically if not already present
- User clicks the button to open the modal
- User fills in the contact form
- Form validates on submit
- Data submits to
POST /api/v1/contact/submit - Success message shown with “We’ll get back to you soon”
- Modal can be closed
API Endpoint
The widget submits contact messages to:subject— Only included ifdata-show-subjectis enabled and the field is filledversion— Only included ifdata-versionis setpath— Automatically set to the current page pathname
200 OK on success
Combining with Other Widgets
The contact widget works alongside the feedback button and rating widgets. The core library loads only once:Use Cases
SaaS Products
Let users reach out without leaving your app. Collect feature requests, sales inquiries, and support questions.
Documentation Sites
Offer a direct contact option when self-service content isn’t enough. Capture context about which page prompted the message.
Landing Pages
Convert visitors into leads with a low-friction contact form. No separate contact page needed.
Support Portals
Provide a quick way for users to reach your team when they need help beyond what’s in your knowledge base.
Styling
The widget uses the SeggWat design system and adapts to light/dark mode automatically. CSS Classes (for custom styling): Button:.contact-button— Base button.contact-button-horizontal— Bottom-right layout.contact-button-vertical— Right-side layout.contact-button-icon-only— Round icon-only layout
.seggwat-contact-overlay— Full-screen backdrop.seggwat-contact-modal— Modal container.seggwat-contact-modal-header— Header section.seggwat-contact-modal-body— Form fields container.seggwat-contact-modal-footer— Button section
.seggwat-contact-field— Field wrapper.seggwat-contact-input— Text input.seggwat-contact-textarea— Message textarea.seggwat-contact-btn— Button base.seggwat-contact-btn-cancel— Cancel button.seggwat-contact-btn-submit— Submit button
.seggwat-contact-message— Success/error container.seggwat-contact-powered-by— Footer branding link
Accessibility
The contact widget is built with accessibility in mind:- ARIA labels on the floating button
- Focus management (auto-focus on name field when modal opens)
- Escape key to close the modal
- Click outside modal to close
- Semantic HTML labels for all form fields
- Required field indicators
- Disabled state during submission to prevent double-submit
Troubleshooting
Widget not appearing
Widget not appearing
Check these issues:
- Verify the script URL is correct:
https://seggwat.com/static/widgets/v1/seggwat-contact.js - Ensure your project key is correct
- Check browser console for JavaScript errors
- Make sure no other fixed element is overlapping the button
Messages not submitting
Messages not submitting
Common causes:
- Check browser Network tab for failed API calls
- Verify you’re viewing the correct project in dashboard
- Rate limiting (10 second cooldown between submissions)
- Check for CORS issues in console
- Ensure all required fields are filled correctly
Modal not opening or closing
Modal not opening or closing
Solutions:
- Check for JavaScript errors in console
- Ensure SeggWat core library loaded successfully
- Verify no CSS
z-indexconflicts with your page - Try
SeggwatContact.open()in console to test programmatic control
Translations not loading
Translations not loading
Check:
- Language code is valid:
en,de, orsv - Network tab shows translation file loading
- Falls back to English if translation file fails
- Custom
data-api-urlpoints to correct server