Ga naar hoofdinhoud
Logo Appt Light

Bold text on React Native

Apps should use bold text when users have indicated this as a preference in the system settings. Turning on bold text improves the contrast of the letters against the background, making the text easier to read. This is vital if you are visually impaired, but it can also be useful if you need reading glasses.

Met React Native kun je de isBoldTextEnabled() methode van AccessibilityInfo gebruiken om te controleren of de gebruiker een voorkeur heeft voor vette tekst.

Let op: er wordt alleen gekeken naar iOS. Android is nog niet ondersteund.

import { AccessibilityInfo } from "react-native";

if (AccessibilityInfo.isBoldTextEnabled()) {
    // Use bold text
}
Bijdragen

Feedback?

Laat 't ons weten!