DocsComponentsTemplatesThemesGitHub

Text

Paragraph/inline text with type-ramp size and tone (secondary, accent, danger, success).

Code

import * as React from 'react';
import { Stack, Text } from '@fruit-labs/design';

export default function Demo() {
  return (
    <Stack gap={1}>
      <Text>Default subhead text.</Text>
      <Text tone="secondary" size="footnote">
        Secondary footnote.
      </Text>
      <Text tone="danger" size="footnote">
        Danger text.
      </Text>
    </Stack>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { Text } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/text.json

Guidelines

  • Never color text with fruit or chart colors; use tones.

Props

PropTypeRequired
size'body' | 'callout' | 'subhead' | 'footnote' | 'caption-1' | 'caption-2' | 'headline'No
tone'default' | 'secondary' | 'accent' | 'danger' | 'success'No
weightnumberNo
askeyof React.JSX.IntrinsicElementsNo
classNamestringNo
styleReact.CSSPropertiesNo
childrenReact.ReactNodeNo

Edit this example on GitHub