Accessibility

Give custom view trees useful labels, values, hints, traits, and Dynamic Type behavior.

Every SkeleKit View exposes the core native accessibility properties. Most standard controls already provide sensible behavior; add metadata when a custom composition would otherwise be ambiguous.

The base view tree and inheritance model are introduced in views and view trees.

var favorite = new Border
{
    Content = new Image { Source = "star.fill" },
    TapCommand = Command.From(viewModel.ToggleFavorite),
    
    IsAccessibilityElement = true,
    AccessibilityLabel = "Favorite",
    AccessibilityValue = viewModel.IsFavorite ? "On" : "Off",
    AccessibilityHint = "Double-tap to change",
    AccessibilityTraits = AccessibilityTraits.Button
};

AccessibilityLabel names the element. AccessibilityValue describes changing state. AccessibilityHint explains the result of an unfamiliar action rather than repeating its label.

AccessibilityTraits is a flags enum and can combine roles such as Button, Link, Header, Image, Selected, StaticText, or Adjustable. Use the semantic role the element actually performs.

IsAccessibilityElement explicitly includes or excludes a view. Leave it unset to keep the native control's default. When a container is exposed as one combined element, avoid also exposing decorative children as duplicate stops.

AccessibilityIdentifier is intended for UI automation. It is not read as a user-facing label and should remain stable across localization.

Type, motion, and contrast

Prefer Label.TextStyle and TextView.TextStyle so text follows Dynamic Type. Test the largest accessibility sizes rather than immediately capping them with MaxFontSize.

SkeleKit's page transitions check the system Reduce Motion preference. App-defined animations should also avoid essential movement or offer a simpler state change when reduced motion is enabled.

System colors adapt to light and dark appearance, but adaptation alone does not guarantee contrast. Check custom tint, material, disabled, selected, and overlay combinations in both appearances and with increased contrast settings.

See colors and materials and application setup and DI for the related visual behavior.