# Text Display text with semantic elements, font sizes, colours, and font weights. ```jsx featured Make yourself clear ``` ```css preview .text { --text-color: var(--color, var(--text)); color: rgb(var(--text-color)); &[data-size="xl"] { font-size: 20px; } &[data-weight="bold"] { font-weight: 700; } } ``` [View Source](https://github.com/LocusInc/locus-ui/tree/main/packages/locus-ui/src/components/text) ## Anatomy ```jsx code no-header ``` ## Examples ### Semantic elements `as` defaults to `p`. It accepts `p`, `span`, `div`, `h1` through `h6`, `strong`, `em`, `small`, `s`, `b`, `i`, `u`, `mark`, `sub`, and `sup`. Native attributes, events, and refs follow the selected element. Choose the element for its meaning. Use `size` and `weight` to control its appearance; when omitted, font size and weight follow your existing styles and browser defaults. ```jsx Section heading A paragraph with{" "} important text . ``` ### Sizes `size` accepts `xs` (12px), `sm` (14px), `md` (16px), `lg` (18px), and `xl` (20px), or a custom CSS font size such as `2rem` or `clamp(1rem, 3vw, 2rem)`. ```jsx Extra small Small Medium Large Extra large Custom size ``` ### Colours Use the existing `color` prop with a theme colour, hex value, RGB function, or raw RGB channels. See the [colour property](/docs/properties/color) for the full palette. ```jsx Primary colour Success colour Custom hex colour Custom RGB colour ``` ### Font weights `weight` accepts `thin` (100), `extralight` (200), `light` (300), `normal` (400), `medium` (500), `semibold` (600), `bold` (700), `extrabold` (800), and `black` (900). You can also pass these numbers directly. Available weights depend on the font you load. ```jsx Light Normal Medium Semibold Bold Numeric weight: 900 ``` ### Spacing and disabled appearance `Text` also supports the shared margin and padding props. `disabled` applies a muted text colour; it is a visual treatment and does not disable interaction. ```jsx Currently unavailable ```