Annotation Interface Viewport


@Target(TYPE) @Retention(RUNTIME) @Inherited @Documented public @interface Viewport
Defines a viewport tag that will be added to the HTML of the host page of a UI class. If no viewport tag has been defined, a default of width=device-width, initial-scale=1.0 is used.
Since:
1.0
Author:
Vaadin Ltd
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Gets the viewport tag content.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Sets the viewport at the width of the device.
    static final String
    Sets the viewport at the width and height of the device.
    static final String
    Sets the viewport to the height of the device rather than the rendered space.
  • Field Details

    • DEFAULT

      static final String DEFAULT
      Sets the viewport at the width of the device. It makes the page match the screen’s width in device-independent pixels, allowing its content to reflow to match different screen sizes.

      Recommended for a Responsive Web Design.

      See Also:
    • DEVICE_HEIGHT

      static final String DEVICE_HEIGHT
      Sets the viewport to the height of the device rather than the rendered space.
      See Also:
    • DEVICE_DIMENSIONS

      static final String DEVICE_DIMENSIONS
      Sets the viewport at the width and height of the device. The device-width and device-height properties are translated to 100vw and 100vh respectively.
      See Also:
  • Element Details

    • value

      String value
      Gets the viewport tag content.
      Returns:
      the viewport tag content