• Docs
  • Blog
    • 0.24.0

    • Switch to dark mode
    Get Started
    Components
    Styling
    Theming

    Concepts

    OverviewCompositionTesting

    Layout

    Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrap

    Components

    AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

    Utilities

    Feature FlagsForLocal StoragePortalShowsplitPropsTheme

    Text

    A component for rendering text.

    • npm
    • source
    import { Text } from '@cerberus/react'

    Usage

    Hello, world!

    This is normal text

    This is small text

    Raw HTML

    To render raw HTML, you can utilize the React dangerouslySetInnerHTML combined with the whiteSpace property.

    This is a raw paragraph with a bold word and a
    line break.

    API

    export type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
    export type TextElements = 'p' | 'strong' | 'em' | 'small' | 'span'
    export interface TextProps extends BoxProps {
    as?: TextElements | Headings
    }
    define function Text(props: TextProps): ReactNode

    Props

    The Text component accepts the following props along with the props from the Box component.

    NameDefaultDescription
    asThe text-based element to render the component as.

    On this page

    • Edit this page on Github
    Cerberus Design System | Docs