🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

Paragraph

Paragraph

Source set: Android
@Deprecated(
    "Font.ResourceLoader is deprecated, instead pass FontFamily.Resolver",
    replaceWith =
        ReplaceWith(
            "Paragraph(text, style, Constraints(maxWidth = ceil(width).toInt()), density, " +
                "createFontFamilyResolver(resourceLoader), spanStyles, placeholders, maxLines, " +
                "if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)",
            "kotlin.math.ceil",
            "androidx.compose.ui.unit.Constraints",
            "androidx.compose.ui.text.style.TextOverflow",
            "androidx.compose.ui.text.font.createFontFamilyResolver",
        ),
)
public fun Paragraph(
    text: String,
    style: TextStyle,
    spanStyles: List<AnnotatedString.Range<SpanStyle>>,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    ellipsis: Boolean,
    width: Float,
    density: Density,
    resourceLoader: Font.ResourceLoader,
): Paragraph

Paragraph

Source set: Android
@Deprecated(
    "Paragraph that takes maximum allowed width is deprecated, pass constraints instead.",
    ReplaceWith(
        "Paragraph(text, style, Constraints(maxWidth = ceil(width).toInt()), density, " +
            "fontFamilyResolver, spanStyles, placeholders, maxLines, " +
            "if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)",
        "kotlin.math.ceil",
        "androidx.compose.ui.unit.Constraints",
        "androidx.compose.ui.text.style.TextOverflow",
    ),
)
public fun Paragraph(
    text: String,
    style: TextStyle,
    width: Float,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>>,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    ellipsis: Boolean,
): Paragraph

Paragraph

Source set: Android
@Deprecated(
    "Paragraph that takes `ellipsis: Boolean` is deprecated, pass TextOverflow instead.",
    level = DeprecationLevel.HIDDEN,
)
public fun Paragraph(
    text: String,
    style: TextStyle,
    constraints: Constraints,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>>,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    ellipsis: Boolean,
): Paragraph

Paragraph

Source set: Android
public fun Paragraph(
    text: String,
    style: TextStyle,
    constraints: Constraints,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>>,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    overflow: TextOverflow,
): Paragraph

Paragraph

Source set: Android
@Deprecated(
    "Paragraph that takes maximum allowed width is deprecated, pass constraints instead.",
    ReplaceWith(
        "Paragraph(paragraphIntrinsics, Constraints(maxWidth = ceil(width).toInt()), maxLines, " +
            "if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)",
        "kotlin.math.ceil",
        "androidx.compose.ui.unit.Constraints",
        "androidx.compose.ui.text.style.TextOverflow",
    ),
)
public fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    maxLines: Int,
    ellipsis: Boolean,
    width: Float,
): Paragraph

Paragraph

Source set: Android
@Deprecated(
    "Paragraph that takes ellipsis: Boolean is deprecated, pass TextOverflow instead.",
    level = DeprecationLevel.HIDDEN,
)
public fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    constraints: Constraints,
    maxLines: Int,
    ellipsis: Boolean,
): Paragraph

Paragraph

Source set: Android
public fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    constraints: Constraints,
    maxLines: Int,
    overflow: TextOverflow,
): Paragraph

Paragraph

Source set: Common
@Deprecated(
    "Font.ResourceLoader is deprecated, instead pass FontFamily.Resolver",
    replaceWith =
        ReplaceWith(
            "Paragraph(text, style, Constraints(maxWidth = ceil(width).toInt()), density, " +
                "createFontFamilyResolver(resourceLoader), spanStyles, placeholders, maxLines, " +
                "if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)",
            "kotlin.math.ceil",
            "androidx.compose.ui.unit.Constraints",
            "androidx.compose.ui.text.style.TextOverflow",
            "androidx.compose.ui.text.font.createFontFamilyResolver",
        ),
)
public fun Paragraph(
    text: String,
    style: TextStyle,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
    width: Float,
    density: Density,
    resourceLoader: Font.ResourceLoader,
): Paragraph

Paragraph

Source set: Common
@Deprecated(
    "Paragraph that takes maximum allowed width is deprecated, pass constraints instead.",
    ReplaceWith(
        "Paragraph(text, style, Constraints(maxWidth = ceil(width).toInt()), density, " +
            "fontFamilyResolver, spanStyles, placeholders, maxLines, " +
            "if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)",
        "kotlin.math.ceil",
        "androidx.compose.ui.unit.Constraints",
        "androidx.compose.ui.text.style.TextOverflow",
    ),
)
public fun Paragraph(
    text: String,
    style: TextStyle,
    width: Float,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
): Paragraph

Paragraph

Source set: Common
@Deprecated(
    "Paragraph that takes `ellipsis: Boolean` is deprecated, pass TextOverflow instead.",
    level = DeprecationLevel.HIDDEN,
)
public fun Paragraph(
    text: String,
    style: TextStyle,
    constraints: Constraints,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
): Paragraph

Paragraph

Source set: Common
public fun Paragraph(
    text: String,
    style: TextStyle,
    constraints: Constraints,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    overflow: TextOverflow = TextOverflow.Clip,
): Paragraph

Lays out a given text with the given constraints. A paragraph is a text that has a single ParagraphStyle.

If the style does not contain any androidx.compose.ui.text.style.TextDirection, androidx.compose.ui.text.style.TextDirection.Content is used as the default value.

Parameters

text the text to be laid out
style the TextStyle to be applied to the whole text
constraints how wide and tall the text is allowed to be. Constraints.maxWidth will define the width of the Paragraph. Constraints.maxHeight helps defining the number of lines that fit with ellipsis is true. Minimum components of the Constraints object are no-op.
density density of the device
fontFamilyResolver FontFamily.Resolver to be used to load the font given in SpanStyles
spanStyles SpanStyles to be applied to parts of text
placeholders a list of placeholder metrics which tells Paragraph where should be left blank to leave space for inline elements.
maxLines the maximum number of lines that the text can have
overflow specifies how visual overflow should be handled

Throws: IllegalArgumentException

if ParagraphStyle.textDirection is not set

Paragraph

Source set: Common
@Deprecated(
    "Paragraph that takes maximum allowed width is deprecated, pass constraints instead.",
    ReplaceWith(
        "Paragraph(paragraphIntrinsics, Constraints(maxWidth = ceil(width).toInt()), maxLines, " +
            "if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)",
        "kotlin.math.ceil",
        "androidx.compose.ui.unit.Constraints",
        "androidx.compose.ui.text.style.TextOverflow",
    ),
)
public fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
    width: Float,
): Paragraph

Paragraph

Source set: Common
@Deprecated(
    "Paragraph that takes ellipsis: Boolean is deprecated, pass TextOverflow instead.",
    level = DeprecationLevel.HIDDEN,
)
public fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    constraints: Constraints,
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
): Paragraph

Paragraph

Source set: Common
public fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    constraints: Constraints,
    maxLines: Int = DefaultMaxLines,
    overflow: TextOverflow = TextOverflow.Clip,
): Paragraph

Lays out the text in ParagraphIntrinsics with the given constraints. A paragraph is a text that has a single ParagraphStyle.

Parameters

paragraphIntrinsics ParagraphIntrinsics instance
constraints how wide and tall the text is allowed to be. Constraints.maxWidth will define the width of the Paragraph. Constraints.maxHeight helps defining the number of lines that fit with ellipsis is true. Minimum components of the Constraints object are no-op.
maxLines the maximum number of lines that the text can have
overflow specifies how visual overflow should be handled