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'
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
| CodeInput | Type | Default |
|---|---|---|
size | "sm" | "md" | "lg" |