Generic selectors

Exact matches only

Search in title

Search in content

Post Type Selectors

Input Mask

An Input Mask, in UX, guides users by providing a predefined format or structure.

input-mask
  • Overview
  • Specs
  • Guidelines

Component

An input mask, in UX, refers to a design element that guides users in entering data by providing a predefined format or structure for input. It serves to improve data accuracy and consistency by visually representing the required format for input.

By enforcing a specific format, Input Masks enhance usability and reduce errors, particularly for complex or unfamiliar data types.

They contribute to a smoother user experience by providing clear guidance and feedback during data entry tasks this component can be used for.

Input Mask Anatomy

A: Hyphen Variation

B: Slash Variation

C: None Variation

1: Label

2: Adornment

3: Placeholder/Input

4: Divider

Input Mask applied in an article form

Used for:

Credit cards

In cases where it is necessary to insert a credit card, for example when renewing a subscription, an Input Mask would be the component used;

Phone numbers

In cases where it is necessary to insert a phone number, for example when creating a client, an Input Mask would be the component used;

Postal code

In cases where it is necessary to insert a postal code, for example when creating a client, an Input Mask would be the component used;

IBAN code

In cases where it is necessary to insert an IBAN code, for example when creating an employee, an input mask would be the component used.

Don’t use for:

Flexibility

Input Masks may restrict user input, making it difficult for users to enter data that deviates from the predefined format;

Complex data

For data types that vary widely in format or require dynamic input, such as free-form text or user-generated content, Input Masks may be too rigid and impractical;

Task complexity

For simple data input tasks that do not require strict formatting or validation, Input Masks may introduce unnecessary complexity.

InputMask_replace_ArticleName
Input Mask replacing common text field

Demo

Access the Figma file and inspect the element using Dev Mode.

Input Mask at Figma

Last Update

Before
Old version of the Input Mask
Current
Current version of the Input Mask
  • Updated dividers’ color;
  • Updated large text box size;

Related

Label

A Label serves as a crucial element for enhancing the clarity and usability of a digital interface …

States

InputMask
Input Mask
Enabled
.enabled {
  label: var(--grey-7);
  input-mask-border: var(--grey-5);
  input-mask-background: var(--grey-1);
  placeholder: var(--grey-6);
  divider: var(--grey-7);
}
Hover
.hover {
  label: var(--grey-7);
  input-mask-border: var(--grey-6);
  input-mask-background: var(--grey-1);
  placeholder: var(--grey-6);
  divider: var(--grey-7);
}
Focus
.focus {
  label: var(--grey-7);
  input-mask-border: var(--theme-100);
  input-mask-background: var(--grey-1);
  insert: var(--grey-8);
  divider: var(--grey-7);
}
Read-only
Input Mask Read-only
.readOnly {
  label: var(--grey-7);
  input-mask-border: var(--grey-1);
  input-mask-background: var(--grey-3);
  placeholder: var(--grey-8);
  divider: var(--grey-7);
}
Disabled
Input Mask Disabled state
.disabled {
  label: var(--grey-7);
  input-mask-border: var(--grey-4);
  input-mask-background: var(--grey-2);
  placeholder: var(--grey-6);
  divider: var(--grey-7);
}
Error
.error {
  label: var(--grey-7);
  input-mask-border: var(--error-100);
  input-mask-background: var(--grey-1);
  placeholder: var(--grey-8);
  divider: var(--grey-7);
  icon: var(--error-100);
}

Size

Small
.small {
  label: var(--label-small);
  input-height: 28px;
  input-border: var(--x-small-radius);
  input-gap: 4px;
  input-padding: var(0, --spacing-8);
  icon: 16px;
  placeholder: var(--label-small);
}
Regular
.regular {
  label: var(--label-regular);
  input-height: 36px;
  input-border: var(--x-small-radius);
  input-gap: 8px;
  input-padding: var(0, --spacing-8);
  icon: 20px;
  placeholder: var(--label-regular);
}
Large
.large {
  label: var(--label-large);
  input-height: 40px;
  input-border: var(--x-small-radius);
  input-gap: 8px;
  input-padding: var(0, --spacing-8);
  icon: 24px;
  placeholder: var(--label-large);
}

Useful links

guidelines figma accent icon

Consult our Figma file to access our assets and inspect them in dev mode.

polygon-framework

This component is or will be provided by the Polygon framework. See its documentation to learn more.

This element is in line with the guidelines of the CDS (Cegid Design System). Find out more.

Behavior

Position

Input-type components must always be placed on grey-1 backgrounds (white) for optimal usability.

Avoid using them on grey-3 backgrounds (grey), as this can compromise the visibility of disabled and read-only states.

If placement on grey-3 backgrounds is necessary, ensure that disabled or read-only states are not utilized in these scenarios.

Text-field hover grey-3 background

Avoid placing input-type components on grey-3 backgrounds to maintain optimal visibility and accessibility.

Text field hover grey-1

Input-type components should be placed over grey-1 backgrounds for optimal visibility and usability.

Validation

A method for validating the inserted values is real-time validation. As with the Numeric component, once the Input Mask exits the Focus state, a validation is carried out to verify that all sections have been correctly filled in. If it is not the case, the Error state will be triggered.

Validation in Input Mask
Validation error in an Input Mask

Dos & Dont’s

If necessary, use different validations for each section;

You can use different types of divisions in the same input;


Case Studies

Release v1.2

Compose Design v1.2 introduces key updates to enhance clarity, consistency, and usability across the system, ensuring a more structured and …

Driving to a new destination without GPS?

Having help systems/guides that explain the actions within the product can help demystify doubts and increase form adoption …

Datagrids Demystified: A Deep Dive into Functionalities

Explore key datagrid functionalities—filters, column grouping, and customization options—and discover how to enhance data management workflows …

Outline