# min-width

> Applies the physical `min-width` property, for elements whose sizing is tied to the physical viewport axis.

```ts
import { minWidth } from "@sdxc/u/size";
```

Applies the physical `min-width` property, for elements whose sizing is
tied to the physical viewport axis. Prefer `u.minIs()`
(`min-inline-size`) for the logical default.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.minWidth("full")` | `css({ minWidth: "100%" })` |

## Examples

### Basic example

Use `minWidth(n)` to give an element a minimum width, like buttons that stay at least `minWidth(32)` wide however short their label:

```tsx
<div mix={[...]}>
	<button type="button" mix={[minWidth(32), ...]}>
		OK
	</button>
	<button type="button" mix={[minWidth(32), ...]}>
		Cancel
	</button>
	<button type="button" mix={[minWidth(32), ...]}>
		Save and continue
	</button>
</div>
```

### Truncating inside flex

A flex item will not shrink below its content by default, so text truncated inside it overflows instead; use `minWidth(0)` on the item to let it shrink:

```tsx
<div mix={[...]}>
	<div mix={[hstack({ gap: 3 }), is(72), ...]}>
		<div mix={[circle(), is(10), shrink(), ...]}>PDF</div>
		<div>
			<p mix={[truncate(), ...]}>
				quarterly-report-final-version-with-every-appendix.pdf
			</p>
		</div>
	</div>
	<div mix={[hstack({ gap: 3 }), is(72), ...]}>
		<div mix={[circle(), is(10), shrink(), ...]}>PDF</div>
		<div mix={[minWidth(0)]}>
			<p mix={[truncate(), ...]}>
				quarterly-report-final-version-with-every-appendix.pdf
			</p>
		</div>
	</div>
</div>
```

## Applying on a state

Wrap the call in a state utility to scope it to one selector.

```ts
u.hover(u.minWidth("full"))
```

## Responsive design

Wrap the call in a container query to scope it to one width.

```ts
u.at("md", u.minWidth("full"))
```

## Customizing your theme

### Customizing spacing

Every numeric step multiplies `--ui-spacing`, so redefining it rescales every spacing and sizing utility at once:

```css
:root {
	--ui-spacing: 0.25rem;
}
```

Every call that names the step now reads the new value:

```ts
minWidth(4)
```

## Signature

```ts
u.minWidth(value: SizeValue)
```
