Skip to content
All blocks

[13] Marketing

Install Section

A package manager switch, the install command with a copy button, and three next-step cards.

1280px

Copy the code

One file with one component and its sample data. It needs @vaneui/ui and its stylesheet, set up as in the installation guide. It passes an onChange handler, so in the Next.js App Router add "use client" at the top of its file.

install.tsx

import { useState } from "react";
import { Card, Code, Col, Container, Grid3, IconButton, Row, Section, SectionTitle, SegmentedControl, SegmentedControlItem,
Text, Title } from "@vaneui/ui";
const commands = {
npm: "npm install @acme/sdk",
pnpm: "pnpm add @acme/sdk",
yarn: "yarn add @acme/sdk",
bun: "bun add @acme/sdk",
};
type Manager = keyof typeof commands;
const managers = Object.keys(commands) as Manager[];
const nextSteps = [
{ href: "/docs/quickstart", title: "Quickstart", text: "Create a project and your first task in five minutes." },
{ href: "/docs/api", title: "API reference", text: "Every endpoint, with a request and a response for each." },
{ href: "/docs/examples", title: "Examples", text: "Starter apps for Next.js, Remix and plain Node." },
];
function CopyIcon() {
return (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V5a2 2 0 0 1 2-2h8" />
</svg>
);
}
function CheckIcon() {
return (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M20 6 9 17l-5-5" />
</svg>
);
}
export function Install() {
const [manager, setManager] = useState<Manager>("npm");
const [copied, setCopied] = useState(false);
const command = commands[manager];
const copy = () => {
navigator.clipboard?.writeText(command).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 2000);
}, () => {});
};
return (
<Section>
<Container itemsStretch>
<Col xl>
<Col className="max-w-2xl">
<SectionTitle>Install the SDK</SectionTitle>
<Text lg secondary>Add Acme to a JavaScript project in one command, then follow a guide.</Text>
</Col>
<Card className="max-w-2xl">
<SegmentedControl aria-label="Package manager" value={manager} onChange={(e) => setManager(e.target.value as Manager)}>
{managers.map((m) => <SegmentedControlItem key={m} value={m}>{m}</SegmentedControlItem>)}
</SegmentedControl>
<Card sm secondary noShadow>
<Row justifyBetween>
<Code transparent overflowXAuto className="min-w-0">{command}</Code>
<IconButton ghost secondary aria-label="Copy command" onClick={copy}>
{copied ? <CheckIcon /> : <CopyIcon />}
</IconButton>
</Row>
</Card>
<Text tag="span" srOnly role="status">{copied ? "Command copied" : ""}</Text>
</Card>
<Grid3>
{nextSteps.map((s) => (
<Card key={s.href} href={s.href}>
<Title>{s.title}</Title>
<Text secondary>{s.text}</Text>
</Card>
))}
</Grid3>
</Col>
</Container>
</Section>
);
}

How it adapts

  • 1024px and up: the command card is at most 672px wide, over three next-step cards.
  • Below 1024px: the next steps go to two columns, then one below 768px.
  • A long command scrolls inside its box, and the copy button stays in view.

How these props work is in responsive page sections without breakpoint classes.

Adapt it with your coding agent

Add the VaneUI MCP server, and your agent reads the component docs and prop tables while it changes the block: the copy, the sample data or the layout.

$ claude mcp add vaneui -- npx -y @vaneui/mcp

Setup for other editors is in the AI assistants guide.