Marigold
v18.0.0-beta.4
Marigold
v18.0.0-beta.4

Application

MarigoldProvider
RouterProvider

Layout

AppShellbeta
Aside
Aspect
Center
Columns
Container
Grid
Inline
Inset
Pagebeta
Panelbeta
Scrollable
Split
Stack
Tiles

Actions

Buttonupdated
ButtonGroupbeta
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
DateRangePickerbeta
FileField
Form
NumberField
Radio
RangeCalendaralpha
SearchField
SegmentedControlbeta
Select
SelectListupdated
Slider
Switchupdated
TagFieldbeta
TextArea
TextField
TimeField

Collection

Cardupdated
Table
Tag
ActionBaralpha

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Tabs
TopNavigationbeta

Overlay

ActionMenualpha
ContextualHelp
Dialog
Drawer
Menuupdated
Toastbeta
Tooltip

Content

Badge
Descriptionalpha
Divider
EmptyStatebeta
ErrorStatebeta
Headline
Keyboardbeta
List
Loader
SectionMessage
SVG
Text
TextValuealpha
Titlealpha

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useLandmark
useListData
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.

The Text component supports variants to control visual emphasis.

VariantDescriptionWhen to use
defaultStandard text inheriting the current color. This is the default variant.Body text, descriptions, and general content.
mutedDimmed text with reduced visual emphasis.Secondary information, captions, or supporting details that shouldn't compete with primary content.

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

Accessibility props (4)

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: 4 months ago

SVG

Wrapper for SVG elements

TextValue

Inline label primitive for selection items.

On this page

AnatomyAppearanceUsageRendering as other HTML elementsCustomizing textPropsTextAlternative Component