CTA
JS behaviour
Terminal CTA
The developer call-to-action: a terminal that types the install command in front of you with a copy button that ticks, beside a “terminal to deploy” headline, a GitHub star button whose counter really climbs, and a docs link with an icon.
Real scenarios
The component as it is used in a product — not a specimen grid.
For developers
Terminal to deploy, thirty seconds.
The CLI settles in with one command — your first rollout lands before you write a line of config.
$
✓ meridian 2.4.1 — linked to the Frankfurt edge
› run “meridian deploy” to ship your first release
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| command | string | 'npm i -g @meridian/cli' | The command typed character by character, held for a beat, then replayed from the top; its output lands with a green check. |
| type-speed | ms | '55' | Per-character typing speed; under prefers-reduced-motion the whole command lands at once, unanimated. |
| copy | state | 'idle → done' | The copy button writes the command to the clipboard and swaps its icon to a tick for 1.8 seconds. |
| stars | number | '12,840' | The star counter; each click adds a star and clicking again takes it right back. |
Snippet
<div class="cttr" x-data="{
cmd: 'npm i -g @meridian/cli', typed: '', done: false, copied: false,
init() {
if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
this.typed = this.cmd; this.done = true; return;
}
let i = 0;
const t = setInterval(() => {
this.typed = this.cmd.slice(0, ++i);
if (i >= this.cmd.length) { clearInterval(t); setTimeout(() => { this.done = true }, 650); }
}, 55);
},
copy() { navigator.clipboard?.writeText(this.cmd).catch(() => {});
this.copied = true; setTimeout(() => this.copied = false, 1800); },
}" x-init="init()">
<div class="cttr-term" dir="ltr">
<div class="cttr-bar">
<span class="cttr-dot" data-r></span><span class="cttr-dot" data-y></span><span class="cttr-dot" data-g></span>
<span class="cttr-tab">meridian — zsh</span>
<button class="cttr-copy" x-on:click="copy()" x-text="copied ? '✓ copied' : 'copy'"></button>
</div>
<div class="cttr-screen">
<p><span class="cttr-p">$</span> <span x-text="typed"></span><span class="cttr-caret"></span></p>
<p class="cttr-out" x-bind:class="{ 'cttr-on': done }">✓ meridian 2.4.1 — linked to the Frankfurt edge</p>
</div>
</div>
<a class="cttr-docs" href="https://cta.gallery" target="_blank" rel="noopener">CLI docs ↗</a>
</div>
<style>
.cttr-term { border-radius: 14px; background: #0a0c17; color: #f7f7fa; overflow: clip;
box-shadow: 0 24px 48px #0a0c173d; }
.cttr-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem;
background: #141726; border-block-end: 1px solid #2a2d40; }
.cttr-dot { inline-size: .7rem; aspect-ratio: 1; border-radius: 50%; }
.cttr-dot[data-r] { background: #ff7a7a; } .cttr-dot[data-y] { background: #fbbf24; } .cttr-dot[data-g] { background: #10b981; }
.cttr-screen { padding: 1.1rem 1.25rem; font: 500 .85rem/1.9 ui-monospace, monospace; }
.cttr-p { color: #10b981; }
.cttr-caret { display: inline-block; inline-size: .55em; block-size: 1.05em; background: #7df3ff;
vertical-align: text-bottom; animation: cttr-blink 1.1s steps(2) infinite; }
@keyframes cttr-blink { 50% { opacity: 0; } }
.cttr-out { margin: 0; color: #9a9db3; opacity: 0; translate: 0 4px; transition: opacity .3s, translate .3s; }
.cttr-out.cttr-on { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .cttr-caret { animation: none; } .cttr-out { transition: none; } }
</style>
// app/Pages/Developers.jsx — Inertia (React) page; renders the React
// snippet below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import TerminalCta from '@/components/TerminalCta';
export default function Developers() {
return (
<NabuXUIProvider locale="en" linkComponent={Link}>
<main className="nx-page">
<TerminalCta />
</main>
</NabuXUIProvider>
);
}
// TerminalCta.jsx — typed install command, ticking copy, star counter
import { useEffect, useState } from 'react';
import '@nabuxai/ui-core/css';
const CMD = 'npm i -g @meridian/cli';
export default function TerminalCta() {
const [typed, setTyped] = useState('');
const [done, setDone] = useState(false);
const [copied, setCopied] = useState(false);
const [stars, setStars] = useState(12840);
const [starred, setStarred] = useState(false);
// Types the command once; reduced motion lands it whole.
useEffect(() => {
if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
setTyped(CMD); setDone(true); return;
}
let i = 0;
const t = setInterval(() => {
i += 1; setTyped(CMD.slice(0, i));
if (i >= CMD.length) { clearInterval(t); setTimeout(() => setDone(true), 650); }
}, 55);
return () => clearInterval(t);
}, []);
const copy = async () => {
try { await navigator.clipboard.writeText(CMD); } catch { /* demo: tick anyway */ }
setCopied(true); setTimeout(() => setCopied(false), 1800);
};
const star = () => { setStarred(!starred); setStars(stars + (starred ? -1 : 1)); };
return (
<>
<style>{`
.cttr-wrap { display: grid; gap: 2rem; align-items: center; justify-items: center;
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); max-inline-size: 56rem;
font-family: Inter, system-ui, sans-serif; }
.cttr-copy h2 { margin: 0 0 .5rem; font-size: 2rem; letter-spacing: -.02em; color: #141726; }
.cttr-copy p { margin: 0 0 1.25rem; color: #6c7088; }
.cttr-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.cttr-star { display: inline-flex; align-items: center; gap: .5rem; block-size: 2.75rem; padding-inline: 1.1rem;
border-radius: .75rem; border: 1px solid #dfe0e8; background: #fff; color: #141726;
font: 600 .875rem/1 Inter, sans-serif; cursor: pointer;
transition: border-color .18s, translate .18s, background-color .18s; }
.cttr-star:hover { translate: 0 -2px; border-color: #d98a1c; }
.cttr-star[data-on='true'] { border-color: #f4a93c; background: #fff7ea; }
.cttr-star[data-on='true'] svg { fill: #f4a93c; }
.cttr-docs { display: inline-flex; align-items: center; gap: .45rem; block-size: 2.75rem; color: #5647e6;
font: 600 .875rem/1 Inter, sans-serif; text-decoration: none; }
.cttr-term { inline-size: 100%; border-radius: .875rem; background: #0a0c17; color: #f7f7fa;
overflow: clip; box-shadow: 0 24px 48px #0a0c173d; }
.cttr-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: #141726;
border-block-end: 1px solid #2a2d40; }
.cttr-dot { inline-size: .7rem; aspect-ratio: 1; border-radius: 50%; }
.cttr-dot[data-r] { background: #ff7a7a; } .cttr-dot[data-y] { background: #fbbf24; }
.cttr-dot[data-g] { background: #10b981; }
.cttr-tab { margin-inline-start: .35rem; font: 500 .72rem/1 ui-monospace, monospace; color: #6c7088; }
.cttr-copybtn { margin-inline-start: auto; border: none; background: transparent; cursor: pointer;
font: 600 .72rem/1 ui-monospace, monospace; color: #9a9db3; padding: .35rem .6rem;
border-radius: .5rem; transition: color .18s, background-color .18s; }
.cttr-copybtn:hover { color: #f7f7fa; background: #1d2031; }
.cttr-copybtn[data-done='true'] { color: #3ddc97; }
.cttr-screen { min-block-size: 8.75rem; padding: 1.1rem 1.25rem;
font: 500 .85rem/1.9 ui-monospace, 'JetBrains Mono', monospace; }
.cttr-p { color: #10b981; }
.cttr-caret { display: inline-block; inline-size: .55em; block-size: 1.05em; background: #7df3ff;
vertical-align: text-bottom; animation: cttr-blink 1.1s steps(2) infinite; }
@keyframes cttr-blink { 50% { opacity: 0; } }
.cttr-out { margin: 0; opacity: 0; translate: 0 4px; transition: opacity .3s, translate .3s; }
.cttr-out[data-on='true'] { opacity: 1; translate: 0 0; }
.cttr-out b { color: #3ddc97; font-weight: 500; }
.cttr-out span { color: #7df3ff; }
@media (prefers-reduced-motion: reduce) {
.cttr-caret { animation: none; }
.cttr-out, .cttr-star { transition: none; }
}
`}</style>
<div className="cttr-wrap">
<div className="cttr-copy">
<h2>Terminal to deploy, thirty seconds.</h2>
<p>The CLI settles in with one command — your first rollout lands before you write a line of config.</p>
<div className="cttr-row">
<button type="button" className="cttr-star" data-on={starred} aria-pressed={starred} onClick={star}>
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M12 2.7l2.9 5.9 6.5.9-4.7 4.6 1.1 6.4L12 17.4 6.2 20.5l1.1-6.4L2.6 9.5l6.5-.9z" />
</svg>
{stars.toLocaleString('en-US')}
</button>
<a className="cttr-docs" href="https://cta.gallery" target="_blank" rel="noopener">
CLI docs <span aria-hidden="true">↗</span>
</a>
</div>
</div>
<div className="cttr-term" dir="ltr">
<div className="cttr-bar">
<span className="cttr-dot" data-r /><span className="cttr-dot" data-y /><span className="cttr-dot" data-g />
<span className="cttr-tab">meridian — zsh</span>
<button type="button" className="cttr-copybtn" data-done={copied} onClick={copy}>
{copied ? '✓ copied' : 'copy'}
</button>
</div>
<div className="cttr-screen">
<p><span className="cttr-p">$</span> {typed}<span className="cttr-caret" aria-hidden="true" /></p>
<p className="cttr-out" data-on={done}><b>✓</b> meridian 2.4.1 — linked to the Frankfurt edge</p>
<p className="cttr-out" data-on={done}><span>›</span> run “meridian deploy” to ship your first release</p>
</div>
</div>
</div>
</>
);
}
<!-- TerminalCta.vue — typed install command, ticking copy, star counter -->
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue';
import '@nabuxai/ui-core/css';
const CMD = 'npm i -g @meridian/cli';
const typed = ref('');
const done = ref(false);
const copied = ref(false);
const stars = ref(12840);
const starred = ref(false);
let timer: number | undefined;
onMounted(() => {
// Types the command once; reduced motion lands it whole.
if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
typed.value = CMD; done.value = true; return;
}
let i = 0;
timer = window.setInterval(() => {
i += 1; typed.value = CMD.slice(0, i);
if (i >= CMD.length) { clearInterval(timer); setTimeout(() => (done.value = true), 650); }
}, 55);
});
onBeforeUnmount(() => clearInterval(timer));
const copy = async () => {
try { await navigator.clipboard.writeText(CMD); } catch { /* demo: tick anyway */ }
copied.value = true; setTimeout(() => (copied.value = false), 1800);
};
const star = () => { starred.value = !starred.value; stars.value += starred.value ? 1 : -1; };
</script>
<template>
<div class="cttr-wrap">
<div class="cttr-copy">
<h2>Terminal to deploy, thirty seconds.</h2>
<p>The CLI settles in with one command — your first rollout lands before you write a line of config.</p>
<div class="cttr-row">
<button type="button" class="cttr-star" :data-on="starred" :aria-pressed="starred" @click="star">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2.7l2.9 5.9 6.5.9-4.7 4.6 1.1 6.4L12 17.4 6.2 20.5l1.1-6.4L2.6 9.5l6.5-.9z" />
</svg>
{{ stars.toLocaleString('en-US') }}
</button>
<a class="cttr-docs" href="https://cta.gallery" target="_blank" rel="noopener">
CLI docs <span aria-hidden="true">↗</span>
</a>
</div>
</div>
<div class="cttr-term" dir="ltr">
<div class="cttr-bar">
<span class="cttr-dot" data-r></span><span class="cttr-dot" data-y></span><span class="cttr-dot" data-g></span>
<span class="cttr-tab">meridian — zsh</span>
<button type="button" class="cttr-copybtn" :data-done="copied" @click="copy">
{{ copied ? '✓ copied' : 'copy' }}
</button>
</div>
<div class="cttr-screen">
<p><span class="cttr-p">$</span> {{ typed }}<span class="cttr-caret" aria-hidden="true"></span></p>
<p class="cttr-out" :data-on="done"><b>✓</b> meridian 2.4.1 — linked to the Frankfurt edge</p>
<p class="cttr-out" :data-on="done"><span>›</span> run “meridian deploy” to ship your first release</p>
</div>
</div>
</div>
</template>
<style scoped>
.cttr-wrap { display: grid; gap: 2rem; align-items: center; justify-items: center;
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); max-inline-size: 56rem;
font-family: Inter, system-ui, sans-serif; }
.cttr-copy h2 { margin: 0 0 .5rem; font-size: 2rem; letter-spacing: -.02em; color: #141726; }
.cttr-copy p { margin: 0 0 1.25rem; color: #6c7088; }
.cttr-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.cttr-star { display: inline-flex; align-items: center; gap: .5rem; block-size: 2.75rem; padding-inline: 1.1rem;
border-radius: .75rem; border: 1px solid #dfe0e8; background: #fff; color: #141726;
font: 600 .875rem/1 Inter, sans-serif; cursor: pointer;
transition: border-color .18s, translate .18s, background-color .18s; }
.cttr-star:hover { translate: 0 -2px; border-color: #d98a1c; }
.cttr-star[data-on='true'] { border-color: #f4a93c; background: #fff7ea; }
.cttr-star[data-on='true'] svg { fill: #f4a93c; }
.cttr-docs { display: inline-flex; align-items: center; gap: .45rem; block-size: 2.75rem; color: #5647e6;
font: 600 .875rem/1 Inter, sans-serif; text-decoration: none; }
.cttr-term { inline-size: 100%; border-radius: .875rem; background: #0a0c17; color: #f7f7fa;
overflow: clip; box-shadow: 0 24px 48px #0a0c173d; }
.cttr-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: #141726;
border-block-end: 1px solid #2a2d40; }
.cttr-dot { inline-size: .7rem; aspect-ratio: 1; border-radius: 50%; }
.cttr-dot[data-r] { background: #ff7a7a; } .cttr-dot[data-y] { background: #fbbf24; }
.cttr-dot[data-g] { background: #10b981; }
.cttr-tab { margin-inline-start: .35rem; font: 500 .72rem/1 ui-monospace, monospace; color: #6c7088; }
.cttr-copybtn { margin-inline-start: auto; border: none; background: transparent; cursor: pointer;
font: 600 .72rem/1 ui-monospace, monospace; color: #9a9db3; padding: .35rem .6rem;
border-radius: .5rem; transition: color .18s, background-color .18s; }
.cttr-copybtn:hover { color: #f7f7fa; background: #1d2031; }
.cttr-copybtn[data-done='true'] { color: #3ddc97; }
.cttr-screen { min-block-size: 8.75rem; padding: 1.1rem 1.25rem;
font: 500 .85rem/1.9 ui-monospace, 'JetBrains Mono', monospace; }
.cttr-p { color: #10b981; }
.cttr-caret { display: inline-block; inline-size: .55em; block-size: 1.05em; background: #7df3ff;
vertical-align: text-bottom; animation: cttr-blink 1.1s steps(2) infinite; }
@keyframes cttr-blink { 50% { opacity: 0; } }
.cttr-out { margin: 0; opacity: 0; translate: 0 4px; transition: opacity .3s, translate .3s; }
.cttr-out[data-on='true'] { opacity: 1; translate: 0 0; }
.cttr-out b { color: #3ddc97; font-weight: 500; }
.cttr-out span { color: #7df3ff; }
@media (prefers-reduced-motion: reduce) {
.cttr-caret { animation: none; }
.cttr-out, .cttr-star { transition: none; }
}
</style>
<!-- TerminalCta.svelte — typed install command, ticking copy, star counter -->
<script lang="ts">
import { onMount } from 'svelte';
import '@nabuxai/ui-core/css';
const CMD = 'npm i -g @meridian/cli';
let typed = $state('');
let done = $state(false);
let copied = $state(false);
let stars = $state(12840);
let starred = $state(false);
let timer: ReturnType<typeof setInterval> | undefined;
onMount(() => {
// Types the command once; reduced motion lands it whole.
if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
typed = CMD; done = true; return;
}
let i = 0;
timer = setInterval(() => {
i += 1; typed = CMD.slice(0, i);
if (i >= CMD.length) { clearInterval(timer); setTimeout(() => (done = true), 650); }
}, 55);
return () => clearInterval(timer);
});
const copy = async () => {
try { await navigator.clipboard.writeText(CMD); } catch { /* demo: tick anyway */ }
copied = true; setTimeout(() => (copied = false), 1800);
};
const star = () => { starred = !starred; stars += starred ? 1 : -1; };
</script>
<div class="cttr-wrap">
<div class="cttr-copy">
<h2>Terminal to deploy, thirty seconds.</h2>
<p>The CLI settles in with one command — your first rollout lands before you write a line of config.</p>
<div class="cttr-row">
<button type="button" class="cttr-star" data-on={starred} aria-pressed={starred} onclick={star}>
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2.7l2.9 5.9 6.5.9-4.7 4.6 1.1 6.4L12 17.4 6.2 20.5l1.1-6.4L2.6 9.5l6.5-.9z" />
</svg>
{stars.toLocaleString('en-US')}
</button>
<a class="cttr-docs" href="https://cta.gallery" target="_blank" rel="noopener">
CLI docs <span aria-hidden="true">↗</span>
</a>
</div>
</div>
<div class="cttr-term" dir="ltr">
<div class="cttr-bar">
<span class="cttr-dot" data-r></span><span class="cttr-dot" data-y></span><span class="cttr-dot" data-g></span>
<span class="cttr-tab">meridian — zsh</span>
<button type="button" class="cttr-copybtn" data-done={copied} onclick={copy}>
{copied ? '✓ copied' : 'copy'}
</button>
</div>
<div class="cttr-screen">
<p><span class="cttr-p">$</span> {typed}<span class="cttr-caret" aria-hidden="true"></span></p>
<p class="cttr-out" data-on={done}><b>✓</b> meridian 2.4.1 — linked to the Frankfurt edge</p>
<p class="cttr-out" data-on={done}><span>›</span> run “meridian deploy” to ship your first release</p>
</div>
</div>
</div>
<style>
.cttr-wrap { display: grid; gap: 2rem; align-items: center; justify-items: center;
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); max-inline-size: 56rem;
font-family: Inter, system-ui, sans-serif; }
.cttr-copy h2 { margin: 0 0 .5rem; font-size: 2rem; letter-spacing: -.02em; color: #141726; }
.cttr-copy p { margin: 0 0 1.25rem; color: #6c7088; }
.cttr-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.cttr-star { display: inline-flex; align-items: center; gap: .5rem; block-size: 2.75rem; padding-inline: 1.1rem;
border-radius: .75rem; border: 1px solid #dfe0e8; background: #fff; color: #141726;
font: 600 .875rem/1 Inter, sans-serif; cursor: pointer;
transition: border-color .18s, translate .18s, background-color .18s; }
.cttr-star:hover { translate: 0 -2px; border-color: #d98a1c; }
.cttr-star[data-on='true'] { border-color: #f4a93c; background: #fff7ea; }
.cttr-star[data-on='true'] svg { fill: #f4a93c; }
.cttr-docs { display: inline-flex; align-items: center; gap: .45rem; block-size: 2.75rem; color: #5647e6;
font: 600 .875rem/1 Inter, sans-serif; text-decoration: none; }
.cttr-term { inline-size: 100%; border-radius: .875rem; background: #0a0c17; color: #f7f7fa;
overflow: clip; box-shadow: 0 24px 48px #0a0c173d; }
.cttr-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: #141726;
border-block-end: 1px solid #2a2d40; }
.cttr-dot { inline-size: .7rem; aspect-ratio: 1; border-radius: 50%; }
.cttr-dot[data-r] { background: #ff7a7a; } .cttr-dot[data-y] { background: #fbbf24; }
.cttr-dot[data-g] { background: #10b981; }
.cttr-tab { margin-inline-start: .35rem; font: 500 .72rem/1 ui-monospace, monospace; color: #6c7088; }
.cttr-copybtn { margin-inline-start: auto; border: none; background: transparent; cursor: pointer;
font: 600 .72rem/1 ui-monospace, monospace; color: #9a9db3; padding: .35rem .6rem;
border-radius: .5rem; transition: color .18s, background-color .18s; }
.cttr-copybtn:hover { color: #f7f7fa; background: #1d2031; }
.cttr-copybtn[data-done='true'] { color: #3ddc97; }
.cttr-screen { min-block-size: 8.75rem; padding: 1.1rem 1.25rem;
font: 500 .85rem/1.9 ui-monospace, 'JetBrains Mono', monospace; }
.cttr-p { color: #10b981; }
.cttr-caret { display: inline-block; inline-size: .55em; block-size: 1.05em; background: #7df3ff;
vertical-align: text-bottom; animation: cttr-blink 1.1s steps(2) infinite; }
@keyframes cttr-blink { 50% { opacity: 0; } }
.cttr-out { margin: 0; opacity: 0; translate: 0 4px; transition: opacity .3s, translate .3s; }
.cttr-out[data-on='true'] { opacity: 1; translate: 0 0; }
.cttr-out b { color: #3ddc97; font-weight: 500; }
.cttr-out span { color: #7df3ff; }
@media (prefers-reduced-motion: reduce) {
.cttr-caret { animation: none; }
.cttr-out, .cttr-star { transition: none; }
}
</style>