Welcome UI logo
FOUNDATIONSCOMPONENTSBLOG650+
10.0.0

Menu

    Actions

    • Button
    • ButtonGroup
    • Close Button
    • Link

    Data display

    • Accordion
    • Avatar
    • Badge
    • Card
    • Swiper
    • Table
    • Tag
    • VisuallyHidden

    Feedback

    • Alert
    • StickyNote

      NEW

    • Toast

    Forms

    • Checkbox
    • DatePicker
    • DateTimePicker
    • Field
    • FileDrop
    • FileUpload
    • Hint
    • InputText
    • Label
    • PasswordInput
    • Radio
    • RadioGroup
    • RadioTab
    • Search
    • Select
    • Slider
    • Textarea
    • TimePicker
    • Toggle

    Icons & logo

    • Icon
    • IconStamp

      NEW

    • Logo
    • VariantIcon
    • WelcomeLoader

    Layout

    • AspectRatio
    • Loader
    • Window

      NEW

    Navigation

    • Breadcrumb
    • DropdownMenu
    • Pagination
    • Stepper

      NEW

    • Tabs

    Overlay

    • Drawer
    • Modal
    • Popover
    • Tooltip

    Typography

    • Text

    Utilities

    • Grid background

Overview

Props

Field

The Field component is a versatile UI element used to create input areas in forms. It typically includes a label and optional helper text or validation messages. This component ensures consistency and accessibility in form design, providing a structured and user-friendly way to capture user input.

Source
Github
import { Field } from 'welcome-ui/Field'
import { InputText } from 'welcome-ui/InputText'
const Example = () => {
return (
<Field hint="A hint" label="Label">
<InputText placeholder="Placeholder" />
</Field>
)
}
export default Example

Examples

We recommend using React-hook-form or Formik with these components. If so, use Field for your fields (as in the examples below). The examples below give you an overview of common props (e.g. size, disable, required etc.)

You can find props for each field component in the other Forms pages.

Label

Use label to add a Label to your field.

You can also use hideLabel to hide it visually but keep it accessible for screen readers, or inline to display it next to the input.

Github

Hint

Use hint to add an hint to your field (it can be overload by a variant - see below)

Github

maxLength

Use maxLength to display a character count below your field. It takes an object with count and max properties. This property also passes maxLength to the input component to limit the number of characters that can be entered.

Github

Variants

Use warning, error, or success properties to add a variant status on your fields. The label, hint or border color are set by magic 🪄

Github

Disabled

Add disabled on Field component

Github

Required

Add required on Field component

Github

Refs

Github
Date time pickerFile drop

On this page

  • Definition
  • Examples
    • Label
    • Hint
    • maxLength
    • Variants
    • Disabled
    • Required
    • Refs
Made with by
Welcome to the jungle logo

Documentations

  • Foundations
  • Components
  • Source code

Updates

  • Releases
  • Issues

Community

  • Github
  • Twitter
  • Medium
  • Jobs