I can't understand what is `Semantics` from the d...
# compose
k
I can't understand what is
Semantics
from the documentation: for example here:
Copy code
Box(LayoutHeight.Fill + LayoutFlexible(1f), gravity = ContentGravity.BottomStart) {
            val baselineOffset = with(DensityAmbient.current) { TitleBaselineOffset.toDp() }
            AlignmentLineOffset(alignmentLine = LastBaseline, after = baselineOffset) {
                Semantics(container = true) {
                    CurrentTextStyleProvider(value = MaterialTheme.typography().h6) {
                        Row {
                            title()
                        }
                    }
                }
            }
        }
Can you please explain what is
Semantics
?
l
semantics is a subsystem of compose UI that allows us to kind of “mark” parts of the tree with metadata. This can be used for a lot of things: Testing, Accessibility, Developer tooling, etc.
🙏 1
k
Thanks, Is there any example of it's usage at the moment or it's not completed yet and we're gonna see it in future?
l
its being used across the codebase. for instance, you can look at Toggleable, Button, Checkbox, Text, etc.
👍 1
but some of the APIs are still in flux