Input

PRO

You can edit 8 Components for free. Get premium for unlimited access.

Displays a form input field or a component that looks like an input field.

Figma

The Input Field is a input field component with support for placeholder animation, validation status, error messages, and an optional icon.

1. Reference

This component inherits props from the Input Field.

Prop
Type
Default
type
default
disabled
success
error
default
state
default
active
filled
default
size
sm
md
lg
lg
iconLeft
true
false
false
iconRight
true
false
false

2. Type

You can edit the type with the default, disabled, success or error parameter.

Image 2.1 : Type default

Image 2.2 : Type success

Image 2.3 : Type disabled

Image 2.4 : Type error

3. Size

You can edit the size with the sm, md or lg parameter.

Image 3.1 : Size lg

Image 3.2 : Size md

Image 3.3 : Size sm

4. State

You can edit the state with the default, active or filled parameter.

Image 4.1 : State default

Image 4.2 : State active

Image 4.3 : State filled

5. iconLeft

You can edit the iconLeft with the true or false parameter.

Image 5.1 : iconLeft false

Image 5.2 : iconLeft true

6. iconRight

You can edit the iconRight with the true or false parameter.

Image 6.1 : iconRight false

Image 6.1 : iconRight true

SwiftUI

The DLInputField is a input field component with support for placeholder animation, validation status, error messages, and an optional icon.

1. Reference

This component inherits props from the Input Field.

Prop
Type
Default
type
.none
.icon
.warning
.success
.error
.none
size
.sm
.md
.lg
.lg
state
.normal
.disabled
.normal
placeholder
"text"

-

text
"text"

-

errorString
"text"

-

IconPressed

-

-

2. Type

You can edit the type with the .none, .icon, .warning, .success or .error parameter.

Input Field
Input Field
Input Field
Input Field
Description
Input Field
Input Field
...

3. Size

You can edit the size with the .sm, .md or .lg parameter.

Input Field
Input Field
Input Field
...

4. State

You can edit the state with the .normal or .disabled parameter.

Input Field
Input Field
...

Jetpack Compose

The InputField is a input field component with support for placeholder animation, validation status, error messages, and an optional icon.

1. Reference

This component inherits props from the Input Field.

Prop
Type
Default
type
InputFieldType.default
InputFieldType.warning
InputFieldType.success
InputFieldType.error
InputFieldType.default
size
InputFieldSize.sm
InputFieldSize.md
InputFieldSize.lg
InputFieldSize.lg
state
InputFieldState.default
InputFieldState.disabled
InputFieldState.default
placeholder
"text"

-

text
"text"

-

2. Type

You can edit the type with the .none, .icon, .warning, .success or .error parameter.

Input Field
Input Field
Input Field
Input Field
Description
Input Field
Input Field
InputField(
size = InputFieldSize.lg,
placeholder = "Input Field",
text = normalText.value,
onValueChange = {
normalText.value = it
}
)

InputField(
size = InputFieldSize.lg,
text = successText.value,
isSuccess = true,
placeholder = "Input Field",
onValueChange = {
successText.value = it }
)

InputField(
size = InputFieldSize.lg,
state = InputFieldState.disabled,
placeholder = "Input Field",
text = disableText.value,
onValueChange = {
disableText.value = it
}
)

InputField(
size = InputFieldSize.lg,
isError = true,
errorText = "Description",
placeholder = "Input Field",
text = errorText.value,
onValueChange = { errorText.value = it }
)

3. Size

You can edit the size with the InputFiledSize.sm, InputFiledSize.md or InputFiledSize.lg parameter.

Input Field
Input Field
Input Field
...

4. State

You can edit the state with the .normal or .disabled parameter.

Input Field
Input Field
...

Preview

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
const DlInput(
  placeholder: 'Input Field',
)
Copy

Usage

Add this code example to your project to see how the component works.

const DlInput(
  placeholder: 'Placeholder',
  iconLeft: DlPlaceholderIcon(),
  iconRight: DlPlaceholderIcon(),
)
Copy

API Reference

DlInput is a fully interactive, token-based text input component with optional side icons, focus/filled behavior, type variants default , error and success , and state-aware helper/placeholder styling.

Prop
Type
Default
placeholder
String
-
type
defaultState
error
success
defaultState
size
lg
md
sm
lg
enabled
bool
true
iconLeft
Widget?
null
iconRight
Widget?
null
errorHelperText
String?
null
controller
TextEditingController?
null
focusNode
FocusNode?
null
onChanged
ValueChanged<String>?
null
keyboardType
TextInputType?
null
textInputAction
TextInputAction?
null
obscureText
bool
false

Examples

Size

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
const Wrap(
  spacing: DlSpacingTokens.p_16,
  runSpacing: DlSpacingTokens.p_16,
  children: [
    DlInput(
      placeholder: 'Input Field',
      size: DlInputSize.lg,
    ),
    DlInput(
      placeholder: 'Input Field',
      size: DlInputSize.md,
    ),
    DlInput(
      placeholder: 'Input Field,
      size: DlInputSize.sm,
    ),
  ],
)
Copy

Variants

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
This field has an error
const Wrap(
  spacing: DlSpacingTokens.p_16,
  runSpacing: DlSpacingTokens.p_16,
  children: [
    DlInput(
      placeholder: 'Input Field',
      type: DlInputType.success,
    ),
    DlInput(
      placeholder: 'Input Field',
      type: DlInputType.error,
      errorHelperText: 'This field has an error',
    ),
  ],
)
Copy

With Icon

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
const Wrap(
  spacing: DlSpacingTokens.p_16,
  runSpacing: DlSpacingTokens.p_16,
  children: [
    DlInput(
      placeholder: 'Input Field',
      iconLeft: DlPlaceholderIcon(),
    ),
    DlInput(
      placeholder: 'Input Field',
      iconRight: DlPlaceholderIcon(),
    ),
  ],
)
Copy

Disabled

Input Field
const DlInput(
  placeholder: 'Input Field',
  enabled: false,
)
Copy

Discover more content

You have questions or need help?

E-Mail

You want to try?

Test for free

Save time and money?

Get Pro Version