SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

placeholder

Styles an input or textarea's ::placeholder text.

tsx
import { placeholder } from "@sdxc/u/state";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.placeholder(u.fg("neutral.muted"))css({ "&::placeholder": { color: "..." } })

Examples

Basic example

Wrap utilities in placeholder() to style a field's placeholder text. Type in the field to see your text replace it:

tsx
<input
	type="text"
	placeholder="Search the docs…"
	mix={[
		border("neutral.border"),
		placeholder([fg("brand.muted"), raw({ fontStyle: "italic" })]),
		...,
	]}
/>

Responsive design

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

typescript
u.at("md", u.placeholder(u.fg("neutral.muted")))

Signature

typescript
u.placeholder(input: UtilityInput<Node>)
@sdxc/u

Can’t find it? Contact us