-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextBlock.ts
More file actions
29 lines (27 loc) · 849 Bytes
/
TextBlock.ts
File metadata and controls
29 lines (27 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { type Responsive, type UiNode, element } from "../internal.ts";
type TextBlockProps = {
/**
* Horizontal text alignment. Can be responsive.
* Inherited from surrounding context if not explicitly set.
*/
align?: Responsive<"left" | "center" | "right">;
/**
* Maximum number of lines to display before truncating. Can be responsive.
*/
maxLines?: Responsive<number>;
/**
* When true, reduces the text emphasis by applying a lower-intensity color variant.
*/
muted?: boolean;
/**
* The content to be displayed. Can be a string or more complex UI elements.
*/
children?: UiNode;
};
/**
* A component for rendering block-level text content.
* Color is inherited from the surrounding context.
*/
export function TextBlock(props: TextBlockProps): UiNode {
return element("ui-text-block", props);
}