← Back
Text
[basic]Text rendering with style variations, ellipsis truncation, line clamping, and pretty wrapping
Text rendering with style variations, ellipsis truncation, line clamping, and pretty wrapping
For the full interactive experience:
$ mix raxol.playground
Code
defp sample_for(%{kind: :style, style: style}) do
text(@sample, style: style)
end
defp sample_for(%{kind: :ellipsis}) do
column style: %{gap: 0} do
[
rich_text(@long_line,
width: @wrap_width,
white_space: :nowrap,
text_overflow: :ellipsis
),
text(
"white_space: :nowrap, text_overflow: :ellipsis, width: #{@wrap_width}",
style: [:dim]
)
]
end
end