Skip to main content

Floating Widget

The floating widget is a non-intrusive button that appears in a corner of your site and expands into a modal when clicked.

Configuration

Initialize the floating widget with the RevealWidget.init() method:

const widgetInstance = RevealWidget.init({
interviewId: "your-interview-id",
position: "bottom-right",
theme: "light",
primaryColor: "#4a90e2",
autoOpenOnScroll: false,
scrollPercentage: 60,
interviewee: "optional-interviewee-id",
language: "english"
});

Configuration Options

ParameterTypeDefaultDescription
interviewIdStringRequiredThe ID of your Reveal interview
positionString"bottom-right"Widget placement: "bottom-right", "bottom-left", "top-right", "top-left"
themeString"light"Widget theme: "light" or "dark"
primaryColorStringCustom primary color (hex/RGB/name)
autoOpenOnScrollBooleanfalseWhether to automatically open the widget when user scrolls to a specified page depth
scrollPercentageNumber60Page scroll percentage (0-100) to trigger auto-open
intervieweeStringIdentifier for the interview participant
languageString"english"Language for the interview session: "english" or "portuguese"

Methods

// Remove the widget from the page
widgetInstance.close();

Examples

Basic Implementation

<script>
document.addEventListener('DOMContentLoaded', function() {
RevealWidget.init({
interviewId: "your-interview-id"
});
});
</script>

Custom Styled Widget

<script>
RevealWidget.init({
interviewId: "your-interview-id",
position: "bottom-left",
theme: "dark",
primaryColor: "#FF5733"
});
</script>

Auto-opening Widget

<script>
RevealWidget.init({
interviewId: "your-interview-id",
autoOpenOnScroll: true,
scrollPercentage: 40
});
</script>

Portuguese Language Widget

<script>
RevealWidget.init({
interviewId: "your-interview-id",
language: "portuguese"
});
</script>