Pressable
Use this component when you need to capture click or press events on its child elements without adding any additional visual styling. It subtly enhances user interaction by changing the cursor when hovering over the child elements, providing a clear indication of interactivity.
Anchor to pressablepropsPressableProps
A label that describes the purpose or contents of the element. When set, it will be announced to users using assistive technologies and will provide them with more context. When set, any children or label
supplied will not be announced to screen readers.
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help users navigate the page.
Adjust the block size.
number
: size in pixels.`${number}%`
: size in percentages of the available space.
The display property sets the display behavior of an element.
The URL to link to. If set, it will navigate to the location specified by href
after executing the callback.
A unique identifier for the link.
Adjust the inline size.
number
: size in pixels.`${number}%`
: size in percentages of the available space.
Alias for language
Indicate the text language. Useful when the text is in a different language than the rest of the page. It will allow assistive technologies such as screen readers to invoke the correct pronunciation. Reference of values ("subtag" label)
Adjust the maximum block size.
number
: size in pixels.`${number}%`
: size in percentages of the available space.
Adjust the maximum inline size.
number
: size in pixels.`${number}%`
: size in percentages of the available space.
Adjust the minimum block size.
number
: size in pixels.`${number}%`
: size in percentages of the available space.
Adjust the minimum inline size.
number
: size in pixels.`${number}%`
: size in percentages of the available space.
Callback when a link is pressed. If href
is set, it will execute the callback and then navigate to the location specified by href
.
Alias for Callback when a link is pressed. If
href
is set, it will execute the callback and then navigate to the location specified by href
.
Adjust the padding.
To shorten the code, it is possible to specify all the padding for all edges of the box in one property.
base
means block-start, inline-end, block-end and inline-start paddings arebase
.base none
means block-start and block-end paddings arebase
, inline-start and inline-end paddings arenone
.base none large
means block-start padding isbase
, inline-end padding isnone
, block-end padding islarge
and inline-start padding isnone
.base none large small
means block-start padding isbase
, inline-end padding isnone
, block-end padding islarge
and inline-start padding issmall
.true
applies a default padding that is appropriate for the component.
Learn more about the 1-to-4-value syntax at https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box
Adjust the block-padding.
base none
means block-start padding isbase
, block-end padding isnone
.
Adjust the block-end padding.
Adjust the block-start padding.
Adjust the inline padding.
base none
means inline-start padding isbase
, inline-end padding isnone
.
Adjust the inline-end padding.
Adjust the inline-start padding.
Specifies where to display the linked URL
Alias for href
If set, it will navigate to the location specified by to
after executing the callback.
Sets the link color.
inherit
will take the color value from its parent, giving the link a monochrome appearance. In some cases, its important to pair this property with another stylistic treatment, like an underline, to differentiate the link from a normal text.
Simple pressable example
Preview
