ui-unit
Functions
  • Constraints
  • Density
  • DpOffset
  • DpSize
  • IntOffset
  • IntRect
  • IntSize
  • TextUnit
  • Velocity
  • coerceAtLeast
  • coerceAtMost
  • coerceIn
  • constrain
  • constrainHeight
  • constrainWidth
  • isSatisfiedBy
  • lerp
  • max
  • min
  • minus
  • offset
  • plus
  • round
  • roundToIntRect
  • roundToIntSize
  • takeOrElse
  • times
  • toIntRect
  • toIntSize
  • toOffset
  • toRect
  • toSize
Interfaces
  • Density
  • FontScaling
Objects
  • ComposeUiUnitFlags
Classes
  • Constraints
  • Dp
  • DpOffset
  • DpRect
  • DpSize
  • ExperimentalUnitApi
  • IntOffset
  • IntRect
  • IntSize
  • LayoutDirection
  • LayoutDirection.Ltr
  • LayoutDirection.Rtl
  • TextUnit
  • TextUnitType
  • Velocity
Properties
  • center
  • dp
  • em
  • height
  • isFinite
  • isSpecified
  • isUnspecified
  • size
  • sp
  • width
Jetpack Compose / Compose UI / ui-unit / Properties / width
Property

width

View Markdown Open in ChatGPT Open in Claude

A width of this Bounds in Dp.

CodeRabbit

CodeRabbit

AI writes the code. CodeRabbit catches the slop.

AdTry CodeRabbit for Free
Robomori

Robomori

Run Android emulators and devices outside Android Studio.

AdTry Robomori
Source set: Common
public inline val DpRect.width: Dp

A width of this Bounds in Dp.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free →

Content updated: 2026-11-04

sp ← Previous

On this page

Reach Android developers Put your product in front of engineers building Android and KMP apps. Sponsor Composables
9:41

AGENTS.md vs skills Inbox

Alex Styl 9:30 AMto me

AGENTS.md contains your preferences for how you want your agent to behave.

Think of it as the prompt your agent reads every time it starts.

Mine tells the agent to always read the project's README and CONTRIBUTING files, so it has the context of the repo I'm working on.

Skills on the other hand are repeatable flows you can reuse over and over again.

Architecture is a great candidate for a skill. My compose-architecture skill describes how my app's screens should be built.

One Android lesson, every Wednesday

Building Android apps?

What Alex learned building Android apps for 14 years, so you don't have to. Reads in under a minute.

Join 3,500+ Android developers. Unsubscribe any time.

You're subscribed

The next lesson lands in on Wednesday.