Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
A field add a label and a message to an input. They are typically used in forms and dialogs.
import { Field, GroupField, Label, HelpMessage, ErrorMessage, ValidMessage, FieldContext, useFieldInputProps } from "@sharegate/orbit-ui";
A field can be composed of Orbit input components or integrate with custom inputs from your app.
For non-group input use a Field
component.
When the input is a group, use a GroupField
instead of a Field
.
A field can show a required state.
A field can be disabled.
A field can take the width of its container.
A field can display a validation state to communicate to the user whether the current value is valid or invalid. Implement your own validation logic in your app and pass either "valid"
or "invalid"
to the field via the validationState
prop.
When valid or invalid, a field can display a specific message by declaring either a ValidMessage
or an ErrorMessage
component.
The example below illustrates how one would validate if the user has entered a valid email and display a message matching the current validation state.
Any input implementing the FieldContext
can integrate with a field component. This is usually done by using the useFieldInputProps
hook.
import { Field } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the field take up the width of its container. false | true | ResponsiveValue<boolean> | - |
required | Whether or not the field show a required state. falsetrue | - |
validationState | Whether the field should display as "valid" or "invalid". "valid""invalid" | - |
import { GroupField } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the field take up the width of its container. false | true | ResponsiveValue<boolean> | - |
required | Whether or not the field show a required state. falsetrue | - |
validationState | Whether the field should display as "valid" or "invalid". "valid""invalid" | - |
import { Label } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
required | Whether or not the label show a required state. falsetrue | - |
import { HelpMessage } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the field take up the width of its container. false | true | ResponsiveValue<boolean> | - |
import { ErrorMessage } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the field take up the width of its container. false | true | ResponsiveValue<boolean> | - |
import { ValidMessage } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the field take up the width of its container. false | true | ResponsiveValue<boolean> | - |