Popover

Popovers are useful for conveying information when an user clicks an element.

Basic Example

Wrap the trigger element (such as an <i-button>) and provide a <template #body> inside an <i-popover> component to create a popover.

Optionally, you can provide a popover header and footer using slots.

<i-popover>
    <i-button>Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

Placement

Trigger popovers at the top, bottom, left or right of elements by using the placement property.

Each position also has a -start or -end variant that sets the popover to the start or end of the placement instead of centering it. The possible placements are:

  • top
  • top-start
  • top-end
  • bottom
  • bottom-start
  • bottom-end
  • left
  • left-start
  • left-end
  • right
  • right-start
  • right-end

<i-popover placement="top">
    <i-button>Top Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover placement="bottom">
    <i-button>Bottom Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover placement="left">
    <i-button>Left Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover placement="right">
    <i-button>Right Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

Trigger Type

You can use the trigger property to trigger the popover on hover or click. By default, popovers are triggered on hover, a design decision made to improve user experience.

<i-popover trigger="click">
    <i-button>Click Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover trigger="hover">
    <i-button>Hover Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover trigger="focus">
    <i-button type="submit">Focus Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover :trigger="['focus', 'hover']">
    <i-button>Multiple Events Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover trigger="manual" v-model="visible">
    <i-button @click="visible = !visible">Manual Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

Size Variants

You’re able to use the size property to control the size of your popovers, using one of the available sizes: sm, md, and lg. The default size is set to md.

<i-popover size="sm">
    <i-button>Small Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover size="md">
    <i-button>Medium Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover size="lg">
    <i-button>Large Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

Color Variants

You can choose a light or dark color for your popover using the color modifier.

<i-popover color="light">
    <i-button color="light">Light Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

<i-popover color="dark">
    <i-button color="dark">Dark Popover</i-button>
    <template #header>
        Popover Header
    </template>
    <template #body>
        This is the popover body. Useful information goes here.
    </template>
    <template #footer>
        Popover Footer
    </template>
</i-popover>

Configuration

Props

Use props to modify the component’s design and behavior.

  • Property
    color
    Type'light' | 'dark'
    Default'light'
    Description The color variant of the popover
  • Property
    disabled
    TypeBoolean
    Defaultfalse
    Description The disabled state of the popover
  • Property
    modelValue
    TypeBoolean
    Defaultfalse
    Description Used to manually control the visibility of the popover
  • Property
    name
    TypeString
    Defaultuid()
    Description The identifier of the popover
  • Property
    arrow
    TypeBoolean
    Defaulttrue
    Description Displays an arrow on the popover pointing to the trigger element
  • Property
    placement
    Type'top' | top-start | top-end | 'bottom' | bottom-start | bottom-end | 'left' | left-start | left-end | 'right' | right-start | right-end
    Defaultfalse
    Description The placement of the popover
  • Property
    trigger
    Type'hover' | 'focus' | 'click' | 'manual'
    Default'click'
    Description The events used to trigger the popover
  • Property
    offset
    TypeNumber
    Default6
    Description The offset of the popover relative to the trigger element
  • Property
    popperOptions
    TypeObject
    Default''
    Description Used to override the popper.js options used for creating the popover
  • Property
    size
    Type'sm' | 'md' | 'lg'
    Default'md'
    Description The size variant of the popover

Slots

Use slots to insert custom content into well-defined component locations.

  • Property
    default
    Description Slot for tooltip trigger
  • Property
    header
    Description Slot for tooltip header content
  • Property
    body
    Description Slot for tooltip body content
  • Property
    footer
    Description Slot for tooltip footer content

Events

Use events to react to something happening inside the component.

  • Property
    update:modelValue
    Description Event emitted for setting the modelValue

CSS Variables

Read more about configuring Inkline’s Design System variables to update the look and feel of the component.

  • Property
    ----background
    Valuecolor('white')
    Description The background of the popover component
  • Property
    ----border-top-color
    Valuecolor('light')
    Description The border top color of the popover component
  • Property
    ----border-right-color
    Valuecolor('light')
    Description The border right color of the popover component
  • Property
    ----border-bottom-color
    Valuecolor('light')
    Description The border bottom color of the popover component
  • Property
    ----border-left-color
    Valuecolor('light')
    Description The border left color of the popover component
  • Property
    ----border-color
    Valuevar(----border-top-color) var(----border-right-color) var(----border-bottom-color) var(----border-left-color)
    Description The border color of the popover component
  • Property
    ----border-style
    Valuevar(--border-style)
    Description The border style of the popover component
  • Property
    ----border-top-width
    Valuevar(--border-top-width)
    Description The border top width of the popover component
  • Property
    ----border-right-width
    Valuevar(--border-right-width)
    Description The border right width of the popover component
  • Property
    ----border-bottom-width
    Valuevar(--border-bottom-width)
    Description The border bottom width of the popover component
  • Property
    ----border-left-width
    Valuevar(--border-left-width)
    Description The border left width of the popover component
  • Property
    ----border-width
    Valuevar(----border-top-width) var(----border-right-width) var(----border-bottom-width) var(----border-left-width)
    Description The border width of the popover component
  • Property
    ----border-top-left-radius
    Valuevar(--border-top-left-radius)
    Description The border top left radius of the popover component
  • Property
    ----border-top-right-radius
    Valuevar(--border-top-right-radius)
    Description The border top right radius of the popover component
  • Property
    ----border-bottom-right-radius
    Valuevar(--border-bottom-right-radius)
    Description The border bottom right radius of the popover component
  • Property
    ----border-bottom-left-radius
    Valuevar(--border-bottom-left-radius)
    Description The border bottom left radius of the popover component
  • Property
    ----border-radius
    Valuevar(----border-top-left-radius) var(----border-top-right-radius) var(----border-bottom-right-radius) var(----border-bottom-left-radius)
    Description The border radius of the popover component
  • Property
    ----box-shadow-offset-x
    Valuevar(--box-shadow-offset-x)
    Description The box shadow horizontal offset of the popover component
  • Property
    ----box-shadow-offset-y
    Valuevar(--box-shadow-offset-y)
    Description The box shadow vertical offset of the popover component
  • Property
    ----box-shadow-blur-radius
    Valuevar(--box-shadow-blur-radius)
    Description The box shadow blur radius of the popover component
  • Property
    ----box-shadow-spread-radius
    Valuevar(--box-shadow-spread-radius)
    Description The box shadow spread radius of the popover component
  • Property
    ----box-shadow-color
    Valuevar(--box-shadow-color)
    Description The box shadow spread radius of the popover component
  • Property
    ----box-shadow
    Valuevar(----box-shadow-offset-x) var(----box-shadow-offset-y) var(----box-shadow-blur-radius) var(----box-shadow-spread-radius) var(----box-shadow-color)
    Description The box shadow of the popover component
  • Property
    ----color
    Valuecontrast-color($color-white)
    Description The color of the popover component item
  • Property
    ----font-size
    Valuefont-size()
    Description The font size of the popover component
  • Property
    ----font-weight
    Valuefont-weight('normal')
    Description The font weight of the popover component
  • Property
    ----line-height
    Valuevar(--line-height)
    Description The line height of the popover component
  • Property
    ----margin-top
    Valuecalc(var(--margin-top) / 2)
    Description The margin top of the popover component
  • Property
    ----margin-right
    Valuecalc(var(--margin-right) / 2)
    Description The margin right of the popover component
  • Property
    ----margin-bottom
    Valuecalc(var(--margin-bottom) / 2)
    Description The margin bottom of the popover component
  • Property
    ----margin-left
    Valuecalc(var(--margin-left) / 2)
    Description The margin left of the popover component
  • Property
    ----margin
    Valuevar(----margin-top) var(----margin-right) var(----margin-bottom) var(----margin-left)
    Description The margin of the popover component
  • Property
    ----padding-top
    Valuecalc(var(--padding-top) * 3 / 4)
    Description The padding top of the popover component
  • Property
    ----padding-right
    Valuevar(--padding-right)
    Description The padding right of the popover component
  • Property
    ----padding-bottom
    Valuecalc(var(--padding-bottom) * 3 / 4)
    Description The padding bottom of the popover component
  • Property
    ----padding-left
    Valuevar(--padding-left)
    Description The padding left of the popover component
  • Property
    ----padding
    Valuevar(----padding-top) var(----padding-right) var(----padding-bottom) var(----padding-left)
    Description The padding of the popover component
  • Property
    ----max-width
    Value90vw
    Description The maximum width of the popover component
  • Property
    ----width
    Value280px
    Description The width of the popover component
  • Property
    ----z-index
    Value2000
    Description The z-index of the popover component
  • Property
    ----header--background
    Valuecolor('gray-05')
    Description The background of the popover component header
  • Property
    ----header--border-color
    Valuevar(----border-color)
    Description The border color of the popover component header
  • Property
    ----header--border-style
    Valuevar(----border-style)
    Description The border style of the popover component header
  • Property
    ----header--border-top-width
    Valuevar(----border-top-width)
    Description The border top width of the popover component header
  • Property
    ----header--border-right-width
    Valuevar(----border-right-width)
    Description The border right width of the popover component header
  • Property
    ----header--border-bottom-width
    Valuevar(----border-bottom-width)
    Description The border bottom width of the popover component header
  • Property
    ----header--border-left-width
    Valuevar(----border-left-width)
    Description The border left width of the popover component header
  • Property
    ----header--border-width
    Valuevar(----header--border-top-width) var(----header--border-right-width) var(----header--border-bottom-width) var(----header--border-left-width)
    Description The border width of the popover component header
  • Property
    ----header--color
    Valuevar(----color)
    Description The color of the popover component header
  • Property
    ----header--padding-top
    Valuevar(----padding-top)
    Description The padding top of the popover component header
  • Property
    ----header--padding-right
    Valuevar(----padding-right)
    Description The padding right of the popover component header
  • Property
    ----header--padding-bottom
    Valuevar(----padding-bottom)
    Description The padding bottom of the popover component header
  • Property
    ----header--padding-left
    Valuevar(----padding-left)
    Description The padding left of the popover component header
  • Property
    ----header--padding
    Valuevar(----header--padding-top) var(----header--padding-right) var(----header--padding-bottom) var(----header--padding-left)
    Description The padding of the popover component header
  • Property
    ----body--background
    Valuevar(----background)
    Description The background of the popover component body
  • Property
    ----body--border-color
    Valuevar(----border-color)
    Description The border color of the popover component body
  • Property
    ----body--border-style
    Valuevar(----border-style)
    Description The border style of the popover component body
  • Property
    ----body--border-top-width
    Valuevar(----border-top-width)
    Description The border top width of the popover component body
  • Property
    ----body--border-right-width
    Valuevar(----border-right-width)
    Description The border right width of the popover component body
  • Property
    ----body--border-bottom-width
    Valuevar(----border-bottom-width)
    Description The border bottom width of the popover component body
  • Property
    ----body--border-left-width
    Valuevar(----border-left-width)
    Description The border left width of the popover component body
  • Property
    ----body--border-width
    Valuevar(----body--border-top-width) var(----body--border-right-width) var(----body--border-bottom-width) var(----body--border-left-width)
    Description The border width of the popover component body
  • Property
    ----body--color
    Valuevar(----color)
    Description The color of the popover component body
  • Property
    ----body--padding-top
    Valuevar(----padding-top)
    Description The padding top of the popover component body
  • Property
    ----body--padding-right
    Valuevar(----padding-right)
    Description The padding right of the popover component body
  • Property
    ----body--padding-bottom
    Valuevar(----padding-bottom)
    Description The padding bottom of the popover component body
  • Property
    ----body--padding-left
    Valuevar(----padding-left)
    Description The padding left of the popover component body
  • Property
    ----body--padding
    Valuevar(----body--padding-top) var(----body--padding-right) var(----body--padding-bottom) var(----body--padding-left)
    Description The padding of the popover component body
  • Property
    ----footer--background
    Valuecolor('gray-05')
    Description The background of the popover component footer
  • Property
    ----footer--border-color
    Valuevar(----border-color)
    Description The border color of the popover component footer
  • Property
    ----footer--border-style
    Valuevar(----border-style)
    Description The border style of the popover component footer
  • Property
    ----footer--border-top-width
    Valuevar(----border-top-width)
    Description The border top width of the popover component footer
  • Property
    ----footer--border-right-width
    Valuevar(----border-right-width)
    Description The border right width of the popover component footer
  • Property
    ----footer--border-bottom-width
    Valuevar(----border-bottom-width)
    Description The border bottom width of the popover component footer
  • Property
    ----footer--border-left-width
    Valuevar(----border-left-width)
    Description The border left width of the popover component footer
  • Property
    ----footer--border-width
    Valuevar(----footer--border-top-width) var(----footer--border-right-width) var(----footer--border-bottom-width) var(----footer--border-left-width)
    Description The border width of the popover component footer
  • Property
    ----footer--color
    Valuevar(----color)
    Description The color of the popover component footer
  • Property
    ----footer--padding-top
    Valuevar(----padding-top)
    Description The padding top of the popover component footer
  • Property
    ----footer--padding-right
    Valuevar(----padding-right)
    Description The padding right of the popover component footer
  • Property
    ----footer--padding-bottom
    Valuevar(----padding-bottom)
    Description The padding bottom of the popover component footer
  • Property
    ----footer--padding-left
    Valuevar(----padding-left)
    Description The padding left of the popover component footer
  • Property
    ----footer--padding
    Valuevar(----footer--padding-top) var(----footer--padding-right) var(----footer--padding-bottom) var(----footer--padding-left)
    Description The padding of the popover component footer