Aria valuetext
Author: m | 2025-04-24
Example Uses of aria-valuetext ARIA Label. Listed below are the example uses of the aria-valuetext ARIA Label. The aria-valuetext attribute is used to represent text aria-valuetext. The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.
WAI-ARIA: aria-valuetext (Property) - DigitalA11Y
Heading level using the level optiongetByRole('heading', { level: 2 }).The level option queries the element(s) with the heading role matching theindicated level determined by the semantic HTML heading elements - ormatching the aria-level attribute.Given the example below,body> section> h1>Heading Level Oneh1> h2>First Heading Level Twoh2> h3>Heading Level Threeh3> div role="heading" aria-level="2">Second Heading Level Twodiv> section>body>you can query the Heading Level Three heading usinggetByRole('heading', { level: 3 }).getByRole('heading', {level: 1})// Heading Level OnegetAllByRole('heading', {level: 2})// [// First Heading Level Two,// Second Heading Level Two// ]While it is possible to explicitly set role="heading" and aria-levelattribute on an element, it is strongly encouraged to use the semantic HTMLheadings -.To learn more about the aria-level property, seeARIA aria-level.The level option is only applicable to the heading role. An error willbe thrown when used with any other role.valueA range widget can be queried by any value getByRole('spinbutton') or by aspecific value using the level optiongetByRole('spinbutton', { value: { now: 5, min: 0, max: 10, text: 'medium' } }).Note that you don't have to specify all properties in value. A subset issufficient e.g.getByRole('spinbutton', { value: { now: 5, text: 'medium' } }).Given the example below,body> section> button role="spinbutton" aria-valuenow="5" aria-valuemin="0" aria-valuemax="10" aria-valuetext="medium" > Volume button> button role="spinbutton" aria-valuenow="3" aria-valuemin="0" aria-valuemax="10" aria-valuetext="medium" > Pitch button> section>body>you can query specific spinbutton(s) with the following queries,getByRole('spinbutton', {value: {now: 5}})// VolumegetAllByRole('spinbutton', {value: {min: 0}})// [// Volume,// Pitch// ]Every specified property in value must match. For example, if you query for{value: {min: 0, now: 3}} aria-valuemin must be equal to 0
Slider Examples with aria-orientation and aria-valuetext
Rendered reverse.disabledbooleanfalseIf true, handles can't be moved.keyboardbooleantrueSupport using keyboard to move handlers.dotsbooleanfalseWhen the step value is greater than 1, you can set the dots to true if you want to render the slider with dots.onBeforeChangeFunctionNOOPonBeforeChange will be triggered when ontouchstart or onmousedown is triggered.onChangeFunctionNOOPonChange will be triggered while the value of Slider changing.onChangeCompleteFunctionNOOPonChangeComplete will be triggered when ontouchend or onmouseup is triggered.minimumTrackStyleObjectplease use trackStyle instead. (only used for slider, just for compatibility , will be deprecate at [email protected] )maximumTrackStyleObjectplease use railStyle instead (only used for slider, just for compatibility , will be deprecate at [email protected])handleStyleArray[Object] | Object[{}]The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for multi handle following element order)trackStyleArray[Object] | Object[{}]The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for multi track following element order)railStyleObject{}The style used for the track base color.dotStyleObject | (dotValue) => Object{}The style used for the dots.activeDotStyleObject | (dotValue) => Object{}The style used for the active dots.SliderNameTypeDefaultDescriptiondefaultValuenumber0Set initial value of slider.valuenumber-Set current value of slider.startPointnumberundefinedTrack starts from this value. If undefined, min is used.tabIndexnumber0Set the tabIndex of the slider handle.ariaLabelForHandlestring-Set the aria-label attribute on the slider handle.ariaLabelledByForHandlestring-Set the aria-labelledby attribute on the slider handle.ariaRequiredboolean-Set the aria-required attribute on the slider handle.ariaValueTextFormatterForHandle(value) => string-A function to set the aria-valuetext attribute on the slider handle. It receives the current value of the slider and returns a formatted string describing the value. See WAI-ARIA Authoring Practices 1.1 for more information.RangeNameTypeDefaultDescriptiondefaultValuenumber[][0, 0]Set initial positions of handles.valuenumber[]Set current positions of handles.tabIndexnumber[][0, 0]Set the tabIndex of each handle.ariaLabelGroupForHandlesArray[string]-Set the aria-label attribute on each handle.ariaLabelledByGroupForHandlesArray[string]-Set the aria-labelledby attribute on each handle.ariaValueTextFormatterGroupForHandlesArray[(value) => string]-A function to set the aria-valuetext attribute on each handle. It receives the current value of the slider and returns a formatted stringUnderstanding Aria Attributes: A Guide To Aria-valuetext
Disrupted the performance.ClamorThe soloist’s aria was met with applause.The clamor of the crowd made it hard to hear.RestThe beautiful aria was a moment of peace.The continual movement ensured there was no rest.DissensionThe duet’s aria brought agreement and harmony.The constant dissension among the musicians affected the performance.UnisonThe soprano’s aria was met with a round of applause.The band was playing out of unison, creating a disjointed sound.SereneThe gentle aria filled the room with tranquility.The hectic pace of the city was far from serene.ReposeThe aria lulled the crowd into a tranquil state.The constant noise outside interrupted any chance for repose.HubbubThe aria was the highlight of the opera night.The constant hubbub in the city overshadowed any enjoyment.DiscordThe aria was a masterpiece of musical harmony.The constant discord between the instruments was unsettling.DissonanceThe soprano’s aria was hauntingly beautiful.The unexpected dissonance in their voices was jarring.ClashThe aria brought everyone together in applause.The clash of opinions led to an unpleasant environment.DinThe enchanting aria captivated the audience.The din of construction outside made it hard to concentrate.SilenceThe aria was met with a standing ovation.The sudden silence that followed was almost palpable.ShoutThe powerful aria echoed through the theater.The shout from the angry audience member disrupted the performance.NoiseThe soprano’s aria was graceful and enchanting.The constant noise outside the concert hall was distracting.CalmnessThe soothing aria brought peace to everyone.The lack of calmness in the room was unsettling.IrritateThe melodic aria soothed the audience’s ears.The constant noise had begun to irritate the guests.DisarrayThe aria resonated through the concert hall.Outside, the chaotic disarray of the city was apparent.DisturbanceThe elegant aria brought tears to many eyes.The sudden disturbance from outside interrupted the performance.DisruptionThe soprano’s aria was filled with emotion.The disruption from the unruly crowd was unwelcome.DistressThe emotional aria touched the hearts of many.The sounds of distress from the street dampened the mood.PerturbationThe powerful aria moved the audience deeply.The constant perturbation from the neighbors was bothersome.TurmoilThe soprano’s aria was emotional and moving.The internal turmoil in the audience was hard to miss.RuckusThe haunting aria enthralled the entire hall.The loud ruckus outside the building was impossible to ignore.SerenityThe soprano’s aria had a peaceful quality to it.The lack of serenity in. Example Uses of aria-valuetext ARIA Label. Listed below are the example uses of the aria-valuetext ARIA Label. The aria-valuetext attribute is used to represent text aria-valuetext. The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.Understanding Aria Attributes: The Role Of Aria-valuetext
UsagePropsThemingProps#RangeSlider Props#The RangeSlider component wraps all its children in theBox component, so you can pass all Box props tochange its style.aria-labelDescriptionThe static string to use used for `aria-label`if no visible label is used.aria-labelledbyDescriptionThe static string `aria-labelledby` that points to theID of the element that serves as label for the slideraria-valuetextDescriptionThe static string to use used for `aria-valuetext`defaultValueDescriptionThe initial value of the slider in uncontrolled modedirectionDescriptionThe writing modefocusThumbOnChangeDescriptionIf false, the slider handle will not capture focus when value changes.getAriaValueTextDescriptionFunction that returns the `aria-valuetext` for screen readers.It is mostly used to generate a more human-readablerepresentation of the value for assistive technologiesType(value: number) => stringidDescriptionThe base id to use for the slider and its componentsisDisabledDescriptionIf true, the slider will be disabledisReadOnlyDescriptionIf true, the slider will be in `read-only` stateisReversedDescriptionIf true, the value will be incremented or decremented in reverse.maxDescriptionThe maximum allowed value of the slider. Cannot be less than min.minDescriptionThe minimum allowed value of the slider. Cannot be greater than max.minStepsBetweenThumbsDescriptionThe minimum distance between slider thumbs. Useful for preventingthe thumbs from being too close together.nameDescriptionThe name attribute of the hidden input field.This is particularly useful in formsonChangeDescriptionFunction called whenever the slider value changes (by dragging or clicking)Type(value: number[]) => voidonChangeEndDescriptionFunction called when the user is done selecting a new value (by dragging or clicking)Type(value: number[]) => voidonChangeStartDescriptionFunction called when the user starts selecting a new value (by dragging or clicking)Type(value: number[]) => voidstepDescriptionThe step in which increments/decrements have to be madevalueDescriptionThe value of the slider in controlled modeRangeSliderThumb Props#RangeSliderThumb composes Box so youaria-valuetext ARIA Label for Accessibility - Holistic SEO
Circular progress indicators are utilized to indicate an undetermined wait period or visually represent the duration of a process.Storybook@heroui/progressReact AriaSourceStyles sourceInstallationThe above command is for individual installation only. You may skip this step if @heroui/react is already installed globally.ImportUsageNote: Make sure to pass the aria-label prop when the label prop is not provided. This is required for accessibility.SizesColorsWith LabelWith ValueValue FormattingValues are formatted as a percentage by default, but this can be modified by using theformatOptions prop to specify a different format. formatOptions is compatible with theoption parameter of Intl.NumberFormat and is applied based on the current locale.Slotsbase: The base slot of the circular progress, it is the main container.svgWrapper: The wrapper of the svg circles and the value label.svg: The svg element of the circles.track: The track is the background circle of the circular progress.indicator: The indicator is the one that is filled according to the value.value: The value content.label: The label content.Custom StylesYou can customize the CircularProgress component by passing custom Tailwind CSS classes to the component slots.Data AttributesCircularProgress has the following attributes on the base element:data-indeterminate:Indicates whether the progress is indeterminate.data-disabled:Indicates whether the progress is disabled. Based on isDisabled prop.AccessibilityExposed to assistive technology as a progress bar via ARIA.Labeling support for accessibility.Internationalized number formatting as a percentage or value.Determinate and indeterminate progress support.Exposes the aria-valuenow, aria-valuemin, aria-valuemax and aria-valuetext attributes.APICircular Progress PropsPropTypeDefaultlabelReactNodesizesm | md | lg"md"colordefault | primary | secondary | success | warning | danger"primary"valuenumbervalueLabelReactNodeminValuenumber"0"maxValuenumber"100"formatOptionsIntl.NumberFormat"{style: 'percent'}"isIndeterminatebooleantrueshowValueLabelbooleantruestrokeWidthnumber"2"isDisabledbooleanfalsedisableAnimationbooleanfalseclassNamesPartial>Using the aria-valuetext attribute - Accessibility
In the realm of web accessibility, ensuring that web content is usable for everyone is crucial. One of the tools in this effort is the ARIA (Accessible Rich Internet Applications) specification. Among its various features, ARIA provides a way to enhance user experience through attributes like the ARIA placeholder. In this article, we will explore what an ARIA placeholder is, its purpose, and how it improves web accessibility.Understanding ARIABefore diving into ARIA placeholders specifically, it’s helpful to understand what ARIA is. ARIA, or Accessible Rich Internet Applications, is a set of attributes added to HTML elements to make web applications more accessible to users with disabilities. These attributes help assistive technologies (like screen readers) interpret and interact with web content in a meaningful way.An ARIA placeholder is a special attribute used to provide descriptive text within form fields or other interactive elements. This placeholder text is displayed within a field when it is empty and is intended to give users a hint about what kind of input is expected. Unlike the standard placeholder attribute in HTML, which provides similar functionality, ARIA placeholders are specifically designed to improve accessibility.Key Features of ARIA PlaceholderEnhanced Accessibility: ARIA placeholders are particularly useful for users who rely on screen readers. The attribute helps these users understand what information is required in form fields without having to rely solely on visual cues.Customizable: The text provided in ARIA placeholders can be tailored to fit the specific needs of users, ensuring that it is clear and descriptive.Integration with ARIA Roles: ARIA placeholders can be used in conjunction with other ARIA roles and properties to provide a comprehensive accessibility experience.How to Use ARIA PlaceholderImplementing an ARIA placeholder involves using the aria-placeholder attribute within HTML elements. Here’s an example of how to use it:In this example, the aria-placeholder attribute provides a description of what should be entered in the input field. This text will be read by screen readers, helping users with visual impairments understand the purpose of the field.Best Practices for ARIA PlaceholderBe Clear and Concise: The placeholder text should be straightforward and directly related to the input field. Avoid jargon or complex language.Consistency: Use consistent placeholder text across similar fields to avoid confusion.Combine with Other ARIA Attributes: For optimal accessibility, combine ARIA placeholders with other ARIA attributes like aria-label or aria-describedby to provide additional context.FAQs About ARIA PlaceholderWhat is the difference between ARIA placeholder and HTML placeholder?The HTML placeholder attribute provides a hint to users about what to enter in a form field. ARIA placeholders, on the other hand, are specifically designed to enhance accessibility for users relying on assistive technologies. While both serve similar purposes, ARIA placeholders are more focused on improving the experience for those with. Example Uses of aria-valuetext ARIA Label. Listed below are the example uses of the aria-valuetext ARIA Label. The aria-valuetext attribute is used to represent text aria-valuetext. The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.Comments
Heading level using the level optiongetByRole('heading', { level: 2 }).The level option queries the element(s) with the heading role matching theindicated level determined by the semantic HTML heading elements - ormatching the aria-level attribute.Given the example below,body> section> h1>Heading Level Oneh1> h2>First Heading Level Twoh2> h3>Heading Level Threeh3> div role="heading" aria-level="2">Second Heading Level Twodiv> section>body>you can query the Heading Level Three heading usinggetByRole('heading', { level: 3 }).getByRole('heading', {level: 1})// Heading Level OnegetAllByRole('heading', {level: 2})// [// First Heading Level Two,// Second Heading Level Two// ]While it is possible to explicitly set role="heading" and aria-levelattribute on an element, it is strongly encouraged to use the semantic HTMLheadings -.To learn more about the aria-level property, seeARIA aria-level.The level option is only applicable to the heading role. An error willbe thrown when used with any other role.valueA range widget can be queried by any value getByRole('spinbutton') or by aspecific value using the level optiongetByRole('spinbutton', { value: { now: 5, min: 0, max: 10, text: 'medium' } }).Note that you don't have to specify all properties in value. A subset issufficient e.g.getByRole('spinbutton', { value: { now: 5, text: 'medium' } }).Given the example below,body> section> button role="spinbutton" aria-valuenow="5" aria-valuemin="0" aria-valuemax="10" aria-valuetext="medium" > Volume button> button role="spinbutton" aria-valuenow="3" aria-valuemin="0" aria-valuemax="10" aria-valuetext="medium" > Pitch button> section>body>you can query specific spinbutton(s) with the following queries,getByRole('spinbutton', {value: {now: 5}})// VolumegetAllByRole('spinbutton', {value: {min: 0}})// [// Volume,// Pitch// ]Every specified property in value must match. For example, if you query for{value: {min: 0, now: 3}} aria-valuemin must be equal to 0
2025-03-27Rendered reverse.disabledbooleanfalseIf true, handles can't be moved.keyboardbooleantrueSupport using keyboard to move handlers.dotsbooleanfalseWhen the step value is greater than 1, you can set the dots to true if you want to render the slider with dots.onBeforeChangeFunctionNOOPonBeforeChange will be triggered when ontouchstart or onmousedown is triggered.onChangeFunctionNOOPonChange will be triggered while the value of Slider changing.onChangeCompleteFunctionNOOPonChangeComplete will be triggered when ontouchend or onmouseup is triggered.minimumTrackStyleObjectplease use trackStyle instead. (only used for slider, just for compatibility , will be deprecate at [email protected] )maximumTrackStyleObjectplease use railStyle instead (only used for slider, just for compatibility , will be deprecate at [email protected])handleStyleArray[Object] | Object[{}]The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for multi handle following element order)trackStyleArray[Object] | Object[{}]The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for multi track following element order)railStyleObject{}The style used for the track base color.dotStyleObject | (dotValue) => Object{}The style used for the dots.activeDotStyleObject | (dotValue) => Object{}The style used for the active dots.SliderNameTypeDefaultDescriptiondefaultValuenumber0Set initial value of slider.valuenumber-Set current value of slider.startPointnumberundefinedTrack starts from this value. If undefined, min is used.tabIndexnumber0Set the tabIndex of the slider handle.ariaLabelForHandlestring-Set the aria-label attribute on the slider handle.ariaLabelledByForHandlestring-Set the aria-labelledby attribute on the slider handle.ariaRequiredboolean-Set the aria-required attribute on the slider handle.ariaValueTextFormatterForHandle(value) => string-A function to set the aria-valuetext attribute on the slider handle. It receives the current value of the slider and returns a formatted string describing the value. See WAI-ARIA Authoring Practices 1.1 for more information.RangeNameTypeDefaultDescriptiondefaultValuenumber[][0, 0]Set initial positions of handles.valuenumber[]Set current positions of handles.tabIndexnumber[][0, 0]Set the tabIndex of each handle.ariaLabelGroupForHandlesArray[string]-Set the aria-label attribute on each handle.ariaLabelledByGroupForHandlesArray[string]-Set the aria-labelledby attribute on each handle.ariaValueTextFormatterGroupForHandlesArray[(value) => string]-A function to set the aria-valuetext attribute on each handle. It receives the current value of the slider and returns a formatted string
2025-04-12UsagePropsThemingProps#RangeSlider Props#The RangeSlider component wraps all its children in theBox component, so you can pass all Box props tochange its style.aria-labelDescriptionThe static string to use used for `aria-label`if no visible label is used.aria-labelledbyDescriptionThe static string `aria-labelledby` that points to theID of the element that serves as label for the slideraria-valuetextDescriptionThe static string to use used for `aria-valuetext`defaultValueDescriptionThe initial value of the slider in uncontrolled modedirectionDescriptionThe writing modefocusThumbOnChangeDescriptionIf false, the slider handle will not capture focus when value changes.getAriaValueTextDescriptionFunction that returns the `aria-valuetext` for screen readers.It is mostly used to generate a more human-readablerepresentation of the value for assistive technologiesType(value: number) => stringidDescriptionThe base id to use for the slider and its componentsisDisabledDescriptionIf true, the slider will be disabledisReadOnlyDescriptionIf true, the slider will be in `read-only` stateisReversedDescriptionIf true, the value will be incremented or decremented in reverse.maxDescriptionThe maximum allowed value of the slider. Cannot be less than min.minDescriptionThe minimum allowed value of the slider. Cannot be greater than max.minStepsBetweenThumbsDescriptionThe minimum distance between slider thumbs. Useful for preventingthe thumbs from being too close together.nameDescriptionThe name attribute of the hidden input field.This is particularly useful in formsonChangeDescriptionFunction called whenever the slider value changes (by dragging or clicking)Type(value: number[]) => voidonChangeEndDescriptionFunction called when the user is done selecting a new value (by dragging or clicking)Type(value: number[]) => voidonChangeStartDescriptionFunction called when the user starts selecting a new value (by dragging or clicking)Type(value: number[]) => voidstepDescriptionThe step in which increments/decrements have to be madevalueDescriptionThe value of the slider in controlled modeRangeSliderThumb Props#RangeSliderThumb composes Box so you
2025-03-28Circular progress indicators are utilized to indicate an undetermined wait period or visually represent the duration of a process.Storybook@heroui/progressReact AriaSourceStyles sourceInstallationThe above command is for individual installation only. You may skip this step if @heroui/react is already installed globally.ImportUsageNote: Make sure to pass the aria-label prop when the label prop is not provided. This is required for accessibility.SizesColorsWith LabelWith ValueValue FormattingValues are formatted as a percentage by default, but this can be modified by using theformatOptions prop to specify a different format. formatOptions is compatible with theoption parameter of Intl.NumberFormat and is applied based on the current locale.Slotsbase: The base slot of the circular progress, it is the main container.svgWrapper: The wrapper of the svg circles and the value label.svg: The svg element of the circles.track: The track is the background circle of the circular progress.indicator: The indicator is the one that is filled according to the value.value: The value content.label: The label content.Custom StylesYou can customize the CircularProgress component by passing custom Tailwind CSS classes to the component slots.Data AttributesCircularProgress has the following attributes on the base element:data-indeterminate:Indicates whether the progress is indeterminate.data-disabled:Indicates whether the progress is disabled. Based on isDisabled prop.AccessibilityExposed to assistive technology as a progress bar via ARIA.Labeling support for accessibility.Internationalized number formatting as a percentage or value.Determinate and indeterminate progress support.Exposes the aria-valuenow, aria-valuemin, aria-valuemax and aria-valuetext attributes.APICircular Progress PropsPropTypeDefaultlabelReactNodesizesm | md | lg"md"colordefault | primary | secondary | success | warning | danger"primary"valuenumbervalueLabelReactNodeminValuenumber"0"maxValuenumber"100"formatOptionsIntl.NumberFormat"{style: 'percent'}"isIndeterminatebooleantrueshowValueLabelbooleantruestrokeWidthnumber"2"isDisabledbooleanfalsedisableAnimationbooleanfalseclassNamesPartial>
2025-04-17Spinner (up and down buttons) havearia-hidden set to true tomake them invisible to screen readers.Keyboard Navigation#When you hit the ⬆ or ⬇ key, the input value will beincreased or decreased by stepHolding down Shift and pressing ⬆ or ⬇ willupdate the value by 10 * stepHolding down Ctrl or ⌘, and pressing ⬆ or ⬆ will update the value by `0.1 * step`Long press the Up and down stepper buttons will update the value at intervals.Props#NumberInput Props#NumberInput composes Flex with some additional props listed below.NameTypeDefaultDescriptionvaluenumberThe value of the input for controlled usage. Should be less than max and greater than mindefaultValuenumberThe initial value of the input. Should be less than max and greater than minonChange(value: number) => voidThe callback fired when the value changesminnumber-InfinityThe maximum value of the inputmaxnumberInfinityThe minimum value of the inputstepnumber1The step used to increment or decrement the valueprecisionnumberThe number of decimal points used to round the valueisReadOnlybooleanIf true, the input will be in readonly modeisInvalidbooleanIf true, the input will have aria-invalid set to trueisDisabledbooleanIf true, the input will be disabledkeepWithinRangebooleantrueIf true and you use the stepper or up/down arrow keys, the value will not exceed the max or go lower than minclampValueOnBlurbooleantrueIf true and the value is greater than max, the value will be reset to maxfocusInputOnChangebooleantrueIf true, the input will be focused as you increment or decrement the value with the steppergetAriaValueText(value: number) => stringtrueIt is used to set the aria-valuetext property of the inputNumberInputField Props#NumberInput composes Input so you can pass all Input props.NumberInputStepper
2025-03-31