States and Properties

Back to Overview
00:00 --> 00:01
So, you know, don't bother with it.

00:03 --> 00:04
States and properties.

00:04 --> 00:06
There are a lot of states and properties in ARIA.

00:06 --> 00:13
If we talk through all of them, we would be here until like, you know, in seven weeks we wouldn't be done.

00:14 --> 00:15
This is super complex.

00:15 --> 00:27
And the good thing is once you come across one, you can easily, relatively easily check in the specification if it meets your use case.

00:28 --> 00:31
So let's start with global states and properties.

00:31 --> 00:35
So these can be generally put on anything.

00:36 --> 00:40
And I want to highlight a few.

00:41 --> 00:45
ARIA-label, for example, ARIA-label-by, we already talked about those.

00:46 --> 00:49
ARIA-live makes everything, anything a live region.

00:49 --> 00:55
So if you have a span and you want to make it a live region, you can use the role, but

00:55 --> 00:57
You can also use ARIA live.

00:58 --> 01:00
And there are a couple of others.

01:01 --> 01:06
ARIA role description defines what is read as the role.

01:06 --> 01:15
So you might have something that is, let's say, an article and you use an article element.

01:16 --> 01:20
But in reality, you want it to be announced as product.

01:21 --> 01:24
Then you can use ARIA role description equals product.

01:24 --> 01:29
And it would not be announced as a new phone article.

01:30 --> 01:36
It would be announced as new phone product, which can help in certain situations.

01:36 --> 01:42
I think I've never really used it in a practical way.

01:43 --> 01:50
And then there's ARIA current, which basically means that you can say on a link, this is the link you're currently on.

01:50 --> 02:06
So if you're in navigation, you can use ARIA current and then you can even use CSS to query that ARIA current true or page status and then apply your CSS that way.

02:06 --> 02:07
It's pretty neat.

02:10 --> 02:12
And we have the widget attributes.

02:12 --> 02:19
Those are like a lot of things as well, but they basically mirror a lot of things that we can do with the input element already.

02:20 --> 02:24
Things like ARIA checked, it's HTML checked basically.

02:25 --> 02:29
But also things like ARIA invalid or ARIA required.

02:30 --> 02:36
These are, as I have said, only applicable for users with screen readers.

02:37 --> 02:43
So ARIA required will not trigger the browser's required validation.

02:43 --> 02:49
It will not do anything to prompt the user to fill out required.

02:49 --> 02:55
The only thing that aria-required does is to announce to the screen reader that this is a required field.

02:56 --> 03:00
And depending on your use case, that might be the better thing to do.

03:01 --> 03:03
So there are a couple of those.

03:04 --> 03:13
aria-level, for example, is if you have headings, heading level 3, you would have role heading, and then aria-level 3.

03:14 --> 03:15
So that would be the equivalent.

03:16 --> 03:21
Of course, you can type H3, so why would you do anything else in this case?

03:23 --> 03:26
Yeah, and then you have ARIA sort for sorted tables and stuff like this.

03:27 --> 03:33
So there's all a lot of information that you can convey.

03:36 --> 03:38
Then we have the live region attributes.

03:38 --> 03:42
Those are ARIA-atomic, ARIA-busy, ARIA-live, and ARIA-relevant.

03:44 --> 03:52
really quickly as the overview ARIA live switches live regions on and off. So you can say ARIA live,

03:53 --> 04:00
I think it's off as the there's no live region, then you have ARIA live polite, which is basically

04:00 --> 04:07
what the status does. It waits until the last announcement and then announces whatever you

04:07 --> 04:13
have put into the live region. Or you could do ARIA live assertive and that would

04:13 --> 04:23
basically interrupt the current announcement and blurt out whatever you put in there.

04:24 --> 04:30
ARIA-busy is used as a true-false for when you cannot interact with something.

04:30 --> 04:32
You can say, oh, the website is busy, wait a second.

04:33 --> 04:34
That can be useful.

04:36 --> 04:40
If you set ARIA-atomic true, that means the whole live region is red.

04:42 --> 04:50
And if you set aria-atomic false, which is the default, then only the changes or edit text will be read.

04:51 --> 04:55
And what is read, that is defined by aria-relevant.

04:55 --> 05:04
So if aria-relevant, you can say edit text, remove text, and stuff like that.

05:05 --> 05:17
There are also drag and drop attributes in ARIA 1.2, but they're all, all two are deprecated since ARIA 1.1.

05:17 --> 05:18
So I will not talk about them.

05:22 --> 05:25
And then there are a couple of relationship attributes.

05:25 --> 05:48
So this is basically to make sure that if you have something like a table and you want to announce the row, you can actually use ARIA row index for the current row you're in and then row count for the number of the rows.

05:48 --> 05:54
But this is all built into HTML. If you use a proper table, you don't need to think about that.

05:54 --> 06:04
theoretically aria-flow2 would be nice to say like hey go there after this but nothing supports that

06:04 --> 06:10
so support is a big question mark

06:10 --> 06:21
and those are all the attributes and the states and properties if you have questions on any of

06:21 --> 06:30
those. If something jumps out at you, feel free to just ask and I can explain that further and

06:30 --> 06:36
also explain if it is actually supported in practice or not, which is always the question

06:36 --> 06:38
with these ARIA things.

06:38 --> 06:39
Thank you.