UI Field
remocn/fieldFreeComponent
A static layout family for composing labeled form controls, modeled on shadcn's Field: FieldGroup ▸ Field ▸ FieldLabel / FieldControl / FieldDescription. Reads no frame and holds no state — colors come from the resolved theme. FieldControl is a relative fixed-height slot for the absolute remocn-ui controls (Input, Button).
Install it
npx shadcn@latest add https://www.remocn.dev/r/field.jsonSource
1"use client";23import type { CSSProperties, ReactNode } from "react";4import { type RemocnTheme, useRemocnTheme } from "@/lib/remocn-ui";56export interface FieldGroupProps {7 children: ReactNode;8 gap?: number;9 style?: CSSProperties;10}1112export function FieldGroup({ children, gap = 16, style }: FieldGroupProps) {13 return (14 <div style={{ display: "flex", flexDirection: "column", gap, ...style }}>15 {children}16 </div>17 );18}1920export interface FieldProps {21 children: ReactNode;22 gap?: number;23 style?: CSSProperties;24}2526export function Field({ children, gap = 6, style }: FieldProps) {27 return (28 <div style={{ display: "flex", flexDirection: "column", gap, ...style }}>29 {children}30 </div>31 );32}3334export interface FieldLabelProps {35 children: ReactNode;36 theme?: Partial<RemocnTheme>;37 style?: CSSProperties;38}3940export function FieldLabel({ children, theme, style }: FieldLabelProps) {41 const t = useRemocnTheme(theme, "light");42 return (43 <div44 style={{45 fontSize: 13,46 lineHeight: "18px",47 fontWeight: 500,48 letterSpacing: "-0.01em",49 color: t.foreground,50 ...style,51 }}52 >53 {children}54 </div>55 );56}5758export interface FieldDescriptionProps {59 children: ReactNode;60 align?: "start" | "center";61 theme?: Partial<RemocnTheme>;62 style?: CSSProperties;63}6465export function FieldDescription({66 children,67 align = "start",68 theme,69 style,70}: FieldDescriptionProps) {71 const t = useRemocnTheme(theme, "light");72 return (73 <div74 style={{75 fontSize: 12,76 lineHeight: "16px",77 color: t.mutedForeground,78 textAlign: align === "center" ? "center" : "left",79 ...style,80 }}81 >82 {children}83 </div>84 );85}8687export interface FieldControlProps {88 children: ReactNode;89 height?: number;90 style?: CSSProperties;91}9293export function FieldControl({94 children,95 height = 40,96 style,97}: FieldControlProps) {98 return (99 <div style={{ position: "relative", height, ...style }}>{children}</div>100 );101}
What it pulls in
npm packages
Other registry items
Files it writes
More from remocn
All 277 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| UI Accordionaccordion | remocn | Components | Free | 1 dep · 2 files | |
| UI AI Prompt Flowai-prompt-flow | remocn | Components | Free | 1 dep | |
| UI Alert Dialogalert-dialog | remocn | Components | Free | 1 dep · 2 files | |
| Animated Bar Chartanimated-bar-chart | remocn | Components | Free | 1 dep | |
| Animated Line Chartanimated-line-chart | remocn | Components | Free | 1 dep | |
| ASCII Dissolveascii-dissolve | remocn | Components | Free | 2 deps | |
| ASCII Renderascii-render | remocn | Components | Free | 1 dep | |
| Backdropbackdrop | remocn | Components | Free | 1 dep |
