Skip to content
Vy logo
  • Spor
  • Resources
ComponentsUpdated

Input

Input fields are used to let the users type in content.

FigmaGitHub
Version 13.4.0 introduces the size prop, which accepts "sm" or "md" and defaults to "md".

Code examples

<Input label="Name" />

Guidelines

Input is wrapped in a Field component, making it easy to define label, errorText and helperText in the best accessible way.

Props from the component comes from a large selection. Unique for Input is listed under code.

For search, use SearchInput.

For password, use PasswordInput.

For phone, use PhoneNumberInput.

Code

<Input />

import { Input } from "@vygruppen/spor-react";

Props

Name
Type
Required?
Description
disabledboolean
endElementReact.ReactNodeUse the 24px icons for inputs of size "md", and 18px icons for inputs of size "sm"
errorTextReact.ReactNodeDisplay error text for the component
helperTextReact.ReactNodeDisplay helper text for the input
invalidboolean
labelstringA descriptive label
onChangefunctionFunction to handle controlled value of the input
readonlyboolean
requiredboolean
size"sm" | "md"defaults to "md"
startElementReact.ReactNodeUse the 24px icons for inputs of size "md", and 18px icons for inputs of size "sm"
valuestringControlled value of the input
variant"core" | "floating"Defaults to core.