Blok halaman 404 dan error siap pakai dengan enam tata letak: minimal, terbagi, pencarian dengan tautan tersaring, glitch, berilustrasi, dan terminal.
<x-markas.not-found
/>import { NotFound } from "@/components/markas/NotFound";
export default function NotFoundExample() {
return <NotFound />;
}<script setup lang="ts">
import NotFound from "@/components/markas/NotFound.vue";
</script>
<template>
<NotFound />
</template><script lang="ts">
import NotFound from "$lib/components/markas/NotFound.svelte";
</script>
<NotFound />---
import NotFound from "@/components/markas/NotFound.astro";
---
<NotFound />import { Component } from "@angular/core";
import { NotFound } from "./markas/not-found.component";
@Component({
selector: "markas-example",
imports: [NotFound],
template: ` <markas-not-found /> `,
})
export default class NotFoundExample {}Contoh
Terbagi dengan ilustrasi
This page wandered off
We could not find what you were looking for. It may have been renamed or removed.
This page wandered off
We could not find what you were looking for. It may have been renamed or removed.
This page wandered off
We could not find what you were looking for. It may have been renamed or removed.
This page wandered off
We could not find what you were looking for. It may have been renamed or removed.
This page wandered off
We could not find what you were looking for. It may have been renamed or removed.
<x-markas.not-found
variant="split"
title="This page wandered off"
description="We could not find what you were looking for. It may have been renamed or removed."
/>import { NotFound } from "@/components/markas/NotFound";
export default function Example() {
return (
<NotFound
variant="split"
title="This page wandered off"
description="We could not find what you were looking for. It may have been renamed or removed."
/>
);
}<script setup lang="ts">
import NotFound from "@/components/markas/NotFound.vue";
</script>
<template>
<NotFound
variant="split"
title="This page wandered off"
description="We could not find what you were looking for. It may have been renamed or removed."
/>
</template><script lang="ts">
import NotFound from "$lib/components/markas/NotFound.svelte";
</script>
<NotFound
variant="split"
title="This page wandered off"
description="We could not find what you were looking for. It may have been renamed or removed."
/>---
import NotFound from "@/components/markas/NotFound.astro";
---
<NotFound
variant="split"
title="This page wandered off"
description="We could not find what you were looking for. It may have been renamed or removed."
/>Pencarian dan halaman populer
Page not found
Try searching for the page, or pick one of the popular pages below.
Page not found
Try searching for the page, or pick one of the popular pages below.
Page not found
Try searching for the page, or pick one of the popular pages below.
Page not found
Try searching for the page, or pick one of the popular pages below.
Page not found
Try searching for the page, or pick one of the popular pages below.
<x-markas.not-found
variant="search"
description="Try searching for the page, or pick one of the popular pages below."
:links="[
['label' => 'Documentation', 'href' => '/docs'],
['label' => 'Components', 'href' => '/components'],
['label' => 'Pricing', 'href' => '/pricing'],
['label' => 'Changelog', 'href' => '/changelog'],
]"
/>Glitch
Something went wrong
Our server hit an unexpected error. Please try again in a moment.
Something went wrong
Our server hit an unexpected error. Please try again in a moment.
Something went wrong
Our server hit an unexpected error. Please try again in a moment.
Something went wrong
Our server hit an unexpected error. Please try again in a moment.
Something went wrong
Our server hit an unexpected error. Please try again in a moment.
<x-markas.not-found
variant="glitch"
code="500"
title="Something went wrong"
description="Our server hit an unexpected error. Please try again in a moment."
/>import { NotFound } from "@/components/markas/NotFound";
export default function Example() {
return (
<NotFound
variant="glitch"
code="500"
title="Something went wrong"
description="Our server hit an unexpected error. Please try again in a moment."
/>
);
}<script setup lang="ts">
import NotFound from "@/components/markas/NotFound.vue";
</script>
<template>
<NotFound
variant="glitch"
code="500"
title="Something went wrong"
description="Our server hit an unexpected error. Please try again in a moment."
/>
</template><script lang="ts">
import NotFound from "$lib/components/markas/NotFound.svelte";
</script>
<NotFound
variant="glitch"
code="500"
title="Something went wrong"
description="Our server hit an unexpected error. Please try again in a moment."
/>---
import NotFound from "@/components/markas/NotFound.astro";
---
<NotFound
variant="glitch"
code="500"
title="Something went wrong"
description="Our server hit an unexpected error. Please try again in a moment."
/>Berilustrasi
Lost your way?
The page you followed does not exist. Let us point you back on track.
Lost your way?
The page you followed does not exist. Let us point you back on track.
Lost your way?
The page you followed does not exist. Let us point you back on track.
Lost your way?
The page you followed does not exist. Let us point you back on track.
Lost your way?
The page you followed does not exist. Let us point you back on track.
<x-markas.not-found
variant="illustrated"
title="Lost your way?"
description="The page you followed does not exist. Let us point you back on track."
/>import { NotFound } from "@/components/markas/NotFound";
export default function Example() {
return (
<NotFound
variant="illustrated"
title="Lost your way?"
description="The page you followed does not exist. Let us point you back on track."
/>
);
}<script setup lang="ts">
import NotFound from "@/components/markas/NotFound.vue";
</script>
<template>
<NotFound
variant="illustrated"
title="Lost your way?"
description="The page you followed does not exist. Let us point you back on track."
/>
</template><script lang="ts">
import NotFound from "$lib/components/markas/NotFound.svelte";
</script>
<NotFound
variant="illustrated"
title="Lost your way?"
description="The page you followed does not exist. Let us point you back on track."
/>---
import NotFound from "@/components/markas/NotFound.astro";
---
<NotFound
variant="illustrated"
title="Lost your way?"
description="The page you followed does not exist. Let us point you back on track."
/>Terminal
$ cd /docs/setup
404: Page not found
The command could not find that page. Check the address or head back home.
$ cd /docs/setup
404: Page not found
The command could not find that page. Check the address or head back home.
$ cd /docs/setup
404: Page not found
The command could not find that page. Check the address or head back home.
$cd /docs/setup
404: Page not found
The command could not find that page. Check the address or head back home.
$ cd /docs/setup
404: Page not found
The command could not find that page. Check the address or head back home.
<x-markas.not-found
variant="terminal"
path="/docs/setup"
description="The command could not find that page. Check the address or head back home."
/>import { NotFound } from "@/components/markas/NotFound";
export default function Example() {
return (
<NotFound
variant="terminal"
path="/docs/setup"
description="The command could not find that page. Check the address or head back home."
/>
);
}<script setup lang="ts">
import NotFound from "@/components/markas/NotFound.vue";
</script>
<template>
<NotFound
variant="terminal"
path="/docs/setup"
description="The command could not find that page. Check the address or head back home."
/>
</template><script lang="ts">
import NotFound from "$lib/components/markas/NotFound.svelte";
</script>
<NotFound
variant="terminal"
path="/docs/setup"
description="The command could not find that page. Check the address or head back home."
/>---
import NotFound from "@/components/markas/NotFound.astro";
---
<NotFound
variant="terminal"
path="/docs/setup"
description="The command could not find that page. Check the address or head back home."
/>Instalasi
npx markasui@latest add not-foundpnpm dlx markasui@latest add not-foundyarn dlx markasui@latest add not-foundbunx --bun markasui@latest add not-found- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Pasang dependensi:
npm install alpinejs - Salin source komponen di bawah ini ke
resources/views/components/markas/not-found.blade.php.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/components/markas/NotFound.tsx.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/components/markas/NotFound.vue.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/lib/components/markas/NotFound.svelte.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/components/markas/NotFound.astro.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/app/markas/not-found.component.ts.
Pemakaian
<x-markas.not-found
title="Halaman tidak ditemukan"
description="Halaman yang kamu cari tidak ada atau sudah dipindahkan."
home-label="Kembali ke beranda"
back-label="Kembali"
/>
<x-markas.not-found
variant="search"
search-label="Cari halaman"
empty-label="Tidak ada halaman yang cocok"
:links="[
['label' => 'Dokumentasi', 'href' => '/docs'],
['label' => 'Harga', 'href' => '/harga'],
]"
/>Butuh Alpine.js untuk Kembali dan penyaring pencarian.
import { NotFound } from "@/components/markas/NotFound";
<NotFound
title="Halaman tidak ditemukan"
description="Halaman yang kamu cari tidak ada atau sudah dipindahkan."
homeLabel="Kembali ke beranda"
backLabel="Kembali"
/>
<NotFound
variant="search"
searchLabel="Cari halaman"
emptyLabel="Tidak ada halaman yang cocok"
links={[
{ label: "Dokumentasi", href: "/docs" },
{ label: "Harga", href: "/harga" },
]}
/><script setup lang="ts">
import NotFound from "@/components/markas/NotFound.vue";
const links = [
{ label: "Dokumentasi", href: "/docs" },
{ label: "Harga", href: "/harga" },
];
</script>
<template>
<NotFound
title="Halaman tidak ditemukan"
description="Halaman yang kamu cari tidak ada atau sudah dipindahkan."
home-label="Kembali ke beranda"
back-label="Kembali"
/>
<NotFound
variant="search"
search-label="Cari halaman"
empty-label="Tidak ada halaman yang cocok"
:links="links"
/>
</template><script lang="ts">
import NotFound from "$lib/components/markas/NotFound.svelte";
</script>
<NotFound />
<NotFound variant="search" {links} />
<NotFound variant="glitch" code="500" title="Something went wrong" />---
import NotFound from "@/components/markas/NotFound.astro";
---
<NotFound />
<NotFound variant="search" links={links} />
<NotFound variant="glitch" code="500" title="Something went wrong" />Go back dan filter pencarian memakai satu script kecil yang dibundel per halaman.
import { Component } from "@angular/core";
import { NotFound } from "./markas/not-found.component";
@Component({
selector: "app-not-found-page",
imports: [NotFound],
template: `
<markas-not-found />
<markas-not-found variant="search" [links]="links" />
<markas-not-found
variant="glitch"
code="500"
title="Something went wrong"
/>
`,
})
export class NotFoundPage {
links = [
{ label: "Documentation", href: "/docs" },
{ label: "Pricing", href: "/pricing" },
];
}- Blok ini merender h1, jadi pakai sebagai isi utama halaman error.
- Kembali adalah link ke
homeHref. Bila ada riwayat browser, ia memanggilhistory.back(). - Variant split menampilkan ilustrasi di samping teks mulai lebar 36rem (container query) dan di bawahnya di layar sempit.
Props
| Nama | Tipe | Default | Keterangan |
|---|---|---|---|
variant | "minimal" | "split" | "search" | "glitch" | "illustrated" | "terminal" | "minimal" | Tata letak. minimal: kode besar di atas teks. split: teks kiri, SVG geometris kanan mulai lebar 36rem. search: kotak cari di atas tautan yang bisa disaring. glitch: kode dengan efek glitch CSS. illustrated: kode outline bertumpuk dengan kompas. terminal: jendela shell. |
code | string | "404" | Kode status di visual, misalnya 403 atau 500. |
title | string | "Page not found" | Judul (h1) yang menyebut masalahnya. |
description | string | "The page you are looking for does not exist or has been moved." | Penjelasan singkat di bawah judul. |
homeHref | string | "/" | Tujuan link beranda, juga link Kembali bila tidak ada riwayat. |
links | { label, href }[] | [] | Halaman populer. Tampil dan bisa disaring di variant search. |
path | string | "/page" | Path yang diketik setelah cd di variant terminal. |
homeLabel | string | Back to home | Teks link beranda. Isi "Kembali ke beranda" untuk situs berbahasa Indonesia. |
backLabel | string | Go back | Teks link kembali di riwayat. Isi "Kembali" untuk situs berbahasa Indonesia. |
searchLabel | string | Search pages | Label aksesibel dan placeholder kotak cari. Isi "Cari halaman" untuk situs berbahasa Indonesia. |
emptyLabel | string | No pages match your search | Pesan yang diumumkan saat pencarian kosong. Isi "Tidak ada halaman yang cocok" untuk situs berbahasa Indonesia. |
Aksesibilitas
- Blok berupa section yang diberi label oleh judul h1. Kode dekoratif, ilustrasi, dan lapisan glitch memakai aria-hidden.
- Kembali adalah link sungguhan ke homeHref: dengan JavaScript dan riwayat ia memanggil history.back(), selain itu langsung ke beranda.
- Kotak cari punya label aksesibel; pesan hasil kosong ada di live region role=status.
- Lapisan glitch disembunyikan dan kursor berhenti berkedip dengan prefers-reduced-motion.
Komponen terkait
Komponen section lain dengan class yang sama di setiap framework.