Text
Paragraphs, a quote, clamped text.
On this page
Examples
Clamped text and a quote
Release notes
Version 0.2 adds typed read-only blocks. Each block is a component of its own with only its own parameters, so a misuse does not compile, and the text of a long note is clamped to a few lines until the reader asks for the rest with the Read more button.
Simplicity is prerequisite for reliability.
Razor
<div class="grid w-full max-w-2xl gap-6">
<KlyText Title="Release notes" Value="@Long" MaxLines="2" />
<KlyText Variant="KlyTextVariant.Quote" Value="Simplicity is prerequisite for reliability." Author="Edsger W. Dijkstra" Meta="1975" />
</div>
@code {
private const string Long = "Version 0.2 adds typed read-only blocks. Each block is a component of its own with only its own parameters, so a misuse does not compile, and the text of a long note is clamped to a few lines until the reader asks for the rest with the Read more button.";
}API
KlyText
One or more paragraphs, or a quote, with an optional title, clamp to a number of lines and footer.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Author |
string |
The author shown in the footer, before Meta . | |
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Loading |
bool |
false |
Shows a skeleton placeholder instead of the content. |
MaxLines |
int? |
When greater than zero, clamps Value to this number of lines and adds a Read more toggle. The toggle shows even when the text is shorter, and Paragraphs are not clamped. | |
Meta |
string |
Extra text shown in the footer, after Author . | |
Paragraphs |
IReadOnlyList |
The paragraphs of the block. When set, they replace Value . | |
Surface |
KlySurface? |
The surface treatment. Plain when not set. Values: Plain, Muted, Bordered, Elevated. |
|
Title |
string |
The bold first line of the text. | |
Ui |
TextUi |
Per-instance class overrides of the slots of the text, see TextUi . They are merged after the theme and the Class parameter wins on the root slot. | |
Value |
string |
The text of the block, used when Paragraphs is not set. | |
Variant |
KlyTextVariant |
KlyTextVariant. |
The layout: Default or Quote . Values: Default, Quote. |
Ui slots
Ui takes a TextUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyText , after the theme and the app configuration. |
Title |
Classes merged into the title slot of KlyText , after the theme and the app configuration. |
Paragraph |
Classes merged into the paragraph slot of KlyText , after the theme and the app configuration. |
Body |
Classes merged into the body slot of KlyText , after the theme and the app configuration. |
Toggle |
Classes merged into the toggle slot of KlyText , after the theme and the app configuration. |
Footer |
Classes merged into the footer slot of KlyText , after the theme and the app configuration. |
Skeleton |
Classes merged into the skeleton slot of KlyText , after the theme and the app configuration. |