Set the measure first
Long lines tire the eye, so readers lose their place on the way back. Keep body text at 45 to 75 characters per line, give it a line height near 1.5, and let headings sit closer to the text they introduce than to the one above.
Sorotan di balik teks inline yang tergambar dari empat arah: saat masuk layar, hover atau fokus, mount, atau perintah. Solid, stabilo, garis bawah, gradien.
Long lines tire the eye, so readers lose their place on the way back. Keep body text at 45 to 75 characters per line, give it a line height near 1.5, and let headings sit closer to the text they introduce than to the one above.
Long lines tire the eye, so readers lose their place on the way back. Keep body text at 45 to 75 characters per line, give it a line height near 1.5, and let headings sit closer to the text they introduce than to the one above.
Long lines tire the eye, so readers lose their place on the way back. Keep body text at 45 to 75 characters per line, give it a line height near 1.5, and let headings sit closer to the text they introduce than to the one above.
Long lines tire the eye, so readers lose their place on the way back. Keep body text at 45 to 75 characters per line, give it a line height near 1.5, and let headings sit closer to the text they introduce than to the one above.
Long lines tire the eye, so readers lose their place on the way back. Keep body text at
<article class="text-base leading-7 text-muted">
<h3 class="text-lg font-semibold text-ink">Set the measure first</h3>
<p class="mt-2">Long lines tire the eye, so readers lose their place on the way back. Keep body text at <x-markas.text-highlighter>45 to 75 characters</x-markas.text-highlighter> per line, give it a <x-markas.text-highlighter :delay="400">line height near 1.5</x-markas.text-highlighter>, and let headings sit <x-markas.text-highlighter :delay="800">closer to the text they introduce</x-markas.text-highlighter> than to the one above.</p>
</article><ul class="grid gap-3 text-base font-medium text-ink">
<li><a href="#" class="rounded-sm focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary"><x-markas.text-highlighter trigger="hover" :duration="400">Left to right</x-markas.text-highlighter></a></li>
<li><a href="#" class="rounded-sm focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary"><x-markas.text-highlighter trigger="hover" direction="rtl" color="success" :duration="400">Right to left</x-markas.text-highlighter></a></li>
<li><a href="#" class="rounded-sm focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary"><x-markas.text-highlighter trigger="hover" direction="ttb" color="danger" :duration="400">Top to bottom</x-markas.text-highlighter></a></li>
<li><a href="#" class="rounded-sm focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary"><x-markas.text-highlighter trigger="hover" direction="btt" color="primary" :duration="400">Bottom to top</x-markas.text-highlighter></a></li>
</ul>Before you publish, check that the title fits in 60 characters, every image has alt text, and the summary answers one clear question.
Before you publish, check that the title fits in 60 characters, every image has alt text, and the summary answers one clear question.
Before you publish, check that the title fits in 60 characters, every image has alt text, and the summary answers one clear question.
Before you publish, check that the title fits in 60 characters, every image has alt text, and the summary answers one clear question.
Before you publish, check that the
<div x-data class="grid gap-4">
<p class="text-base leading-7 text-muted">Before you publish, check that the <x-markas.text-highlighter trigger="manual">title fits in 60 characters</x-markas.text-highlighter>, every image has <x-markas.text-highlighter trigger="manual" color="success" :delay="250">alt text</x-markas.text-highlighter>, and the summary answers <x-markas.text-highlighter trigger="manual" color="danger" :delay="500">one clear question</x-markas.text-highlighter>.</p>
<div class="flex gap-2">
<button type="button" class="inline-flex h-9 items-center rounded-lg bg-primary px-3 text-sm font-medium text-on-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary" x-on:click="$dispatch('markas-highlight')">Highlight</button>
<button type="button" class="inline-flex h-9 items-center rounded-lg border border-line bg-surface px-3 text-sm font-medium text-ink hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary" x-on:click="$dispatch('markas-highlight-reset')">Reset</button>
</div>
</div>One set of components for Blade, React, and Vue, with tokens your team already knows.
One set of components for Blade, React, and Vue, with tokens your team already knows.
One set of components for Blade, React, and Vue, with tokens your team already knows.
One set of components for Blade, React, and Vue, with tokens your team already knows.
One set of components for Blade, React, and Vue, with tokens your team already knows.
<div class="py-4 text-center">
<h2 class="text-4xl leading-tight font-semibold tracking-tight text-ink">Ship your <x-markas.text-highlighter variant="marker" :duration="900">design system</x-markas.text-highlighter> before the next sprint</h2>
<p class="mx-auto mt-4 max-w-sm text-base leading-7 text-muted">One set of components for Blade, React, and Vue, with tokens your team already knows.</p>
</div><ul class="grid gap-3 text-base leading-7 text-muted">
<li>A <x-markas.text-highlighter>solid block</x-markas.text-highlighter> for quotes worth saving.</li>
<li>A <x-markas.text-highlighter variant="marker" color="success" :delay="150">marker stroke</x-markas.text-highlighter> for notes in the margin.</li>
<li>A <x-markas.text-highlighter variant="underline" color="danger" :delay="300">thick underline</x-markas.text-highlighter> for terms to remember.</li>
<li>A <x-markas.text-highlighter variant="gradient" :delay="450">two tone gradient</x-markas.text-highlighter> for the headline idea.</li>
</ul>npx markasui@latest add text-highlighterpnpm dlx markasui@latest add text-highlighteryarn dlx markasui@latest add text-highlighterbunx --bun markasui@latest add text-highlighternpm install alpinejsresources/views/components/markas/text-highlighter.blade.php.src/components/markas/TextHighlighter.tsx.src/components/markas/TextHighlighter.vue.src/lib/components/markas/TextHighlighter.svelte.src/components/markas/TextHighlighter.astro.src/app/markas/text-highlighter.component.ts.<p>Jaga teks isi di <x-markas.text-highlighter>45 sampai 75 karakter</x-markas.text-highlighter> per baris, dengan <x-markas.text-highlighter variant="marker" :delay="400">tinggi baris sekitar 1,5</x-markas.text-highlighter>.</p>
<a href="/docs"><x-markas.text-highlighter trigger="hover" direction="rtl" color="success">Baca dokumentasi</x-markas.text-highlighter></a>
<div x-data>
<x-markas.text-highlighter trigger="manual">Siap terbit</x-markas.text-highlighter>
<button type="button" x-on:click="$dispatch('markas-highlight', { direction: 'ltr' })">Sorot</button>
<button type="button" x-on:click="$dispatch('markas-highlight-reset')">Ulang</button>
</div>import { useRef } from "react";
import {
TextHighlighter,
type TextHighlighterHandle,
} from "@/components/markas/TextHighlighter";
const highlight = useRef<TextHighlighterHandle>(null);
<p>
Jaga teks isi di <TextHighlighter>45 sampai 75 karakter</TextHighlighter> per
baris, dengan{" "}
<TextHighlighter variant="marker" delay={400}>
tinggi baris sekitar 1,5
</TextHighlighter>
.
</p>
<TextHighlighter ref={highlight} trigger="manual">Siap terbit</TextHighlighter>
<button type="button" onClick={() => highlight.current?.animate("rtl")}>Sorot</button>
<button type="button" onClick={() => highlight.current?.reset()}>Ulang</button><script setup lang="ts">
import { ref } from "vue";
import TextHighlighter from "@/components/markas/TextHighlighter.vue";
const active = ref(false);
</script>
<template>
<p>
Jaga teks isi di
<TextHighlighter>45 sampai 75 karakter</TextHighlighter> per baris, dengan
<TextHighlighter variant="marker" :delay="400"
>tinggi baris sekitar 1,5</TextHighlighter
>.
</p>
<TextHighlighter trigger="manual" :active="active"
>Siap terbit</TextHighlighter
>
<button type="button" @click="active = !active">Ganti</button>
</template><script lang="ts">
import TextHighlighter from "$lib/components/markas/TextHighlighter.svelte";
let active = $state(false);
</script>
<p>
Keep body text at <TextHighlighter>45 to 75 characters</TextHighlighter> per line,
with a
<TextHighlighter variant="marker" delay={400}
>line height near 1.5</TextHighlighter
>.
</p>
<TextHighlighter trigger="manual" {active}>Ready to publish</TextHighlighter>
<button type="button" onclick={() => (active = !active)}>Toggle</button>---
import TextHighlighter from "@/components/markas/TextHighlighter.astro";
---
<p>
Keep body text at <TextHighlighter>45 to 75 characters</TextHighlighter> per
line, with a{" "}
<TextHighlighter variant="marker" delay={400}>line height near 1.5</TextHighlighter>.
</p>
<TextHighlighter trigger="manual">Ready to publish</TextHighlighter>
<button
type="button"
onclick="window.dispatchEvent(new CustomEvent('markas-highlight'))"
>
Highlight
</button>import { Component, signal } from "@angular/core";
import { TextHighlighter } from "./markas/text-highlighter.component";
@Component({
selector: "app-checklist",
imports: [TextHighlighter],
template: `
<p>
Keep body text at
<span markas-text-highlighter>45 to 75 characters</span> per line, with a
<mark markas-text-highlighter variant="marker" delay="400"
>line height near 1.5</mark
>.
</p>
<span markas-text-highlighter trigger="manual" [active]="active()"
>Ready to publish</span
>
<button type="button" (click)="active.set(!active())">Toggle</button>
`,
})
export class Checklist {
active = signal(false);
}background-size, sehingga ikut terpotong rapi di setiap baris (box-decoration-break: clone).trigger="view" memakai IntersectionObserver dengan once dan threshold; hover mendengar link, tombol, label, atau elemen ber-tabindex terdekat, sehingga fokus keyboard juga menggambar sorotan.trigger="manual", React dan Vue mengekspos animate(direction?) dan reset() lewat ref. Blade mendengar event window markas-highlight (dengan direction opsional di detail) dan markas-highlight-reset, dan Alpine.$data(el) mengekspos dua method yang sama. Svelte mengeksposnya lewat bind:this, Astro mendengar event window yang sama dengan Blade dan mengekspos highlight(direction?) dan reset() di elemen markas-text-highlighter, dan Angular mengeksposnya lewat #mark="markasTextHighlighter".as: pasang atribut markas-text-highlighter di elemen yang diinginkan, misalnya span, strong, atau mark.duration dan delay dipasang sebagai transition-duration dan transition-delay pada elemen. Beri setiap frasa delay yang lebih besar untuk menyorot paragraf sesuai urutan baca.view dan auto langsung tampil, dan setiap perubahan terjadi tanpa transisi.| Nama | Tipe | Default | Keterangan |
|---|---|---|---|
as | string | "span" | Elemen yang dirender. Tetap inline, misalnya span, strong, atau mark. Angular: pasang atribut markas-text-highlighter di elemen itu. |
trigger | "view" | "hover" | "auto" | "manual" | "view" | view menggambar saat teks masuk layar, hover mengikuti hover dan fokus keyboard pada link atau tombol terdekat, auto menggambar saat mount, manual mengikuti active. |
direction | "ltr" | "rtl" | "ttb" | "btt" | "ltr" | Arah tumbuh sorotan: kiri ke kanan, kanan ke kiri, atas ke bawah, atau bawah ke atas. |
variant | "solid" | "marker" | "underline" | "gradient" | "solid" | solid mengisi baris, marker menutup 60% bagian bawah seperti stabilo, underline menggambar garis tebal di bawah teks, gradient memadukan dua token. |
color | "warning" | "primary" | "primary-soft" | "success" | "danger" | "warning" | Token warna sorotan, dicampur transparansi agar teks tetap terbaca. |
active | boolean | false | Keadaan sorotan untuk trigger manual. |
once | boolean | true | trigger view: gambar sekali, atau hapus lagi saat teks keluar layar. |
threshold | number | 0.5 | trigger view: seberapa banyak teks harus terlihat, dari 0 sampai 1. |
duration | number | 700 | Milidetik yang dibutuhkan sorotan untuk tergambar. |
delay | number | 0 | Milidetik menunggu sebelum menggambar. Pakai delay bertingkat untuk menyorot paragraf berurutan. |
Komponen animasi lain dengan class yang sama di setiap framework.
MarkasUI gratis dan open source. Secangkir kopi membuatnya terus berjalan.
Kopi Rp 25.000 + biaya layanan QRIS Rp 479 = total Rp 25.479
Traktir kopiPreparing your experience
Switching to English
Menyiapkan tampilan
Beralih ke Bahasa Indonesia