<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj" -->

---
title: How to change line height in SwiftUI | daily.dev
description: iOS 26 introduces a new lineHeight(_:) modifier for SwiftUI Text, offering seven options to control spacing between lines: .variable (font-metric based...
canonical: https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to change line height in SwiftUI | daily.dev
og:description: iOS 26 introduces a new lineHeight(_:) modifier for SwiftUI Text, offering seven options to control spacing between lines: .variable (font-metric based...
og:url: https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj
og:image: https://api.daily.dev/og/posts/CiwisNLPj.png
og:image:alt: How to change line height in SwiftUI
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to change line height in SwiftUI

**[Sarunw](https://daily.dev/sources/sarunw)** · [@sarunw](https://daily.dev/sarunw) · 7 min read · 0 upvotes · 0 comments

## Summary

iOS 26 introduces a new lineHeight(_:) modifier for SwiftUI Text, offering seven options to control spacing between lines: .variable (font-metric based default), .exact(points:), .multiple(factor:), presets .tight/.normal/.loose (factors 1.0/1.2/1.5), and .leading(increase:). The piece explains how each option computes spacing relative to font point size versus actual font metrics, shows that only .variable responds to actual ascent/descent, and walks through visual examples including overlapping lines, Dynamic Type behavior, and how a bigger word in a line affects baseline spacing. It also notes an iOS 26.5 bug where an undersized line height causes the last line of text to be clipped, fixed in iOS 27, and clarifies that extra space is always added below a line, never above.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://sarunw.com/posts/swiftui-line-height>

## Questions this post answers

### What does the new lineHeight modifier in SwiftUI do on iOS 26?

iOS 26 adds a lineHeight(_:) modifier to SwiftUI Text that controls the distance between baselines, taking an AttributedString.LineHeight value. It offers seven options: .variable (font-metric based, the default), .exact(points:), .multiple(factor:), presets .tight/.normal/.loose (factors 1.0, 1.2, 1.5), and .leading(increase:). Except for .variable, all options are based on the font's point size rather than its actual rendered height.

_Developers adopting new SwiftUI text APIs can track release details like this one on daily.dev._

### Why is the last line of text cut off when using lineHeight exact in SwiftUI on iOS 26?

On iOS 26.5, when the line height set via .exact(points:) is smaller than the font needs, SwiftUI clips the part of the last line that doesn't fit inside the text's frame, causing visible cutoff. This is fixed on iOS 27, where the whole line is drawn even if it overflows. Until then, keep the line height at least as large as the font size to avoid clipping.

_Developers hitting SwiftUI text clipping bugs can check version-specific gotchas like this on daily.dev._

### What is the difference between SwiftUI's lineHeight .exact and .multiple options?

.exact(points:) sets a fixed line height in points regardless of font size, so it won't grow with Dynamic Type and can cause overlapping lines if set smaller than the font needs. .multiple(factor:) instead sets line height as a multiple of font size (factor × point size), similar to CSS's unitless line-height, so spacing scales automatically as the font size grows with Dynamic Type.

_Developers choosing between fixed and scalable line spacing in SwiftUI can compare approaches via daily.dev._

---

Tags: [#ios](https://daily.dev/tags/ios), [#swift](https://daily.dev/tags/swift), [#swiftui](https://daily.dev/tags/swiftui)

[View this post on daily.dev](https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to change line height in SwiftUI","url":"https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj"},"datePublished":"2026-10-02T18:06:24.021Z","dateModified":"2026-10-03T15:00:18.425Z","description":"iOS 26 introduces a new lineHeight(_:) modifier for SwiftUI Text, offering seven options to control spacing between lines: .variable (font-metric based...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/22b76239a6bfebe3c68f706127ceeafa?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/22b76239a6bfebe3c68f706127ceeafa?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sarunw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Sarun Wongpatcharapakorn","url":"https://daily.dev/sarunw","image":"https://avatars.githubusercontent.com/u/795368?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":20}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swift,swiftui","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sarunw","item":"https://daily.dev/sources/sarunw"},{"@type":"ListItem","position":3,"name":"How to change line height in SwiftUI"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-change-line-height-in-swiftui-ciwisnlpj#faq","mainEntity":[{"@type":"Question","name":"What does the new lineHeight modifier in SwiftUI do on iOS 26?","acceptedAnswer":{"@type":"Answer","text":"iOS 26 adds a lineHeight(_:) modifier to SwiftUI Text that controls the distance between baselines, taking an AttributedString.LineHeight value. It offers seven options: .variable (font-metric based, the default), .exact(points:), .multiple(factor:), presets .tight/.normal/.loose (factors 1.0, 1.2, 1.5), and .leading(increase:). Except for .variable, all options are based on the font's point size rather than its actual rendered height. Developers adopting new SwiftUI text APIs can track release details like this one on daily.dev."}},{"@type":"Question","name":"Why is the last line of text cut off when using lineHeight exact in SwiftUI on iOS 26?","acceptedAnswer":{"@type":"Answer","text":"On iOS 26.5, when the line height set via .exact(points:) is smaller than the font needs, SwiftUI clips the part of the last line that doesn't fit inside the text's frame, causing visible cutoff. This is fixed on iOS 27, where the whole line is drawn even if it overflows. Until then, keep the line height at least as large as the font size to avoid clipping. Developers hitting SwiftUI text clipping bugs can check version-specific gotchas like this on daily.dev."}},{"@type":"Question","name":"What is the difference between SwiftUI's lineHeight .exact and .multiple options?","acceptedAnswer":{"@type":"Answer","text":".exact(points:) sets a fixed line height in points regardless of font size, so it won't grow with Dynamic Type and can cause overlapping lines if set smaller than the font needs. .multiple(factor:) instead sets line height as a multiple of font size (factor × point size), similar to CSS's unitless line-height, so spacing scales automatically as the font size grows with Dynamic Type. Developers choosing between fixed and scalable line spacing in SwiftUI can compare approaches via daily.dev."}}]}
```

