# Role

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/semantics/SemanticsProperties.kt+class:androidx.compose.ui.semantics.Role) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class Role
  ```

*** ** * ** ***

The type of user interface element. Accessibility services might use this to describe the element or do customizations. Most roles can be automatically resolved by the semantics properties of this element. But some elements with subtle differences need an exact role. If an exact role is not listed, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/package-summary#(androidx.compose.ui.semantics.SemanticsPropertyReceiver).role()` should not be set and the framework will automatically resolve it.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#Button()` This element is a button control. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#Carousel()` This element is a Carousel. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#Checkbox()` This element is a Checkbox which is a component that represents two states (checked / unchecked). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#DropdownList()` This element is associated with a drop down menu. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#Image()` This element is an image. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#RadioButton()` This element is a RadioButton which is a component to represent two states, selected and not selected. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#Switch()` This element is a Switch which is a two state toggleable component that provides on/off like options. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#Tab()` This element is a Tab which represents a single page of content using a text label and/or icon. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#ValuePicker()` This element is a value picker. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role#toString()()` | Cmn |

## Public companion properties

### Button

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Button: Role
```

This element is a button control. Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#Disabled()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#OnClick()`

### Carousel

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val Carousel: Role
```

This element is a Carousel. This means that even if Pager actions are added, this element will behave like a regular List collection.

Associated semantics properties for Pager accessibility actions: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#PageUp()`,`https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#PageDown()`,`https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#PageLeft()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#PageRight()`

### Checkbox

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Checkbox: Role
```

This element is a Checkbox which is a component that represents two states (checked / unchecked). Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#Disabled()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#StateDescription()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#OnClick()`

### DropdownList

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.4.0)

```
val DropdownList: Role
```

This element is associated with a drop down menu. Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#OnClick()`

### Image

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Image: Role
```

This element is an image. Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#ContentDescription()`

### RadioButton

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RadioButton: Role
```

This element is a RadioButton which is a component to represent two states, selected and not selected. Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#Disabled()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#StateDescription()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#OnClick()`

### Switch

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Switch: Role
```

This element is a Switch which is a two state toggleable component that provides on/off like options. Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#Disabled()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#StateDescription()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#OnClick()`

### Tab

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Tab: Role
```

This element is a Tab which represents a single page of content using a text label and/or icon. A Tab also has two states: selected and not selected. Associated semantics properties for accessibility: `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#Disabled()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsProperties#StateDescription()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsActions#OnClick()`

### ValuePicker

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val ValuePicker: Role
```

This element is a value picker. It should support the following accessibility actions to enable selection of the next and previous values:

android.view.accessibility.AccessibilityNodeInfo.ACTION_SCROLL_FORWARD: Select the next value.

android.view.accessibility.AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD: Select the previous value.

These actions allow accessibility services to interact with this node programmatically on behalf of users, facilitating navigation within sets of selectable values.

## Public functions

### toString

Cmn

```
open fun toString(): String
```