Caret-Tui

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:

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted' | 'default''default'Applies a color from the active theme.
childrenReact.ReactNode-The text or nested elements to render.

On this page