---
title: Inline text (span)
description: Spans are inline-elements, used to define parts of text content.
version: 11.17.0
generatedAt: 2026-11-05T09:55:47.076Z
checksum: 90fbafe77a448e4dd25fbb92ffa56e6ed9db77666050dfbc1e77abd9dc3f25f7
---

# Inline text (span)

## Import

```tsx
import { Span } from '@dnb/eufemia/elements'
```

## Description

Spans are inline elements used to define parts of text content.

Span does not define any default styling. If no properties are set, it will just be a regular inline `<span>` element.

## Relevant links

- [Source code](https://github.com/dnbexperience/eufemia/tree/main/packages/dnb-eufemia/src/elements/span)
- [Docs code](https://github.com/dnbexperience/eufemia/tree/main/packages/dnb-design-system-portal/src/docs/web/layout-and-typography/elements/span)

### Typography CSS classes

Both Span and the [Paragraph](/web/layout-and-typography/elements/paragraph/) component have the same typography properties that use the [typography helper classes](/web/layout-and-typography/typography/css-reference/).


## Demos

For more detailed examples of every property, see the [Paragraph demos](/web/layout-and-typography/elements/paragraph/#demos).

### Basics


```tsx
<P>
      Here is a paragraph with a <Span size="x-small">x-small</Span> word
      and some <Span weight="medium">medium weight text</Span> in it.
    </P>
<H4>
      Heading 4 with <Span size="x-large">x-large</Span> word
    </H4>
<Anchor href="/">
      Anchor with <Span weight="medium">medium weight</Span> words
    </Anchor>
```


### Span modifiers


```tsx
render(<div>
        <Span>Default span</Span>
        <br />
        <Span weight="medium">Medium weight span</Span>
        <br />
        <Span size="basis">Basis size span</Span>
        <br />
        <Span weight="medium" size="x-small">
          X-small span with medium weight
        </Span>
      </div>)
```



  
```tsx
<SpanWrap />
<SpanWrap size="xx-large" />
<SpanWrap size="x-large" />
<SpanWrap size="large" />
<SpanWrap size="medium" />
<SpanWrap size="basis" />
<SpanWrap size="small" />
<SpanWrap size="x-small" />
```

<!-- eufemia-properties-usage:start -->
Some properties provide flexibility for specific integrations. Follow the component's usage guidance. Customizations beyond the documented patterns need a use case approved by DNB UX. [Read about intended use and customization](/web/styling-and-themes/configuration/component-properties/#intended-use-and-customization).
<!-- eufemia-properties-usage:end -->

## Properties


```json
{
  "props": {
    "element": {
      "doc": "Defines the Element Type, like `p`.",
      "type": [
        "HTMLElement",
        "string"
      ],
      "status": "optional"
    },
    "size": {
      "doc": "Sets the font size, also sets the line-height if `lineHeight` property is not set.",
      "type": [
        "\"x-small\"",
        "\"small\"",
        "\"basis\"",
        "\"medium\"",
        "\"large\"",
        "\"x-large\"",
        "\"xx-large\""
      ],
      "status": "optional"
    },
    "lineHeight": {
      "doc": "Sets the line height. Defaults to the size, or the Display line height when family is display.",
      "type": [
        "\"x-small\"",
        "\"small\"",
        "\"basis\"",
        "\"medium\"",
        "\"large\"",
        "\"x-large\"",
        "\"xx-large\""
      ],
      "status": "optional"
    },
    "align": {
      "doc": "Sets the text alignment.",
      "type": [
        "\"center\"",
        "\"left\"",
        "\"right\""
      ],
      "status": "optional"
    },
    "family": {
      "doc": "Sets the font family. Display is experimental. [Contact the Eufemia team](/design-system/contact) before use. Use it only for short, expressive headlines. Display has one upright weight.",
      "type": [
        "\"basis\"",
        "\"default\"",
        "\"heading\"",
        "\"monospace\"",
        "\"display\""
      ],
      "status": "optional"
    },
    "weight": {
      "doc": "Sets the font weight.",
      "type": [
        "\"light\"",
        "\"regular\"",
        "\"medium\"",
        "\"bold\""
      ],
      "status": "optional"
    },
    "decoration": {
      "doc": "Sets the font decoration.",
      "type": "\"underline\"",
      "status": "optional"
    },
    "slant": {
      "doc": "Sets the font style.",
      "type": "\"italic\"",
      "status": "optional"
    },
    "proseMaxWidth": {
      "doc": "Sets the maximum width based on character count for all Typography children. This will limit the text width to approximately the specified number of characters. Use `true` for a default value of 60ch.",
      "type": [
        "number",
        "boolean"
      ],
      "status": "optional"
    },
    "[Space](/web/layout-and-typography/layout/space/properties)": {
      "doc": "Spacing properties like `top` or `bottom` are supported.",
      "type": [
        "string",
        "object"
      ],
      "status": "optional"
    }
  },
  "usageGuidance": "Some properties provide flexibility for specific integrations. Follow the component's usage guidance. Customizations beyond the documented patterns need a use case approved by DNB UX. [Read about intended use and customization](/web/styling-and-themes/configuration/component-properties/#intended-use-and-customization)."
}
```
