Annotation Type 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
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static String DEFAULT
      Sets the viewport at the width of the device.
      static String DEVICE_DIMENSIONS
      Sets the viewport at the width and height of the device.
      static String DEVICE_HEIGHT
      Sets the viewport to the height of the device rather than the rendered space.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      Gets the viewport tag content.
    • Field Detail

      • 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.

      • DEVICE_HEIGHT

        static final String DEVICE_HEIGHT
        Sets the viewport to the height of the device rather than the rendered space.
      • 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.
    • Element Detail

      • value

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