Skip to content

Snippet

One command to copy and paste: an install, a login, a link. The prompt is not copied, and on phones it wraps.

import { Snippet, SnippetSkeleton } from '@sypnia/ui/react'

On this page
  1. Commands to copy
  2. Skeleton
  3. When to use it
  4. For everyone
  5. Props

Commands to copy

Long commands wrap instead of hiding their end.

npm install @sypnia/ui
sypnia login --token $SYPNIA_TOKEN --project storefront --region sa-east-1
Code
import { Snippet } from '@sypnia/ui/react';

// One command to copy. The $ is not copied, so it can be pasted straight into a terminal.
export default function Install() {
  return (
    <div className="sy-stack">
      <Snippet code="npm install @sypnia/ui" label="install command" />
      <Snippet code="sypnia login --token $SYPNIA_TOKEN --project storefront --region sa-east-1" label="login command" />
    </div>
  );
}

Skeleton

The real piece and its skeleton: the same box, so nothing moves when the data arrives.

npx sypnia link prj_8f2c1a9e4b
Code
import { Snippet, SnippetSkeleton } from '@sypnia/ui/react';

// While the command is being prepared (a token, a project id).
export default function Skeleton() {
  return (
    <div className="sy-stack">
      <Snippet code="npx sypnia link prj_8f2c1a9e4b" label="link command" />
      <SnippetSkeleton />
    </div>
  );
}

When to use it

Use it when

  • A single command the person runs as it is.

Do not use it when

  • There are several lines or a file: CodeBlock.
  • It is the result of a command: Terminal.

For everyone

  • The Copy button says what it copies when you give it a label: «Copy install command».

Props

SnippetTypeDefault
coderequired string
label string
prompt string $
  1. Commands to copy
  2. Skeleton
  3. When to use it
  4. For everyone
  5. Props

    Search pages, sections and terms