# Accessibility Considerations with Stacked Cards Custom Layout

DevFeed: [Accessibility Considerations with Stacked Cards Custom Layout](<https://devfeed.tech/articles/accessibility-considerations-with-stacked-cards-custom-layout-38487.md>)

Original publisher: [Read original article](<https://eevis.codes/blog/2024-07-25/accessibility-considerations-with-stacked-cards-custom-layout/>)

Author: Eevis Panula

Published: 2024-07-25T03:26:13.958000Z

Content type: tutorial

Language: en

Sources: [Eevis Blog](<https://devfeed.tech/sources/eevis-blog.md>)

Topics: [Accessibility](<https://devfeed.tech/topics/accessibility.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>), [Compose](<https://devfeed.tech/topics/compose.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [assistive-technology](<https://devfeed.tech/tags/assistive-technology.md>), [component](<https://devfeed.tech/tags/component.md>), [compose](<https://devfeed.tech/tags/compose.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [user](<https://devfeed.tech/tags/user.md>)

## AI overview

This article examines accessibility issues in a stacked-cards custom layout built with Compose. It focuses on Switch Access, where deleting a card causes focus to disappear, and discusses moving the click action to the stack component as a partial fix. It also considers improving content labels for Voice Access and notes that the coverage is not exhaustive.

## Source excerpt

A couple of weeks ago, I published a blog post Stacked Cards Layout With Compose - And Cats. The layout has some accessibility issues, and I aim to fix some of them in this blog post. There are a couple of issues I'm not fixing here because of the scope of this blog post; instead, I'm discussing the problems they're causing and possible solutions. This time, I will also be pointing out some things that are good about the layout. I feel like I'm often just talking about problems and trying to find them, but this time, I'll share something that's working well, too. Before we dive into the different aspects I chose for this blog post, here is a fair warning: This list is not extensive and doesn't contain all possible accessibility problems that this kind of layout might have. I didn't test with every possible assistive technology or setting. My goal was progress over perfection, and I believe that the modifications I'll list are already significant improvements to the accessibility of this layout. Switch Access The first assistive technology I'm going to talk about and improve the app for is Switch Access. It's a service that lets the user navigate their phone with one or more switches. If you want to learn more, the Android Accessibility Checklist I've created has a section about Switch Access: Test with Switch Access. When testing with Switch Access, there was one problem I could find: When removing a card from the stack, the focus didn't go anywhere. It just disappeared. The reason for that is that the component on which the focus was had been deleted, and the accessibility service lost the focus. One way to fix this issue is by moving the click event to the stack-component instead of the card itself. We can do this by adding a semantics-modifier with an onClick-lambda to the CardStack's modifier-property. Let's also move the lastItem outside the CardStack so that we can use it in the function we add: // MainScreen.kt val lastItem = catIds.value.last() CardStack( Mo