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-inputcounter attribute creates a number input with custom increment and decrement buttons, allowing users to adjust numeric values with button clicks instead of typing.
Attribute Syntax
The attribute uses the following syntax:Elements
input
Defines the input element that will display the numeric value.increment
Defines a button that increases the input value.decrement
Defines a button that decreases the input value.clear
Defines a button that resets the input to its initial value.style
Defines the stylesheet element that contains CSS to hide the native number input arrows (spinners).Settings
initial
Defines the initial value for the numeric input.showarrows
Defines if the native number input arrows (spinners) should be displayed. By default, arrows are hidden.Usage Examples
How It Works
- Identifies input with the
inputelement attribute - Finds increment/decrement buttons in the same instance
- Hides native arrows unless
showarrowsis set to true - Sets initial value if specified
- Handles button clicks to increment or decrement the value
- Respects constraints like min, max, and step attributes
- Provides reset functionality via the clear button
Instance Grouping
To create multiple independent counters on the same page, use instance numbers:Accessibility
The attribute includes built-in accessibility features:- Maintains proper ARIA attributes
- Respects keyboard navigation
- Works with screen readers
- Supports standard HTML input constraints
The input is automatically set to
type="number" when the attribute initializes, ensuring proper numeric input behavior.Native Arrow Hiding
By default, the attribute hides native browser spinner arrows with the following CSS:showarrows="true" is set.