 Search
guides/style-guide: Style Guide guides/style-guide: ## Box Model guides/style-guide: ## Text plugins/plugin-dev: Developing Plugins plugins/plugin-dev: ### Style Layers components/checkbox: Checkbox components/checkbox: ## Import components/checkbox: ## Usage components/checkbox: ## Focus components/checkbox: ## Scope components/popover: Popover components/popover: ## Import components/popover: ## Usage components/popover: ### position- components/popover: #### Values components/popover: ### Properties components/popover: ### Extending plugins/plugin-nf: Nerd Font Plugin plugins/plugin-nf: ## Installation plugins/plugin-nf: ## Install a Nerd Font plugins/plugin-nf: ### Static Font plugins/plugin-nf: ### CDN plugins/plugin-nf: ## Components plugins/plugin-nf: ### <details> plugins/plugin-nf: ### Badge plugins/plugin-nf: #### cap- components/badge: Badge components/badge: ## Import components/badge: ## Usage components/badge: ### variant- components/badge: ### Properties components/badge: ### Extending components/badge: ## Scope components/input: Input components/input: ## Import components/input: ## Usage components/input: ### box- components/input: ### size- components/input: ### Extending components/input: ## Scope plugins/theme-nord: Nord Theme plugins/theme-nord: ## Installation plugins/theme-nord: ## Components plugins/theme-nord: ### Typography plugins/theme-nord: ### Badge plugins/theme-nord: ### Button plugins/theme-nord: ## CSS Variables components/button: Button components/button: ## Import components/button: ## Usage components/button: ### box- components/button: ### variant- components/button: ### size- components/button: ### disabled components/button: ### Properties components/button: ### Extending components/button: ## Scope plugins/theme-catppuccin: Catppuccin Theme plugins/theme-catppuccin: ## Installation plugins/theme-catppuccin: ## Flavors plugins/theme-catppuccin: ## Components plugins/theme-catppuccin: ### Typography plugins/theme-catppuccin: ### Badge plugins/theme-catppuccin: ### Button plugins/theme-catppuccin: ## CSS Variables plugins/theme-gruvbox: Gruvbox Theme plugins/theme-gruvbox: ## Installation plugins/theme-gruvbox: ## Variants plugins/theme-gruvbox: ## Components plugins/theme-gruvbox: ### Typography plugins/theme-gruvbox: ### Badge plugins/theme-gruvbox: ### Button plugins/theme-gruvbox: ## CSS Variables components/typography: Typography components/typography: ## Import components/typography: ## Usage components/typography: ### <h1>-<h6> components/typography: ### <p> components/typography: ### <blockquote> components/typography: ### <ol> components/typography: ### <ul> components/typography: #### <ul> Markers components/typography: ### [is-="typography-block"] components/typography: ## Scope start/ascii-boxes: ASCII Boxes start/ascii-boxes: ## Usage start/ascii-boxes: ## Border Types start/ascii-boxes: ## Containment start/ascii-boxes: ## Custom Properties start/ascii-boxes: ### --box-border-color start/ascii-boxes: ### --box-rounded-radius start/ascii-boxes: ### --box-border-width start/ascii-boxes: ### --box-double-border-width start/intro: Introduction start/intro: ## Features start/plugins: Plugins start/plugins: ## Official Plugins start/plugins: ### Themes start/plugins: ## Community Plugins start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins start/tuis-vs-guis: TUIs vs GUIs start/tuis-vs-guis: ## Monospace Fonts start/tuis-vs-guis: ## Character Cells start/installation: Installation start/installation: ## Installation start/installation: ## ESM Imports start/installation: ## CDN Imports start/installation: ## Full Library Import

Popover

Import

@import "@webtui/css/components/popover.css";

Usage

Add the is-~="popover" attribute to a <details> element to make it a popover

<details is-="popover">
    <summary>Popover</summary>
    <div>Popover content</div>
</details>

The first child following the <summary> element is the popover content

position-

Use the position- attribute to change the position of the popover

<details is-~="popover" position-="top"></details>
<details is-~="popover" position-="left"></details>
<details is-~="popover" position-="bottom"></details>
<details is-~="popover" position-="right"></details>

Add two values to the position- attribute to change the x and y positioning of the popover content

<details is-~="popover" position-="top left"></details>
<details is-~="popover" position-="right baseline-top"></details>
<details is-~="popover" position-="bottom baseline-left"></details>

The image below shows the values and positions that can be used in the position- property

 popover-positioning.png

popover-positioning.png

Values

  • top
  • bottom
  • left
  • right
  • baseline-top
  • baseline-bottom
  • baseline-left
  • baseline-right

Properties

  • --popover-backdrop-color: The background color of the backdrop (transparent by default)
  • --popover-offset-x: The horizontal offset of the popover
  • --popover-offset-y: The vertical offset of the popover
#my-custom-popover {
    --popover-backdrop-color: rgba(0, 0, 0, 0.5);
    --popover-offset-x: 1ch;
    --popover-offset-y: 1lh;
}

Extending

To extend the Popover stylesheet, define a CSS rule on the components layer

@layer components {
    details[is-~="popover"] {
        &[variant-="inverted"] {
            /* ... */
        }

        /* ... */
    }
}

## Scope

```css
details[is-~="popover"] { /* ... */ }