Skip to content

feat(GlFormInput): add responsive size support

What does this MR do?

Related to #1794 (closed)

Updates the GlFormInput size prop to accept an object. This allows for responsive inputs that are different sizes on different screens. The most common use case is to have the input full width on mobile and to have a max-width on desktop.

When providing an object to the size prop all breakpoints are min-width and you can specify a default key to set the size when no breakpoint is active. If the default key is not provided it defaults to max-width: 100%; when no breakpoint is active. Examples:

With default key

{
  default: 'md',
  md: 'lg',
  lg: 'xl'
}

Without default key

{
  md: 'lg',
  lg: 'xl'
}

Screen_Recording_2022-05-04_at_10.25.08_AM

Does this MR meet the acceptance criteria?

Conformity

Edited by Peter Hegman

Merge request reports

Loading