Marigold
Marigold

Application

MarigoldProvider
RouterProvider

Layout

Aside
Aspect
Breakout
Center
Columns
Container
Grid
Inline
Inset
Scrollable
Split
Stack
Tiles

Actions

ActionBaralpha
Button
Link
LinkButton
ToggleButtonalpha
ToggleButtonGroupalpha

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
FileField
Form
Multiselectdeprecated
NumberField
Radio
SearchField
Select
Slider
Switch
TagFieldbeta
TextArea
TextField
TimeField

Collection

SelectList
Tableupdated
Tag

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Tabs
TopNavigationbeta

Overlay

ContextualHelp
Dialog
Drawer
Menu
Toastbeta
Tooltip

Content

Badge
Card
Divider
EmptyStatebeta
Headline
Icon
List
Loader
SectionMessage
SVG
Text

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useListData
useResponsiveValue
useTheme
VisuallyHidden
Components

Text

Component for displaying text paragraphs

The <Text> component is a fundamental part of Marigold's content components. It is designed to display text in a structured and visually appealing way, making it easy to read and understand.

Anatomy

The <Text> consists of a single element that can be rendered as a <div>, <p>, or <span>. It supports various text properties such as alignment, size, weight, and color.

Appearance

The appearance of a component can be customized using the variant and size props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.

RUI is our transformative approach to creating an intuitive and user-friendly software experience for everyone.
PropertyTypeDescription
variantdefault | mutedThe available variants of this component.
sizedefault | xs | sm | base | lg | xl | 2xl | 3xl | 4xl | 5xl | 6xl | 7xl | 8xl | 9xlThe available sizes of this component.

Usage

The <Text> component is intended for all non-heading text, such as main content, detailed descriptions, and text within other components. Use it whenever you need to display standard paragraph text.

Do
Use text component for paragraphs

Use <Text> component for paragraphs or other body text.

Don't
Dont use text component for headlines or titles

Don't use the <Text> component for headings or titles. Use the <Heading> component instead.

Rendering as other HTML elements

The <Text> component can be rendered as different HTML elements by using the as prop. This allows you to change the underlying element without losing the styling and behavior of the <Text> component.

  • Use a <p> tag for paragraphs of text.
  • Use a <span> for inline text inside a sentence or heading.
  • Use a <div> for block-level layout elements without paragraph semantics.

Customizing text

Sometimes you want to highlight text or make it stand out from the rest of the content. The <Text> component supports a color prop that allows you to change the text color. Also you can set the weight and size of the text to make it more prominent.

Ticket #47213 —
Payment not processed
import { Text } from '@marigold/components';export default () => (  <>    <Text weight="bold">Ticket #47213 —</Text>    <Text color="destructive"> Payment not processed</Text>  </>);

Props

Did you know? You can explore, test, and customize props live in Marigold's storybook. Watch the effects they have in real-time!
View Text stories

Text

Prop

Type

Alternative Component

  • Headline: Use the <Headline> component for titles and headings. It provides a more semantic structure for text that serves as a title or heading, ensuring better accessibility and SEO.
Last update: 3 days ago

SVG

Wrapper for SVG elements

DateFormat

Helper component for formatting date values based on the current language and locale-specific conventions.

On this page

AnatomyAppearanceUsageRendering as other HTML elementsCustomizing textPropsTextAlternative Component