Kinetik UI

Read More

.md

Long text folded to a few lines that fade out; Read more lets it out to full height as the fade dissolves.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add read-more

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/read-more.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/read-more.tsx
    View source files

Usage

import { ReadMore } from '@/components/kinetik/read-more';

<ReadMore lines={3}>{listing.description}</ReadMore>;

The last visible line fades into fadeColor, which defaults to the theme surface. Pass the colour behind the text, as #RRGGBB, when it sits on something else.

When to use

  • Descriptions, reviews and bios that are worth reading but should not push the rest of the screen down.
  • Lists of items where each has a long note.

When not to use

  • Text people must read, such as terms they agree to. Show it in full.
  • A single sentence. Folding saves nothing.

Notes

  • The toggle appears only when the text is longer than lines. Short text renders as it is.
  • Change fontSize with textStyle and set its lineHeight too, so the fold lands on a whole line.
  • Screen readers always get the whole text; the toggle is still offered so the screen matches what is read.
  • With reduced motion the text opens and folds at once.

Props

ReadMoreProps

PropTypeDefaultDescription
childrenrequiredstring—The text. Paragraphs can be separated with blank lines.
linesnumber3Lines shown while folded. Defaults to 3.
moreLabelstring'Read more'Defaults to 'Read more'.
lessLabelstring'Show less'Defaults to 'Show less'.
fadeColorstring—The colour behind the text, as `#RRGGBB`; the last line fades into it. Defaults to the theme surface.
expandedboolean—Controlled state. Leave unset to let the component keep its own.
onExpandedChange(expanded: boolean) => void—
textStyleStyleProp<TextStyle>—Style for the text. Set `lineHeight` here if you change the font size.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One text view and one shared value. The box's height animates, so content below it moves for the length of the spring; nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 142 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The text opens and folds at once.
Screen readers
The whole text is always read, folded or not. The toggle is a button with an expanded state.
Touch target
The toggle is at least 44 pt tall.

Source files

components/kinetik/read-more.tsx is in the Code tab of the preview above.