UI component

On this page 7

A UI component is a reusable, self-contained building block of a user interface, such as a button, text field, checkbox, card or dialog, with a defined appearance, set of variants and states, and behavior. In UI design, components let teams assemble screens from tested parts instead of drawing every element from scratch.

A component exists in two linked forms: a design asset in a design tool and a coded implementation in a front-end framework. When both share the same name, properties and rules, designers and developers speak one language, which is the foundation of every design system.

Anatomy of a UI component

Every component has an anatomy: the named parts it is made of. A text field, for example, consists of a label, the input container, placeholder or value text, optional icons, helper text and an error message. Naming these parts makes specifications and discussions precise.

Components are configured through properties (props) rather than redrawn. A button might expose a variant, a size, an optional icon and a disabled flag. The visual values behind these properties come from design tokens, such as color, spacing and typography variables, so that a change to a token updates every component that uses it.

ElementDescriptionButton example
AnatomyNamed parts of the componentContainer, label, optional icon
VariantsAlternative visual formsPrimary, secondary, tertiary, destructive
SizesDefined dimensional stepsSmall, medium, large
StatesAppearance in each interaction conditionDefault, hover, focus, pressed, disabled
PropertiesConfigurable inputsLabel text, icon, loading flag
Design tokensShared style valuesColor, radius, spacing, type scale
Elements that define a UI component

Interaction states

A component is complete only when every interaction state is designed. Missing states are one of the most frequent causes of inconsistent interfaces, because developers must improvise them during implementation.

StateTriggerDesign requirement
DefaultNo interactionClear affordance that it is interactive
HoverPointer over the elementSubtle change; not available on touch
FocusKeyboard or programmatic focusVisible focus indicator with sufficient contrast
Pressed or activeClick or tap in progressImmediate visual feedback
DisabledAction unavailableRecognizably inactive, still readable
LoadingAction in progressPrevents duplicate actions
ErrorInvalid input or failed actionMessage plus non-color indicator
Standard interaction states and their purpose

The focus state deserves particular attention. Accessibility guidelines such as WCAG require that keyboard users can see where focus is, so removing the focus outline without a replacement is a serious defect.

Levels of UI components

Components range from simple to composite. The atomic design model describes this as a hierarchy in which small parts combine into larger ones, which helps teams decide where a new piece belongs.

LevelExamplesCharacteristics
Primitives (atoms)Button, icon, label, inputSmallest reusable units
Composite components (molecules)Search field with button, form field with labelSeveral primitives with one purpose
Patterns (organisms)Navigation bar, data table, card listLarger sections combining components
TemplatesPage layouts with placeholdersStructure without final content
Component levels from simple to composite

UI components in relation to other design artifacts

Components connect several artifacts of the design process. Wireframes describe where elements go, components define what each element is and how it behaves, and the design system governs the whole library.

ConceptScopeRelationship to components
UI componentOne reusable elementThe unit itself
Design systemComponents, tokens, guidelines and governanceContains and maintains the component library
WireframeLow-fidelity screen structureUses simplified placeholders for components
MockupHigh-fidelity static screenAssembled from finished components
PrototypeInteractive simulationShows component behavior and transitions
UI component compared with neighboring concepts

Designing robust components

A good component works with real, unpredictable content. Labels may be long, translated into languages that expand text by 30 percent or more, or set at larger user font sizes. Components should therefore use flexible layout rules such as auto layout and defined minimum and maximum widths.

  • Too many variants make a component hard to choose and maintain; a variant should exist only when it serves a distinct purpose.
  • Detaching instances in design files breaks the link to the main component, so later updates no longer apply.
  • Touch targets below about 44 by 44 points are difficult to tap on mobile devices.
  • Color as the only state indicator excludes users with color vision deficiencies.
  • Design and code drift occurs when the coded component changes without the design asset, or the reverse.

Mature teams document each component with usage guidelines: when to use it, when not to use it, accessibility behavior and content rules. Documentation turns a visual asset into a shared, reliable decision.

The short version

A UI component is like a standard building brick for apps and websites. A button, a search box or a pop-up window is designed once, carefully, and then reused wherever it is needed.

Because the same brick is used everywhere, the app looks and works consistently, and improving the brick once improves it on every screen. This saves time and makes the product easier to use.

Where it makes a difference

A company maintains three web applications in which designers had drawn buttons independently over several years. An audit finds more than twenty different button styles, several without a visible keyboard focus state.

The design team creates one button component with four variants, three sizes and seven defined states, built on shared color and spacing tokens. Developers implement a matching coded component, and both versions use identical property names.

Within a few releases, the old buttons are replaced. New screens are assembled faster, accessibility reviews stop flagging missing focus indicators, and a later brand color change is applied by updating a single token rather than editing every screen.