Skip to content

CodeInput

A short piece of code on one line: a path, an expression, a header. Monospace, with no spelling fixes.

import { CodeInput } from '@sypnia/ui/react'

On this page
  1. A health check path
  2. When to use it
  3. For everyone
  4. Props

A health check path

It must answer 200 when the service works.

Code
import { CodeInput, Field } from '@sypnia/ui/react';

// One line of code: monospace, no spelling fixes.
export default function Path() {
  return <Field label="Health check path" hint="It must answer 200 when the service works."><CodeInput defaultValue="/api/health" /></Field>;
}

When to use it

Use it when

  • Paths, regular expressions, header names.

Do not use it when

  • Several lines: use CodeEditor.

For everyone

  • Spelling and capitalisation fixes are off, so what is typed stays as it is.

Props

CodeInputTypeDefault
size "sm" | "md" | "lg"
  1. A health check path
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms