🎨
Valence
🎨
Valence
  • Overview
    • 👋Welcome to Valence
    • 🏄‍♂️Getting started
  • Core Concepts
    • Responsiveness
    • Color
      • List of colors
      • Color types
    • Polymorphism
  • Valence Core
    • 🏃‍♂️Fundamentals
      • 🎬The ValenceProvider
      • ✍️Using custom fonts
    • 🧱Components
      • 🔘Buttons
        • Button with icon
        • Grid Button
        • Text button
        • Icon button
        • Multi-part button
        • Unstyled button
        • Primitive button
      • ⌨️Inputs
        • Color Picker
        • Text input
        • Text area
        • Number input
        • Select input
        • Switch
        • Slider
        • Range slider
        • Pill selector
        • Input container
        • Dropdown container
      • 🖥️Display
        • Accordion
        • Alert
        • Color Swatch
        • Icon
        • Image
        • Avatar
        • Avatar Group
        • Loader
        • Pill
        • Spoiler
        • Stepper
        • Text
        • Title
      • 🧩Layout
        • App Container
        • Card
        • Flex
          • Flex Center
          • Styled Flex
        • Floating Toolbar
        • Grid
        • Header
        • Overflow Container
        • Space
      • 🗺️Navigation
        • App Nav
      • 🔼Overlays
        • Modal
        • Tooltip
        • Modal background
        • 📰Sheets
          • Bottom Sheet
          • Dynamic Sheet
          • Side Sheet
    • 🪝Hooks
      • UseColorScheme
      • UseColors
      • UseControlledList
      • UseDetectKeyDown
      • UseDisclosure
      • UseFloating
      • UseTooltip
      • UseBreakpoint
      • UseResponsiveProps
    • 🤚Generics
      • Generic button props
      • Generic input props
      • Generic Sheet Props
  • Valence Plugins
    • 🎠Valence Carousel
      • Carousel Child Props
  • Valence Utils
    • ✋Generics
      • Clickable
      • Events
      • Global
      • Grid
      • Layout
      • Overlay
      • Polymorphic
    • 🧜‍♀️Polymorphism
      • Polymorphic Button
      • Polymorphic Layout
      • Polymorphic Text
  • Update Notes
    • 3.0.0
    • 2.7.0
    • 2.6.0
    • 2.5.0
    • 2.4.0
    • 2.3.0
    • 2.2.0
    • 2.1.0
    • 2.0.0
Powered by GitBook
On this page
  • Generic input props
  • Generic text input props
  • Generic text input event props

Was this helpful?

Edit on GitHub
  1. Valence Core
  2. Generics

Generic input props

Last updated: 2.0.0 (18/01/2024)

Generic input props

Extends GenericLayoutProps, accepts a type input T = string.

Property
Type
Description

value

T

The value of this input. Use this in conjunction with onInput or onChange to create controlled inputs.

setValue

Dispatch<SetStateAction<T>>

Sets the value of this input. Use this in conjunction with value to create controlled inputs.

size

ComponentSize

This input's size class. Defaults to theme default.

radius

ComponentSize

This input's radius size class. Defaults to theme default.

variant

FillVariant

This input's styling variant. Defaults to theme default.

disabled

boolean

Whether this input is disabled.

readOnly

boolean

Whether this input is readonly.

required

boolean

Whether this input is required.

autoFocus

boolean

Whether to focus this input on mount.

loading

boolean

Whether this input is loading.

form

string

Associates this input with a form element.

name

string

The name of this input. Submitted with the form as part of a name/value pair.

Generic text input props

Extends GenericInputProps<string>.

Property
Type
Description

icon

ReactNode

An icon to display at the left side of this input.

placeholder

string

Text that appears in this input when it has no value.

minLength

number

The minimum length of this input's value.

maxLength

number

The maximum length of this input's value.

pattern

string

A regex pattern to use for validation.

inputStyle

CSSProperties

Optional styles to apply to the input component.

Generic text input event props

Extends MouseClickEvents, MouseEvents, PointerEvents, FocusEvents, KeyboardEvents.

Property
Type
Description

onInput

(event: React.FormEvent) => void

Fires when the value of this input has been changed.

onChange

(event: React.FormEvent) => void

Fires when the value of this input has been changed. This is functionally the same as onInput because of how React handles these events.

onInvalid

(event: React.FormEvent) => void

Fires when the input's value does not satisfy its validation constraints.

onEnterPress

(event: React.FormEvent) => void

Fires when the enter key is pressed.

PreviousGeneric button propsNextGeneric Sheet Props

Last updated 1 year ago

Was this helpful?

🤚