Documentation Index
Fetch the complete documentation index at: https://mintlify.com/finsweet/attributes/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Query Param attribute allows you to automatically populate form fields and text elements with values from URL query parameters. This is useful for pre-filling forms, personalizing content, or passing data between pages.Attribute Syntax
Settings
Defines the name of the query parameter to read from the URL. The element will be populated with the value of this parameter.
Defines whether the query parameters should be removed from the URL after the page loads. Set to
true to clean up the URL.Usage Examples
Common Use Cases
Pre-filled Contact Forms
Allow users to click email links that pre-fill contact forms with their information:UTM Parameter Tracking
Capture marketing campaign data in hidden form fields:Personalized Landing Pages
Display personalized content based on URL parameters:Multi-Step Forms
Pass data between form steps via URL parameters:Referral Tracking
Capture referral codes from URL parameters:Product Configuration
Pre-select product options from URL:How It Works
- On page load, the attribute reads URL query parameters
- Elements with
fs-queryparam-nameare found - For each element, the corresponding parameter value is retrieved
- The element is populated based on its type:
- Text elements: Updates
textContent - Input fields: Sets the
value - Checkboxes: Sets
checkedtotrue - Radio buttons: Checks the radio with matching
value - Select dropdowns: Selects the option with matching
value - Textareas: Sets the
value
- Text elements: Updates
URL Encoding
Query parameter values should be URL-encoded:When using
fs-queryparam-removequery="true", the query parameters are removed from the browser’s URL after values are populated, creating a cleaner URL without losing the captured data.Integration with Other Attributes
Query Param works well with:- Display Values: Show query param values elsewhere on the page
- Form Submit: Submit forms with query param data
- CMS Filter: Filter CMS content based on query parameters