ListElementConfig
interface ListElementConfig {Â Â enableDynamicMarkerBoxWidth?: boolean;Â Â enableExperimentalRtl?: boolean;Â Â enableRemoveBottomMarginIfNested?: boolean;Â Â enableRemoveTopMarginIfNested?: boolean;Â Â getFallbackListStyleTypeFromNestLevel?: (nestLevel: number) => DefaultSupportedListStyleType;Â Â markerBoxStyle?: StyleProp<ViewStyle>;Â Â markerTextStyle?: TextStyle;}Configuration for ol and ul.
Fields#
enableDynamicMarkerBoxWidth#
enableDynamicMarkerBoxWidth?: boolean;When true, the width of the marker box will be adapted depending on
fontSize and the highest number of characters in the printed range.
If this length is superior than the left (or right in ltr mode) padding, a supplemental space will be added before every list child.
When false, the left (or right in ltr mode) padding will be invariable.
Default: false
enableExperimentalRtl#
enableExperimentalRtl?: boolean;If true and the direction is set to 'rtl' (either via dir attribute
or direction CSS property):
- lists markers will be flushed to the right when
I18nManager.isRtlisfalse. - list markers prefixes and suffixes print order will be reversed.
Default: false
Remarks
Beware that left and right padding of li elements will not be switched.
enableRemoveBottomMarginIfNested#
enableRemoveBottomMarginIfNested?: boolean;Remove bottom margin if this element parent is an li element and it
is its last child.
Default: true
enableRemoveTopMarginIfNested#
enableRemoveTopMarginIfNested?: boolean;Remove top margin if this element parent is an li element and it
is its first child.
Default: true
getFallbackListStyleTypeFromNestLevel#
Get default list-style-type given the number of nest level for this list.
Remarks
This function will not be used when a list element has its own
list-style-type CSS property, or has inherited this property from
parents.
markerBoxStyle#
markerBoxStyle?: StyleProp<ViewStyle>;Customize the marker box appearance (the View containing the marker,
e.g. the symbol prefixing list elements).
Remarks
This is useful to set some right padding or a different background for example.
warning
Do not:
- Use margin (since the width will match the
<ol>/<ul>padding left) - Set width constraints (since the width will match the
<ol>/<ul>padding left)
markerTextStyle#
markerTextStyle?: TextStyle;Customize the marker text appearance (the Text component in which the marker,
e.g. the symbol prefixing list elements).
Remarks
Useful to set the color, fontFamily, fontSize of the marker.
Avoid using padding here, take advantage of markerBoxStyle instead.
warning
This style must be a style object! Arrays, and Stylesheet styles will not work.