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
Thefs-mirrorinput attribute synchronizes the value of one input field (trigger) to another input field (target) in real-time. Any changes to the trigger input are automatically reflected in the target input.
Attribute Syntax
The attribute uses the following syntax:Elements
trigger
Defines the element as the trigger - the source input whose events will be mirrored.target
Defines the element as the target - the destination input that will receive the mirrored values.Usage Examples
How It Works
- Listens for input events on the window object
- Detects trigger inputs with the
triggerelement attribute - Finds matching target using the same instance identifier
- Validates input types match between trigger and target
- Copies the value from trigger to target in real-time
- Updates immediately as the user types
Instance Grouping
Use instance identifiers to create multiple independent mirror pairs:Supported Input Types
The mirror attribute works with:<input type="text"><input type="email"><input type="password"><input type="number"><input type="tel"><input type="url"><textarea>
Common Use Cases
Email Confirmation
Mirror email input to a confirmation field for verification.Live Preview
Show users a real-time preview of their input.URL Slugs
Display how a title will appear in a URL.Hidden Field Sync
Sync visible inputs to hidden form fields.Multi-Step Forms
Carry input values across form steps.The attribute monitors all input events globally, so you only need to add the element attributes to your inputs - no initialization code required.