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.jsonGuidelines
- Never color text with fruit or chart colors; use tones.
Props
| Prop | Type | Required |
|---|---|---|
size | 'body' | 'callout' | 'subhead' | 'footnote' | 'caption-1' | 'caption-2' | 'headline' | No |
tone | 'default' | 'secondary' | 'accent' | 'danger' | 'success' | No |
weight | number | No |
as | keyof React.JSX.IntrinsicElements | No |
className | string | No |
style | React.CSSProperties | No |
children | React.ReactNode | No |