Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Hover Card

    Preview card built on the Popover API, shown when a link is hovered or focused, for profiles, repositories, and other previews.

    @markasui

    MarkasUI

    UI components for Blade, React, and Vue.

    Joined March 2026

    @markasui

    MarkasUI

    UI components for Blade, React, and Vue.

    Joined March 2026

    @markasui

    MarkasUI

    UI components for Blade, React, and Vue.

    Joined March 2026

    @markasui

    MarkasUI

    UI components for Blade, React, and Vue.

    Joined March 2026

    @markasui

    MarkasUI

    UI components for Blade, React, and Vue.

    Joined March 2026

    <div class="flex justify-center py-6">
        <x-markas.hover-card>
            <a href="https://github.com/markasui" class="text-sm rounded-sm font-medium text-primary underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary">@markasui</a>
            <x-slot:content>
                <div class="flex gap-3">
                    <span class="grid size-10 shrink-0 place-items-center rounded-full border border-line bg-canvas"><svg class="size-6" viewBox="0 0 1464 1430" aria-hidden="true"><polygon points="354,578 1256,138 1171,430 268,868" class="fill-ink/15" /><polygon points="553,443 1455,3 1370,295 467,733" class="fill-ink/55" /><polygon points="421,762 1325,318 1240,611 336,1050" class="fill-success/35" /><polygon points="265,1073 1169,629 1084,922 180,1362" class="fill-ink/25" /><polygon points="93,965 997,521 912,814 8,1253" class="fill-ink/75" /><polygon points="347,1135 1251,691 1166,984 262,1424" class="fill-success" /></svg></span>
                    <div class="grid gap-1">
                        <p class="font-medium text-ink">MarkasUI</p>
                        <p class="text-muted">UI components for Blade, React, and Vue.</p>
                        <p class="text-xs text-muted">Joined March 2026</p>
                    </div>
                </div>
            </x-slot:content>
        </x-markas.hover-card>
    </div>
    import { HoverCard } from "@/components/markas/HoverCard";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
      {
        points: "421,762 1325,318 1240,611 336,1050",
        className: "fill-success/35",
      },
      { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
      {
        points: "347,1135 1251,691 1166,984 262,1424",
        className: "fill-success",
      },
    ];
    export default function HoverCardExample() {
      return (
        <div className="flex justify-center py-6">
          <HoverCard
            content={
              <div className="flex gap-3">
                <span className="grid size-10 shrink-0 place-items-center rounded-full border border-line bg-canvas">
                  <svg
                    className="size-6"
                    viewBox="0 0 1464 1430"
                    aria-hidden="true"
                  >
                    {mark.map((shape) => (
                      <polygon
                        key={shape.points}
                        points={shape.points}
                        className={shape.className}
                      />
                    ))}
                  </svg>
                </span>
                <div className="grid gap-1">
                  <p className="font-medium text-ink">MarkasUI</p>
                  <p className="text-muted">
                    UI components for Blade, React, and Vue.
                  </p>
                  <p className="text-xs text-muted">Joined March 2026</p>
                </div>
              </div>
            }
          >
            <a
              href="https://github.com/markasui"
              className="rounded-sm text-sm font-medium text-primary underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
            >
              @markasui
            </a>
          </HoverCard>
        </div>
      );
    }
    <script setup lang="ts">
    import HoverCard from "@/components/markas/HoverCard.vue";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
      {
        points: "421,762 1325,318 1240,611 336,1050",
        className: "fill-success/35",
      },
      { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
      {
        points: "347,1135 1251,691 1166,984 262,1424",
        className: "fill-success",
      },
    ];
    </script>
    
    <template>
      <div class="flex justify-center py-6">
        <HoverCard>
          <a
            href="https://github.com/markasui"
            class="rounded-sm text-sm font-medium text-primary underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
            >@markasui</a
          >
          <template #content>
            <div class="flex gap-3">
              <span
                class="grid size-10 shrink-0 place-items-center rounded-full border border-line bg-canvas"
                ><svg class="size-6" viewBox="0 0 1464 1430" aria-hidden="true">
                  <polygon
                    v-for="shape in mark"
                    :key="shape.points"
                    :points="shape.points"
                    :class="shape.className"
                  /></svg
              ></span>
              <div class="grid gap-1">
                <p class="font-medium text-ink">MarkasUI</p>
                <p class="text-muted">UI components for Blade, React, and Vue.</p>
                <p class="text-xs text-muted">Joined March 2026</p>
              </div>
            </div>
          </template>
        </HoverCard>
      </div>
    </template>
    <script lang="ts">
      import HoverCard from "$lib/components/markas/HoverCard.svelte";
    
      const mark = [
        { points: "354,578 1256,138 1171,430 268,868", class: "fill-ink/15" },
        { points: "553,443 1455,3 1370,295 467,733", class: "fill-ink/55" },
        { points: "421,762 1325,318 1240,611 336,1050", class: "fill-success/35" },
        { points: "265,1073 1169,629 1084,922 180,1362", class: "fill-ink/25" },
        { points: "93,965 997,521 912,814 8,1253", class: "fill-ink/75" },
        { points: "347,1135 1251,691 1166,984 262,1424", class: "fill-success" },
      ];
    </script>
    
    <div class="flex justify-center py-6">
      <HoverCard>
        <a
          href="https://github.com/markasui"
          class="rounded-sm text-sm font-medium text-primary underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
          >@markasui</a
        >
        {#snippet content()}
          <div class="flex gap-3">
            <span
              class="grid size-10 shrink-0 place-items-center rounded-full border border-line bg-canvas"
            >
              <svg class="size-6" viewBox="0 0 1464 1430" aria-hidden="true">
                {#each mark as shape (shape.points)}
                  <polygon points={shape.points} class={shape.class} />
                {/each}
              </svg>
            </span>
            <div class="grid gap-1">
              <p class="font-medium text-ink">MarkasUI</p>
              <p class="text-muted">UI components for Blade, React, and Vue.</p>
              <p class="text-xs text-muted">Joined March 2026</p>
            </div>
          </div>
        {/snippet}
      </HoverCard>
    </div>
    ---
    import HoverCard from "@/components/markas/HoverCard.astro";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", class: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", class: "fill-ink/55" },
      { points: "421,762 1325,318 1240,611 336,1050", class: "fill-success/35" },
      { points: "265,1073 1169,629 1084,922 180,1362", class: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", class: "fill-ink/75" },
      { points: "347,1135 1251,691 1166,984 262,1424", class: "fill-success" },
    ];
    ---
    
    <div class="flex justify-center py-6">
      <HoverCard>
        <a
          href="https://github.com/markasui"
          class="rounded-sm text-sm font-medium text-primary underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
          >@markasui</a
        >
        <div slot="content" class="flex gap-3">
          <span class="grid size-10 shrink-0 place-items-center rounded-full border border-line bg-canvas">
            <svg class="size-6" viewBox="0 0 1464 1430" aria-hidden="true">
              {mark.map((shape) => <polygon points={shape.points} class={shape.class} />)}
            </svg>
          </span>
          <div class="grid gap-1">
            <p class="font-medium text-ink">MarkasUI</p>
            <p class="text-muted">UI components for Blade, React, and Vue.</p>
            <p class="text-xs text-muted">Joined March 2026</p>
          </div>
        </div>
      </HoverCard>
    </div>
    import { Component } from "@angular/core";
    import { HoverCard } from "./markas/hover-card.component";
    
    @Component({
      selector: "markas-example",
      imports: [HoverCard],
      template: `
        <div class="flex justify-center py-6">
          <markas-hover-card>
            <a href="https://github.com/markasui" [class]="link">&#64;markasui</a>
            <div content class="flex gap-3">
              <span [class]="badge">
                <svg class="size-6" viewBox="0 0 1464 1430" aria-hidden="true">
                  @for (shape of mark; track shape.points) {
                    <polygon
                      [attr.points]="shape.points"
                      [attr.class]="shape.class"
                    />
                  }
                </svg>
              </span>
              <div class="grid gap-1">
                <p class="font-medium text-ink">MarkasUI</p>
                <p class="text-muted">UI components for Blade, React, and Vue.</p>
                <p class="text-xs text-muted">Joined March 2026</p>
              </div>
            </div>
          </markas-hover-card>
        </div>
      `,
    })
    export default class HoverCardExample {
      protected readonly link =
        "rounded-sm text-sm font-medium text-primary underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
      protected readonly badge =
        "grid size-10 shrink-0 place-items-center rounded-full border border-line bg-canvas";
      protected readonly mark = [
        { points: "354,578 1256,138 1171,430 268,868", class: "fill-ink/15" },
        { points: "553,443 1455,3 1370,295 467,733", class: "fill-ink/55" },
        { points: "421,762 1325,318 1240,611 336,1050", class: "fill-success/35" },
        { points: "265,1073 1169,629 1084,922 180,1362", class: "fill-ink/25" },
        { points: "93,965 997,521 912,814 8,1253", class: "fill-ink/75" },
        { points: "347,1135 1251,691 1166,984 262,1424", class: "fill-success" },
      ];
    }

    Examples

    Inside text

    This release was maintained by Rina Wijaya

    Rina Wijaya

    Design engineer in Bandung. Works on forms and accessibility.

    with help from 40 contributors.
    This release was maintained by Rina Wijaya

    Rina Wijaya

    Design engineer in Bandung. Works on forms and accessibility.

    with help from 40 contributors.
    This release was maintained by Rina Wijaya

    Rina Wijaya

    Design engineer in Bandung. Works on forms and accessibility.

    with help from 40 contributors.
    This release was maintained by Rina Wijaya

    Rina Wijaya

    Design engineer in Bandung. Works on forms and accessibility.

    with help from 40 contributors.
    This release was maintained by Rina Wijaya

    Rina Wijaya

    Design engineer in Bandung. Works on forms and accessibility.

    with help from 40 contributors.

    Repository preview

    Built on top of

    markasui/markasui

    markasui/markasui

    Copy and paste UI components with identical markup in three frameworks.

    1.2k stars MIT license Updated today

    Built on top of

    markasui/markasui

    markasui/markasui

    Copy and paste UI components with identical markup in three frameworks.

    1.2k starsMIT licenseUpdated today

    Built on top of

    markasui/markasui

    markasui/markasui

    Copy and paste UI components with identical markup in three frameworks.

    1.2k stars MIT licenseUpdated today

    Built on top of

    markasui/markasui

    markasui/markasui

    Copy and paste UI components with identical markup in three frameworks.

    1.2k stars MIT license Updated today

    Built on top of

    markasui/markasui

    markasui/markasui

    Copy and paste UI components with identical markup in three frameworks.

    1.2k starsMIT licenseUpdated today

    Avatar triggers

    DL

    Dewi Lestari

    Product designer. Leads the design system team.

    BS

    Budi Santoso

    Backend engineer. Maintains the registry and CLI.

    DL

    Dewi Lestari

    Product designer. Leads the design system team.

    BS

    Budi Santoso

    Backend engineer. Maintains the registry and CLI.

    DL

    Dewi Lestari

    Product designer. Leads the design system team.

    BS

    Budi Santoso

    Backend engineer. Maintains the registry and CLI.

    DL

    Dewi Lestari

    Product designer. Leads the design system team.

    BS

    Budi Santoso

    Backend engineer. Maintains the registry and CLI.

    DL

    Dewi Lestari

    Product designer. Leads the design system team.

    BS

    Budi Santoso

    Backend engineer. Maintains the registry and CLI.

    Installation

    npx markasui@latest add hover-card

    Usage

    <x-markas.hover-card>
        <a href="https://github.com/markasui">@markasui</a>
        <x-slot:content>
            <p class="font-medium text-ink">Markas UI</p>
            <p class="text-muted">UI components for Blade, React, and Vue.</p>
        </x-slot:content>
    </x-markas.hover-card>

    Needs Alpine.js.

    import { HoverCard } from "@/components/markas/HoverCard";
    
    <HoverCard
      content={
        <>
          <p className="font-medium text-ink">Markas UI</p>
          <p className="text-muted">UI components for Blade, React, and Vue.</p>
        </>
      }
    >
      <a href="https://github.com/markasui">@markasui</a>
    </HoverCard>;
    <template>
      <HoverCard>
        <a href="https://github.com/markasui">@markasui</a>
        <template #content>
          <p class="font-medium text-ink">Markas UI</p>
          <p class="text-muted">UI components for Blade, React, and Vue.</p>
        </template>
      </HoverCard>
    </template>
    <script lang="ts">
      import HoverCard from "$lib/components/markas/HoverCard.svelte";
    </script>
    
    <HoverCard>
      <a href="https://github.com/markasui">@markasui</a>
      {#snippet content()}
        <p class="font-medium text-ink">Markas UI</p>
        <p class="text-muted">UI components for Blade, React, and Vue.</p>
      {/snippet}
    </HoverCard>
    ---
    import HoverCard from "@/components/markas/HoverCard.astro";
    ---
    
    <HoverCard>
      <a href="https://github.com/markasui">@markasui</a>
      <Fragment slot="content">
        <p class="font-medium text-ink">Markas UI</p>
        <p class="text-muted">UI components for Blade, React, and Vue.</p>
      </Fragment>
    </HoverCard>

    Each card is wrapped in a small markas-hover-card custom element with display: contents, so it also works after view transitions.

    import { Component } from "@angular/core";
    import { HoverCard } from "./markas/hover-card.component";
    
    @Component({
      selector: "app-maintainer",
      imports: [HoverCard],
      template: `
        <markas-hover-card>
          <a href="https://github.com/markasui">&#64;markasui</a>
          <ng-container content>
            <p class="font-medium text-ink">Markas UI</p>
            <p class="text-muted">UI components for Blade, React, and Vue.</p>
          </ng-container>
        </markas-hover-card>
      `,
    })
    export class Maintainer {}
    • The first element inside HoverCard is the trigger and automatically gets aria-describedby pointing to the card.
    • The card shows below the trigger and flips above it when there is no room.
    • Inside a paragraph, keep the card content to inline elements (span, a, strong), because a div or p would break the paragraph in server rendered HTML.
    • Hover Card has no built-in text. Write the content in the language of your site.

    Props

    NameTypeDefaultDescription
    children / slotslot / ReactNode-A single focusable trigger element, usually a link.
    contentslot / ReactNode / snippet-Card content. Blade, Vue, and Astro use the content slot, React uses the content prop, Svelte the content snippet, Angular an element with the content attribute.
    idstringautoCard element id, used for the trigger aria-describedby.

    Accessibility

    • The trigger automatically gets aria-describedby pointing to the card, so screen readers announce the preview.
    • Shows on hover after 400ms and right away when the trigger receives keyboard focus.
    • Moving the mouse away, moving focus outside the trigger and card, or pressing Escape hides the card.
    • The card is a preview only: the trigger link must lead to the same information.

    Related components

    More overlay components with the same classes in every framework.