Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Variable Weight Text

    Teks yang hurufnya makin tebal saat kursor makin dekat, memakai sumbu wght font variabel. Ada gelombang opsional yang bernapas saat diam.

    Proximity

    Move your cursor across the letters

    Proximity

    Move your cursor across the letters

    Proximity

    Move your cursor across the letters

    Proximity

    Move your cursor across the letters

    Proximity

    Move your cursor across the letters

    <div class="text-center">
        <p class="text-6xl tracking-tight text-ink">
            <x-markas.variable-weight-text text="Proximity" />
        </p>
        <p class="mt-3 text-sm text-muted">Move your cursor across the letters</p>
    </div>
    import { VariableWeightText } from "@/components/markas/VariableWeightText";
    
    export default function VariableWeightTextExample() {
      return (
        <div className="text-center">
          <p className="text-6xl tracking-tight text-ink">
            <VariableWeightText text="Proximity" />
          </p>
          <p className="mt-3 text-sm text-muted">
            Move your cursor across the letters
          </p>
        </div>
      );
    }
    <script setup lang="ts">
    import VariableWeightText from "@/components/markas/VariableWeightText.vue";
    </script>
    
    <template>
      <div class="text-center">
        <p class="text-6xl tracking-tight text-ink">
          <VariableWeightText text="Proximity" />
        </p>
        <p class="mt-3 text-sm text-muted">Move your cursor across the letters</p>
      </div>
    </template>
    <script lang="ts">
      import VariableWeightText from "$lib/components/markas/VariableWeightText.svelte";
    </script>
    
    <div class="text-center">
      <p class="text-6xl tracking-tight text-ink">
        <VariableWeightText text="Proximity" />
      </p>
      <p class="mt-3 text-sm text-muted">Move your cursor across the letters</p>
    </div>
    ---
    import VariableWeightText from "@/components/markas/VariableWeightText.astro";
    ---
    
    <div class="text-center">
      <p class="text-6xl tracking-tight text-ink">
        <VariableWeightText text="Proximity" />
      </p>
      <p class="mt-3 text-sm text-muted">Move your cursor across the letters</p>
    </div>
    import { Component } from "@angular/core";
    import { VariableWeightText } from "./markas/variable-weight-text.component";
    
    @Component({
      selector: "markas-example",
      imports: [VariableWeightText],
      template: `
        <div class="text-center">
          <p class="text-6xl tracking-tight text-ink">
            <span markas-variable-weight-text text="Proximity"></span>
          </p>
          <p class="mt-3 text-sm text-muted">Move your cursor across the letters</p>
        </div>
      `,
    })
    export default class VariableWeightTextExample {}

    Contoh

    Kata hero

    Type that reacts

    Letters near the cursor get bolder. Works with any variable font that has a weight axis.

    Type that reacts

    Letters near the cursor get bolder. Works with any variable font that has a weight axis.

    Type that reacts

    Letters near the cursor get bolder. Works with any variable font that has a weight axis.

    Type that reacts

    Letters near the cursor get bolder. Works with any variable font that has a weight axis.

    Type that reacts

    Letters near the cursor get bolder. Works with any variable font that has a weight axis.

    Gelombang bernapas

    Breathe in, breathe out

    Breathe in, breathe out

    Breathe in, breathe out

    Breathe in, breathe out

    Breathe in, breathe out

    Wordmark footer

    Made in Bandung 2026

    markasui

    Made in Bandung2026

    markasui

    Made in Bandung2026

    markasui

    Made in Bandung 2026

    markasui

    Made in Bandung2026

    markasui

    Instalasi

    npx markasui@latest add variable-weight-text

    Pemakaian

    <p class="text-6xl">
        <x-markas.variable-weight-text text="Kedekatan" :radius="100" :min="200" :max="900" />
    </p>
    <x-markas.variable-weight-text text="markasui" wave class="text-7xl" />
    import { VariableWeightText } from "@/components/markas/VariableWeightText";
    
    <p className="text-6xl">
      <VariableWeightText text="Kedekatan" radius={100} min={200} max={900} />
    </p>
    <VariableWeightText text="markasui" wave className="text-7xl" />
    <template>
      <p class="text-6xl">
        <VariableWeightText text="Kedekatan" :radius="100" :min="200" :max="900" />
      </p>
      <VariableWeightText text="markasui" wave class="text-7xl" />
    </template>
    <script lang="ts">
      import VariableWeightText from "$lib/components/markas/VariableWeightText.svelte";
    </script>
    
    <p class="text-6xl">
      <VariableWeightText text="Kedekatan" radius={100} min={200} max={900} />
    </p>
    <VariableWeightText text="markasui" wave class="text-7xl" />
    ---
    import VariableWeightText from "@/components/markas/VariableWeightText.astro";
    ---
    
    <p class="text-6xl">
      <VariableWeightText text="Kedekatan" radius={100} min={200} max={900} />
    </p>
    <VariableWeightText text="markasui" wave class="text-7xl" />
    import { Component } from "@angular/core";
    import { VariableWeightText } from "./markas/variable-weight-text.component";
    
    @Component({
      selector: "app-wordmark",
      imports: [VariableWeightText],
      template: `
        <p class="text-6xl">
          <span
            markas-variable-weight-text
            text="Kedekatan"
            radius="100"
            min="200"
            max="900"
          ></span>
        </p>
        <span
          markas-variable-weight-text
          text="markasui"
          wave
          class="text-7xl"
        ></span>
      `,
    })
    export class Wordmark {}

    Angular memakai attribute selector pada span: <span markas-variable-weight-text>.

    • Butuh font variabel dengan sumbu wght, misalnya Inter, Geist, Recursive, atau font sistem di macOS dan iOS. Dengan font statis, berat melompat di antara berat yang dimuat.
    • Setiap huruf memasang font-variation-settings: 'wght' n dan font-weight sebagai cadangan. Huruf di bawah kursor mendapat max; huruf di luar radius kembali ke min, yang juga berat saat diam.
    • wave menjalankan gelombang berat yang bernapas selama kursor jauh. Berhenti saat teks di luar layar dan saat tab tersembunyi.
    • Screen reader membaca teks sekali. Dengan reduced motion, huruf tetap di min. Versi Blade butuh Alpine.js.

    Props

    NamaTipeDefaultKeterangan
    textstring-Teksnya. Screen reader membacanya sekali secara utuh.
    radiusnumber120Jarak dalam piksel dari kursor tempat huruf menebal.
    minnumber300Berat saat diam dan di luar radius.
    maxnumber800Berat huruf tepat di bawah kursor.
    wavebooleanfalseSaat kursor jauh, gelombang berat berjalan melewati huruf. Berhenti saat di luar layar.

    Aksesibilitas

    • Screen reader membaca teks utuh sekali dari salinan tersembunyi; span huruf memakai aria-hidden.
    • Efeknya dekoratif dan tidak butuh interaksi; teks tetap terbaca di setiap berat.
    • Dengan reduced motion, huruf tetap di berat min dan gelombang tidak berjalan.

    Komponen terkait

    Komponen animasi lain dengan class yang sama di setiap framework.