Text
The fundamental component for rendering strings.
The Text component is used to display text. It wraps Ink's built-in Text component but injects the active Caret-Tui theme for seamless styling variants.
Usage
import { Text } from 'caret-tui';
const App = () => (
<Text variant="error" bold>
Critical Failure!
</Text>
);Props
Accepts all props from Ink's TextProps, plus:
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted' | 'default' | 'default' | Applies a color from the active theme. |
children | React.ReactNode | - | The text or nested elements to render. |