Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
SROnly

Hides an element visually and improves accessibility by providing text to screen readers.

The SROnly component hides content visually while keeping it available to screen readers. Use it to provide additional context or accessible labels without impacting the visual design.
Example
Code
visually hidden text

Usage

Import the component


_10
import { SROnly } from '@faststore/ui'

Import Styles into your FastStore project

To apply the styles of this component in your FastStore project, import the following into your stylesheet:

_10
@import '@faststore/ui/src/components/atoms/SROnly/styles.scss';


Data attributes

You can target and override SROnly styles using the following data attributes:
data-fs-sr-only
Be cautious when modifying this style, as changes may break its functionality.

Props

NameTypeDescriptionDefault
text*stringDefines component element type (e.g.: span).
asElementTypeDefines component element type (e.g.: span, div, h1).span
Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
On this page