Skip to content

enum

Role

pub enum Role {
    Document,
    Main,
    Navigation,
    Banner,
    ContentInfo,
    Complementary,
    Region,
    Article,
    Form,
    Search,
    Group,
    Heading,
    Paragraph,
    BlockQuote,
    Note,
    StaticText,
    Button,
    Link,
    TextBox,
    SearchBox,
    CheckBox,
    Radio,
    RadioGroup,
    Switch,
    Slider,
    SpinButton,
    ComboBox,
    ListBox,
    Option,
    Image,
    List,
    ListItem,
    Separator,
    Figure,
    GraphicsSymbol,
    Dialog,
    AlertDialog,
    Alert,
    Status,
    Log,
    Timer,
    ProgressBar,
    Meter,
    Tab,
    TabList,
    TabPanel,
    Menu,
    MenuBar,
    MenuItem,
    Toolbar,
    Tooltip,
    Table,
    Row,
    Cell,
    ColumnHeader,
    RowHeader,
    Grid,
    GridCell,
    Tree,
    TreeItem,
}

What an element is to assistive technology: its ARIA role ([Role::aria] names it).

Variants

Document

Document

The document role.

Main

Main

The main role.

Navigation

Navigation

The navigation role.

Banner

Banner

The banner role.

ContentInfo

ContentInfo

The contentinfo role.

Complementary

Complementary

The complementary role.

Region

Region

The region role.

Article

Article

The article role.

Form

Form

The form role.

Search

Search

The search role.

Group

Group

The group role.

Heading

Heading

The heading role.

Paragraph

Paragraph

The paragraph role.

BlockQuote

BlockQuote

The blockquote role.

Note

Note

The note role.

StaticText

StaticText

The text role.

Button

Button

The button role.

Link

The link role.

TextBox

TextBox

The textbox role.

SearchBox

SearchBox

The searchbox role.

CheckBox

CheckBox

The checkbox role.

Radio

Radio

The radio role.

RadioGroup

RadioGroup

The radiogroup role.

Switch

Switch

The switch role.

Slider

Slider

The slider role.

SpinButton

SpinButton

The spinbutton role.

ComboBox

ComboBox

The combobox role.

ListBox

ListBox

The listbox role.

Option

Option

The option role.

Image

Image

The img role.

List

List

The list role.

ListItem

ListItem

The listitem role.

Separator

Separator

The separator role.

Figure

Figure

The figure role.

GraphicsSymbol

GraphicsSymbol

The graphics-symbol role.

Dialog

Dialog

The dialog role.

AlertDialog

AlertDialog

The alertdialog role.

Alert

Alert

The alert role.

Status

Status

The status role.

Log

Log

The log role.

Timer

Timer

The timer role.

ProgressBar

ProgressBar

The progressbar role.

Meter

Meter

The meter role.

Tab

Tab

The tab role.

TabList

TabList

The tablist role.

TabPanel

TabPanel

The tabpanel role.

Menu

Menu

The menu role.

MenuBar

MenuBar

The menubar role.

MenuItem

MenuItem

The menuitem role.

Toolbar

Toolbar

The toolbar role.

Tooltip

Tooltip

The tooltip role.

Table

Table

The table role.

Row

Row

The row role.

Cell

Cell

The cell role.

ColumnHeader

ColumnHeader

The columnheader role.

RowHeader

RowHeader

The rowheader role.

Grid

Grid

The grid role.

GridCell

GridCell

The gridcell role.

Tree

Tree

The tree role.

TreeItem

TreeItem

The treeitem role.

Methods

aria

pub fn aria(&self) -> &'static str

The ARIA role name.

parse

pub fn parse(s: &str) -> Option<Role>

The role whose ARIA name is s ("button" → [Role::Button]), if it's one Weft knows.

name_from_content

pub fn name_from_content(&self) -> bool

Roles whose accessible name comes from their text content.

is_leaf

pub fn is_leaf(&self) -> bool

Roles whose subtree is summarised by the node itself (children are not exposed separately).

interactive

pub fn interactive(&self) -> bool

Roles that are keyboard-focusable controls.

requires_name

pub fn requires_name(&self) -> bool

Roles that must have an accessible name.

Trait implementations