Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Elastic Line

    Garis SVG yang melengkung ke arah, menjauhi, atau ikut kursor saat kursor mendekat, lalu memegas kembali. Cocok sebagai pemisah atau garis bawah judul.

    Release 2.4

    Stacking cards, pixel trails, and a faster CLI.

    Release 2.3

    Indonesian docs and Rupiah currency input.

    Release 2.4

    Stacking cards, pixel trails, and a faster CLI.

    Release 2.3

    Indonesian docs and Rupiah currency input.

    Release 2.4

    Stacking cards, pixel trails, and a faster CLI.

    Release 2.3

    Indonesian docs and Rupiah currency input.

    Release 2.4

    Stacking cards, pixel trails, and a faster CLI.

    Release 2.3

    Indonesian docs and Rupiah currency input.

    Release 2.4

    Stacking cards, pixel trails, and a faster CLI.

    Release 2.3

    Indonesian docs and Rupiah currency input.

    @php
        $wrap = 'grid rounded-xl border border-line bg-surface px-6 py-4';
        $section = 'py-2';
        $title = 'text-base font-semibold text-ink';
        $text = 'mt-1 text-sm text-muted';
    @endphp
    
    <div class="{{ $wrap }}">
        <section class="{{ $section }}">
            <h3 class="{{ $title }}">Release 2.4</h3>
            <p class="{{ $text }}">Stacking cards, pixel trails, and a faster CLI.</p>
        </section>
        <x-markas.elastic-line />
        <section class="{{ $section }}">
            <h3 class="{{ $title }}">Release 2.3</h3>
            <p class="{{ $text }}">Indonesian docs and Rupiah currency input.</p>
        </section>
    </div>
    import { ElasticLine } from "@/components/markas/ElasticLine";
    
    const wrap = "grid rounded-xl border border-line bg-surface px-6 py-4";
    const section = "py-2";
    const title = "text-base font-semibold text-ink";
    const text = "mt-1 text-sm text-muted";
    
    export default function ElasticLineExample() {
      return (
        <div className={wrap}>
          <section className={section}>
            <h3 className={title}>Release 2.4</h3>
            <p className={text}>Stacking cards, pixel trails, and a faster CLI.</p>
          </section>
          <ElasticLine />
          <section className={section}>
            <h3 className={title}>Release 2.3</h3>
            <p className={text}>Indonesian docs and Rupiah currency input.</p>
          </section>
        </div>
      );
    }
    <script setup lang="ts">
    import ElasticLine from "@/components/markas/ElasticLine.vue";
    
    const wrap = "grid rounded-xl border border-line bg-surface px-6 py-4";
    const section = "py-2";
    const title = "text-base font-semibold text-ink";
    const text = "mt-1 text-sm text-muted";
    </script>
    
    <template>
      <div :class="wrap">
        <section :class="section">
          <h3 :class="title">Release 2.4</h3>
          <p :class="text">Stacking cards, pixel trails, and a faster CLI.</p>
        </section>
        <ElasticLine />
        <section :class="section">
          <h3 :class="title">Release 2.3</h3>
          <p :class="text">Indonesian docs and Rupiah currency input.</p>
        </section>
      </div>
    </template>
    <script lang="ts">
      import ElasticLine from "$lib/components/markas/ElasticLine.svelte";
    
      const wrap = "grid rounded-xl border border-line bg-surface px-6 py-4";
      const section = "py-2";
      const title = "text-base font-semibold text-ink";
      const text = "mt-1 text-sm text-muted";
    </script>
    
    <div class={wrap}>
      <section class={section}>
        <h3 class={title}>Release 2.4</h3>
        <p class={text}>Stacking cards, pixel trails, and a faster CLI.</p>
      </section>
      <ElasticLine />
      <section class={section}>
        <h3 class={title}>Release 2.3</h3>
        <p class={text}>Indonesian docs and Rupiah currency input.</p>
      </section>
    </div>
    ---
    import ElasticLine from "@/components/markas/ElasticLine.astro";
    
    const wrap = "grid rounded-xl border border-line bg-surface px-6 py-4";
    const section = "py-2";
    const title = "text-base font-semibold text-ink";
    const text = "mt-1 text-sm text-muted";
    ---
    
    <div class={wrap}>
      <section class={section}>
        <h3 class={title}>Release 2.4</h3>
        <p class={text}>Stacking cards, pixel trails, and a faster CLI.</p>
      </section>
      <ElasticLine />
      <section class={section}>
        <h3 class={title}>Release 2.3</h3>
        <p class={text}>Indonesian docs and Rupiah currency input.</p>
      </section>
    </div>
    import { Component } from "@angular/core";
    import { ElasticLine } from "./markas/elastic-line.component";
    
    @Component({
      selector: "markas-example",
      imports: [ElasticLine],
      template: `
        <div [class]="wrap">
          <section [class]="section">
            <h3 [class]="title">Release 2.4</h3>
            <p [class]="text">Stacking cards, pixel trails, and a faster CLI.</p>
          </section>
          <markas-elastic-line />
          <section [class]="section">
            <h3 [class]="title">Release 2.3</h3>
            <p [class]="text">Indonesian docs and Rupiah currency input.</p>
          </section>
        </div>
      `,
    })
    export default class ElasticLineExample {
      protected readonly wrap =
        "grid rounded-xl border border-line bg-surface px-6 py-4";
      protected readonly section = "py-2";
      protected readonly title = "text-base font-semibold text-ink";
      protected readonly text = "mt-1 text-sm text-muted";
    }

    Contoh

    Garis bawah judul yang dipetik

    New in Markas

    Build faster, ship calmer

    Touch the underline and pull: it slips free and vibrates like a string.

    New in Markas

    Build faster, ship calmer

    Touch the underline and pull: it slips free and vibrates like a string.

    New in Markas

    Build faster, ship calmer

    Touch the underline and pull: it slips free and vibrates like a string.

    New in Markas

    Build faster, ship calmer

    Touch the underline and pull: it slips free and vibrates like a string.

    New in Markas

    Build faster, ship calmer

    Touch the underline and pull: it slips free and vibrates like a string.

    Pemisah vertikal antarangka statistik

    61

    Components

    3

    Frameworks

    12k

    Weekly installs

    61

    Components

    3

    Frameworks

    12k

    Weekly installs

    61

    Components

    3

    Frameworks

    12k

    Weekly installs

    61

    Components

    3

    Frameworks

    12k

    Weekly installs

    61

    Components

    3

    Frameworks

    12k

    Weekly installs

    Pemisah footer

    Instalasi

    npx markasui@latest add elastic-line

    Pemakaian

    <h2 class="text-3xl font-semibold">Layanan kami</h2>
    <x-markas.elastic-line variant="pluck" color="primary" :stroke-width="3" :reach="16" play-on-view decorative class="w-40" />
    
    <x-markas.elastic-line variant="push" :reach="32" />

    Butuh Alpine.js.

    import { ElasticLine } from "@/components/markas/ElasticLine";
    
    <h2 className="text-3xl font-semibold">Layanan kami</h2>
    <ElasticLine
      variant="pluck"
      color="primary"
      strokeWidth={3}
      reach={16}
      playOnView
      decorative
      className="w-40"
    />
    
    <ElasticLine variant="push" reach={32} />
    <template>
      <h2 class="text-3xl font-semibold">Layanan kami</h2>
      <ElasticLine
        variant="pluck"
        color="primary"
        :stroke-width="3"
        :reach="16"
        play-on-view
        decorative
        class="w-40"
      />
    
      <ElasticLine variant="push" :reach="32" />
    </template>
    <script lang="ts">
      import ElasticLine from "$lib/components/markas/ElasticLine.svelte";
    </script>
    
    <h2 class="text-3xl font-semibold">Our services</h2>
    <ElasticLine
      variant="pluck"
      color="primary"
      strokeWidth={3}
      reach={16}
      playOnView
      decorative
      class="w-40"
    />
    ---
    import ElasticLine from "@/components/markas/ElasticLine.astro";
    ---
    
    <h2 class="text-3xl font-semibold">Our services</h2>
    <ElasticLine
      variant="pluck"
      color="primary"
      strokeWidth={3}
      reach={16}
      playOnView
      decorative
      class="w-40"
    />

    Setiap garis adalah custom element kecil yang menjalankan pegasnya sendiri, juga setelah view transition.

    import { Component } from "@angular/core";
    import { ElasticLine } from "./markas/elastic-line.component";
    
    @Component({
      selector: "app-services-heading",
      imports: [ElasticLine],
      template: `
        <h2 class="text-3xl font-semibold">Our services</h2>
        <markas-elastic-line
          variant="pluck"
          color="primary"
          [strokeWidth]="3"
          [reach]="16"
          playOnView
          decorative
          class="w-40"
        />
      `,
    })
    export class ServicesHeading {}
    • Tinggi komponen reach x 2 (atau lebarnya bila vertikal) dan garis berada di tengahnya. Kursor hanya melengkungkan garis di dalam pita itu.
    • pull melengkung ke arah kursor, push menjauhinya, dan pluck mengikuti kursor setelah disentuh sampai lepas lalu bergetar.
    • Lengkungan adalah satu path SVG kuadratik. requestAnimationFrame hanya berjalan selama kursor dekat atau garis masih bergerak. playOnView membuatnya bergetar sekali saat pertama kali masuk layar.
    • Secara bawaan garis adalah separator. Pakai decorative untuk garis bawah. Dengan reduced motion garis tetap lurus. Atribut dan class jatuh ke pembungkus.

    Props

    NamaTipeDefaultKeterangan
    variant"pull" | "push" | "pluck""pull"pull: garis melengkung ke arah kursor. push: melengkung menjauh seperti dinding lunak. pluck: mengikuti kursor setelah disentuh, lalu lepas dan bergetar.
    orientation"horizontal" | "vertical""horizontal"Arah garis. Garis vertikal meregang setinggi baris flex-nya.
    reachnumber24Px di tiap sisi garis tempat kursor melengkungkannya. Juga lengkungan terbesar. Tinggi (atau lebar) komponen dua kali nilai ini.
    color"line" | "muted" | "ink" | "primary" | "success" | "warning" | "danger""line"Token warna garis.
    strokeWidthnumber1.5Tebal garis dalam px. Tetap sama berapa pun lebar garisnya.
    playOnViewbooleanfalseBergetar sekali saat garis pertama kali masuk layar.
    decorativebooleanfalseMenyembunyikan garis dari teknologi bantu, untuk garis bawah dan ornamen. Jika tidak, garis diumumkan sebagai pemisah.

    Aksesibilitas

    • Secara bawaan garis punya role="separator" dengan aria-orientation; pakai decorative untuk garis bawah agar disembunyikan.
    • Lengkungan digambar dengan mengubah satu path SVG; requestAnimationFrame hanya berjalan selama kursor dekat atau garis masih bergerak.
    • Dengan reduced motion garis tetap lurus dan tidak bergetar.

    Komponen terkait

    Komponen markasui lain dengan class yang sama di setiap framework.