SpeedText
Displays a formatted speed as text, adapting to the specified locale, unit system, and format style.
This composable renders a textual representation of a given speed value, with options for different units, formats, locales, and text styles. It automatically determines the SpeedUnit based on the locale if not explicitly provided.
Parameters
The Speed value to be displayed.
Modifier to be applied to the underlying Text
element.
The maximum number of lines for the text. Defaults to 1.
Defines the format style for the speed text.
SpeedFormat.Long: Displays in a detailed format (e.g., "60 miles per hour", "20 kilometers per hour").
SpeedFormat.Short: Displays in a concise format (e.g., "60 mph", "20 km/h"). This setting controls the level of verbosity in the speed representation.
The Locale to use for determining language and unit system (imperial or metric). Defaults to the current locale.
The SpeedUnit for the speed representation. By default, it is auto-selected based on the specified or current locale.
Text style applied to the Text
element displaying the speed.
Displays a formatted speed as text, with explicit control over unit and language.
This composable renders a textual representation of a given speed value using the specified SpeedUnit, language, and formatting style. Unlike the higher-level variant, this function requires you to explicitly define the unit and language, providing more control over localization.
Parameters
The Speed value to be displayed.
The SpeedUnit for the speed representation (e.g., meters per second, kilometers per hour, miles per hour).
The language code (e.g., "en", "fr") to use for localizing the speed value and unit.
Modifier to be applied to the underlying Text
element.
The maximum number of lines for the text. Defaults to 1.
Defines the format style for the speed text.
SpeedFormat.Long: Displays in a detailed format (e.g., "60 miles per hour", "20 kilometers per hour").
SpeedFormat.Short: Displays in a concise format (e.g., "60 mph", "20 km/h"). This setting controls the level of verbosity in the speed representation.
Text style applied to the Text
element displaying the speed.