static/app/components/core/info/infoText.mdx
import {InfoText} from '@sentry/scraps/info'; import {Flex} from '@sentry/scraps/layout';
import * as Storybook from 'sentry/stories';
export const documentation = import('!!type-loader!@sentry/scraps/info/infoText');
InfoText renders text with a dotted underline that reveals a tooltip on hover or focus. It's keyboard accessible out of the box and provides a consistent pattern for inline explanations.
<Storybook.Demo> <InfoText title="Time to First Byte measures the time from the request start until the first byte of the response is received."> TTFB </InfoText> </Storybook.Demo>
<InfoText title="Time to First Byte measures the time...">TTFB</InfoText>
InfoText extends Text, so you can use props like size and variant to style the text.
<Storybook.Demo> <Flex gap="lg" align="center"> <InfoText title="Small muted text" size="sm" variant="muted"> Hint text </InfoText> <InfoText title="Bold text" bold> Important term </InfoText> </Flex> </Storybook.Demo>
<InfoText title="Small muted text" size="sm" variant="muted">
Hint text
</InfoText>
<InfoText title="Bold text" bold>
Important term
</InfoText>
Use InfoText to:
Prefer InfoText over wrapping text with a raw Tooltip component.