com.vaadin.flow.component.page.

Annotation Type Viewport


  • @Target(value=TYPE)
     @Retention(value=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 and 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 and Description
      String value

      Gets the viewport tag content.

    • Field Detail

      • DEFAULT

        public 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

        public static final String DEVICE_HEIGHT

        Sets the viewport to the height of the device rather than the rendered space.

      • DEVICE_DIMENSIONS

        public 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

        public abstract String value

        Gets the viewport tag content.

        Returns:

        the viewport tag content