shadcn-labs/termcn / .agents/skills/ink
ink
VerifiedComprehensive Ink skill for building CLI applications with React. Covers components (Text, Box, Static, Transform), hooks (useInput, useApp, useFocus), Flexbox layout, testing, and accessibility.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.2 KB |
| references/accessibility/REFERENCE.md | markdown | 5.3 KB |
| references/components/REFERENCE.md | markdown | 1.7 KB |
| references/components/box.md | markdown | 4.9 KB |
| references/components/text.md | markdown | 2.4 KB |
| references/components/utilities.md | markdown | 3.3 KB |
| references/core/REFERENCE.md | markdown | 3.1 KB |
| references/core/api.md | markdown | 3.4 KB |
| references/core/configuration.md | markdown | 3.7 KB |
| references/core/gotchas.md | markdown | 4.6 KB |
| references/core/patterns.md | markdown | 6.7 KB |
| references/hooks/REFERENCE.md | markdown | 1.7 KB |
| references/hooks/app-lifecycle.md | markdown | 1.9 KB |
| references/hooks/focus.md | markdown | 5.2 KB |
| references/hooks/input.md | markdown | 3.7 KB |
| references/hooks/stdio.md | markdown | 3.1 KB |
| references/layout/REFERENCE.md | markdown | 4.1 KB |
| references/layout/patterns.md | markdown | 3.8 KB |
| references/testing/REFERENCE.md | markdown | 5.3 KB |
| rules/RULES.md | markdown | 1.4 KB |
| rules/components.md | markdown | 8.3 KB |
| rules/core.md | markdown | 9.0 KB |
| rules/hooks.md | markdown | 10.1 KB |
| rules/performance.md | markdown | 6.6 KB |
references/components/text.md
View on GitHub# `<Text>` Component
Display text and change its style. Supports color, bold, italic, underline, strikethrough, inverse, and dim.
## Import
```jsx
import {Text} from 'ink';
```
## Basic Usage
```jsx
<Text>Hello World</Text>
<Text color="green">Green text</Text>
<Text bold>Bold text</Text>
```
## Props
### color
Type: `string`
Change text color. Uses [chalk](https://github.com/chalk/chalk) under the hood.
```jsx
<Text color="green">Green</Text>
<Text color="#005cc5">Blue</Text>
<Text color="rgb(232, 131, 136)">Red</Text>
```
### backgroundColor
Type: `string`
Background color for text. Same format as `color`.
```jsx
<Text backgroundColor="green" color="white">Green bg</Text>
<Text backgroundColor="#005cc5" color="white">Blue bg</Text>
```
### dimColor
Type: `boolean` | Default: `false`
Make the color less bright:
```jsx
<Text color="red" dimColor>Dimmed Red</Text>
```
### bold
Type: `boolean` | Default: `false`
```jsx
<Text bold>Bold text</Text>
```
### italic
Type: `boolean` | Default: `false`
```jsx
<Text italic>Italic text</Text>
```
### underline
Type: `boolean` | Default: `false`
```jsx
<Text underline>Underlined text</Text>
```
### strikethrough
Type: `boolean` | Default: `false`
```jsx
<Text strikethrough>Crossed out</Text>
```
### inverse
Type: `boolean` | Default: `false`
Swap foreground and background colors:
```jsx
<Text inverse color="yellow">Inversed Yellow</Text>
```
### wrap
Type: `string` | Default: `'wrap'`
Allowed: `'wrap'` `'truncate'` `'truncate-start'` `'truncate-middle'` `'truncate-end'`
Controls text wrapping/truncation when wider than container:
```jsx
<Box width={7}>
<Text>Hello World</Text>
</Box>
// 'Hello\nWorld'
<Box width={7}>
<Text wrap="truncate">Hello World</Text>
</Box>
// 'Hello…'
<Box width={7}>
<Text wrap="truncate-middle">Hello World</Text>
</Box>
// 'He…ld'
<Box width={7}>
<Text wrap="truncate-start">Hello World</Text>
</Box>
// '…World'
```
**Note:** `truncate` is an alias for `truncate-end`.
## Nesting
`<Text>` can contain nested `<Text>` to compose styles:
```jsx
<Text>
Hello <Text bold>bold</Text> and <Text color="green">green</Text>
</Text>
```
## Restrictions
- `<Text>` can only contain text nodes and other `<Text>` components
- `<Box>` cannot be placed inside `<Text>`
- All visible text must be wrapped in `<Text>` — raw strings in `<Box>` throw errors
## See Also
- [Box](./box.md) - Container component
- [Utilities](./utilities.md) - Newline, Transform
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |