Skip to main content

Gradient

UI Design

What is a Gradient

A gradient is a smooth transition between two or more colors. In UI design, gradients add depth, mood and brand character to backgrounds, buttons, cards and illustrations.

Types of Gradients

  • Linear: Colors change along a straight line
  • Radial: Colors spread out from a center point
  • Conic: Colors rotate around a center point
  • Repeating: Any of the above repeated as a pattern

When to use Gradients

Use gradients for backgrounds, hero sections, illustrations and brand moments. Subtle gradients can also add depth to surfaces. Avoid strong gradients behind long text or on small controls, where they make text harder to read and states harder to see.

Gradients and contrast

Text on a gradient must have enough contrast against every part of the background, from the lightest to the darkest color. Gradients returned with styles such as glassmorphism and Apple's 2025 app icons, after flat design had removed them.

Frequently asked questions

What types of gradients are there?

The three main types are linear (colors change along a straight line), radial (colors spread out from a center point) and conic (colors rotate around a center point). CSS also has repeating versions of each.

Can you put text on a gradient?

Yes, but check the contrast at the lightest and darkest parts of the gradient, not just the middle. Text must meet 4.5:1 against every part of the background it covers.

When should you use a gradient in UI?

Use gradients for backgrounds, illustrations, brand moments and subtle depth. Keep buttons and text areas simple, so the gradient does not hurt readability or hide which elements are clickable.