SushiText¶
A customizable text component that supports various styling options, decorations, prefix/suffix icons, and expandable text functionality.
Features:
- Text styling with different typography styles
- Optional prefix and suffix icons or custom composables
- Text decorations like underline and strikethrough
- Support for markdown formatting
- Expandable text with "read more" functionality
- Text alignment and arrangement customization
Example¶
The SushiText
component is used to display text with various styles and properties.
SushiText(
props = SushiTextProps(
text = "Hello World!",
prefixIcon = SushiIconProps(code = SushiIconCodes.IconMoon),
suffixIcon = SushiIconProps(code = SushiIconCodes.IconContactlessDining, color = SushiColorData(ColorName.Blue, ColorVariation.Variation500)),
color = SushiColorData(ColorName.Red, ColorVariation.Variation500),
type = SushiTextType.Regular300,
horizontalArrangement = Arrangement.SpaceBetween,
textDecoration = SushiTextDecoration.Underline()
),
Modifier.fillMaxWidth()
)
Component API¶
SushiText¶
Parameter | Description |
---|---|
text |
The text content to display |
color |
The color specification for the text |
type |
The typography style to apply to the text |
maxLines |
Maximum number of lines to display before truncating |
prefixIcon |
Optional icon to display before the text |
suffixIcon |
Optional icon to display after the text |
letterSpacing |
Spacing between letters in the text |
markdown |
Whether to interpret the text as markdown |
textDecoration |
Optional decoration to apply to the text (underline or strikethrough) |
textAlign |
Text alignment within its container |
overflow |
How to handle text that doesn't fit within maxLines |
overflowText |
Text to show as part of the "read more" functionality |
overflowTextColor |
Color for the overflow text |
softWrap |
Whether text should wrap to the next line |
minLines |
Minimum number of lines to display |
prefixSpacing |
Space between the prefix icon and the text |
suffixSpacing |
Space between the text and the suffix icon |
horizontalArrangement |
How to arrange content horizontally |
verticalAlignment |
How to align content vertically |
textBrush |
Optional brush for creating gradient or other effects on text |