Text field preview

Interactive preview of the CyberSpec Text field component. A labelled text input in a cut frame, with a hint, an error and an optional icon.

About this preview

Text field belongs to the Fields group in the CyberSpec catalog. It uses @ui-sdk/react/input, @ui-sdk/react/field.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/text-field.json

Example

"use client"

import { Radio } from "lucide-react"
import { TextField } from "@/components/ui/text-field"

export default function TextFieldDemo() {
  return (
    <>
      <TextField label="Handle" prefix="@" defaultValue="sable.quinn" hint="Shown to every crew you run with." autoComplete="off" clearable />
      <TextField
        label="Callsign"
        icon={<Radio />}
        defaultValue="STATIC-07"
        error="Callsign already registered in Lowtide."
        autoComplete="off"
        required
      />
      <TextField label="Relay node" defaultValue="NODE 3F:A2" disabled />
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/text-field-demo.json

Resources

View as Markdown