Parameters
A string that identifies the accessibility element. This is the primary way screen readers announce the element.
Sets a label that identifies this accessibility element.
.accessibilityLabel(label: string): Component;
Button("→", () => {})
.accessibilityLabel("Next page")
Image("star-icon.png")
.accessibilityLabel("Favorite item")
.onTapGesture(() => {
toggleFavorite()
})
HStack([
Image("profile.jpg"),
VStack([
Text("John Doe"),
Text("Software Engineer")
])
]).accessibilityLabel("John Doe, Software Engineer")
const [email, setEmail] = useState("")
TextField({ placeholder: "", text: email, setText: setEmail })
.accessibilityLabel("Email address")
Rectangle()
.fill(isEnabled ? Color("green") : Color("gray"))
.accessibilityLabel(isEnabled ? "Feature enabled" : "Feature disabled")
.onTapGesture(() => {
toggleFeature()
})