Skip to content

@vibe-labs/design-components-inputs

Text input, textarea, checkbox, and radio component tokens, styles, and TypeScript types for the Vibe Design System.

Usage

css
@import "@vibe-labs/design-components-inputs";
ts
import { InputSizes, CheckboxSizes, RadioSizes } from "@vibe-labs/design-components-inputs/types";
import type { InputStyleProps, CheckboxStyleProps, RadioStyleProps } from "@vibe-labs/design-components-inputs/types";

Contents

Tokens (input.css)

Component-specific tokens defined in @layer vibe.tokens. Core sizing tokens (--input-height-*, --input-border, --input-disabled-opacity) are owned by @vibe-labs/design-forms. Field wrapper tokens (--field-*) are owned by @vibe-labs/design-components-core.

Text Input / Textarea

TokenDefaultDescription
--input-bg--surface-baseBackground
--input-color--text-primaryText color
--input-radius--radius-mdBorder radius
--input-font-size-{sm|md|lg}text-sm / text-sm / text-baseFont sizes
--input-px-{sm|md|lg}space-2 / space-3 / space-3Horizontal padding
--input-placeholder-color--text-mutedPlaceholder color
--input-focus-border--color-accentFocus border color
--input-error-border--color-dangerError state border
--input-error-color--color-dangerError state color
--input-success-border--color-successSuccess state border
--input-success-color--color-successSuccess state color
--textarea-min-height5remMinimum textarea height

Checkbox

TokenDefaultDescription
--checkbox-size-{sm|md|lg}0.875rem / 1rem / 1.25remBox dimensions
--checkbox-radius--radius-xsCorner radius
--checkbox-bg--surface-baseUnchecked background
--checkbox-border-color--border-strongUnchecked border
--checkbox-checked-bg--color-accentChecked background
--checkbox-checked-border--color-accentChecked border
--checkbox-check-color--color-accent-contrastCheckmark color

Radio

TokenDefaultDescription
--radio-size-{sm|md|lg}0.875rem / 1rem / 1.25remCircle dimensions
--radio-bg--surface-baseUnchecked background
--radio-border-color--border-strongUnchecked border
--radio-checked-bg--color-accentChecked background
--radio-checked-border--color-accentChecked border
--radio-dot-color--color-accent-contrastInner dot color
--radio-dot-scale0.4Inner dot size relative to circle

Generated Styles

Text Input (input.g.css)

  • input — full-width block input with hover/focus/disabled/readonly states
  • Sizes: sm · md · lg (default: md)
  • Validation states: error · success (border + focus ring color)
  • Slots: input-wrap container with input-leading and input-trailing positions (auto padding via :has())
  • Textarea: auto-height with vertical resize, no-resize and auto-grow modifiers

Checkbox (checkbox.g.css)

  • checkbox — inline-flex label with hidden native input, styled box, animated checkmark
  • States: checked (scale-in animation), indeterminate, hover, focus-visible, disabled, error
  • Sizes: sm · md · lg (default: md)
  • checkbox-group — vertical by default, horizontal modifier available

Radio (radio.g.css)

  • radio — inline-flex label with hidden native input, styled circle, ::after dot
  • States: checked (dot scale-in), hover, focus-visible, disabled, error
  • Sizes: sm · md · lg (default: md)
  • radio-group — vertical by default, horizontal modifier available

TypeScript Types (types/)

ts
InputSizes; // ["sm", "md", "lg"]
InputStates; // ["error", "success"]
CheckboxSizes; // ["sm", "md", "lg"]
RadioSizes; // ["sm", "md", "lg"]

interface InputStyleProps {
  size?: InputSize;
  state?: InputState;
  disabled?: boolean;
}
interface InputWrapStyleProps {}
interface InputLeadingStyleProps {}
interface InputTrailingStyleProps {}
interface TextareaStyleProps {
  noResize?: boolean;
  autoGrow?: boolean;
}
interface CheckboxStyleProps {
  size?: CheckboxSize;
  state?: InputState;
  disabled?: boolean;
}
interface CheckboxGroupStyleProps {
  horizontal?: boolean;
}
interface RadioStyleProps {
  size?: RadioSize;
  state?: InputState;
  disabled?: boolean;
}
interface RadioGroupStyleProps {
  horizontal?: boolean;
}

Dist Structure

FileDescription
index.cssBarrel — imports all files below
input.cssToken definitions
input.g.cssGenerated text input + textarea styles
checkbox.g.cssGenerated checkbox styles
radio.g.cssGenerated radio styles
index.js / index.d.tsTypeScript types + runtime constants

Dependencies

Requires @vibe-labs/design-forms (sizing), @vibe-labs/design-components-core (field wrapper), and @vibe-labs/design (colors, surfaces, spacing, typography, transitions, elevation).

Build

bash
npm run build