Content
The content of the text should be written according to the Grafana writing style guide.
Formatting
The following is the default behavior and as such, it will be applied according to its type.
Anatomy
The Text component mainly comprises itself. On occasion, the Text component can have another Text or TextLink component as a child.
Example: Text with Link
If you need more help of how to write in Grafana you can go to our Writer's Toolkit.Behaviour
The Text component can be truncated. However, the default rendered element for the Text component (when no value is set in the element prop) is <span>. This is an inline container that must have a parent, which may or may not be another Text component. Therefore, truncation must be applied to the parent element.
Example: Truncated Text with Tooltip
And Forrest Gump said: Life is like a box of chocolates. You never know what you're gonna get.
Example: Container Truncation with Tooltip
Accessibility
- There should be only one h1 heading per page.
- Headings should be organized according to their significance: h1 has the rank 1 while h6 heading has the rank 6. For instance, h1 can be used for the page heading, h2 for the titles of sections, and h3 for subsections.
- The ranking of headings should be continuous. An h2 should not be immediately followed by an h5, but an h2 can follow an h5 if this is closing the previous section. Skipping heading ranks should be avoided as much as possible because it can be confusing.
Playground
Interactive component examples would appear here in the actual Storybook environment.