import { Canvas, Meta, ArgTypes } from '@storybook/blocks'; import { ThemeProvider } from 'styled-components'; import * as FormFieldStories from './FormField.stories.tsx'; import Checkbox from '../Checkbox'; import Flex from '../Flex'; import FormField from './'; import Input from '../Input'; import RadioGroup from '../RadioGroup'; import Select from '../Select'; import Textarea from '../Textarea'; import { lightTheme } from '../../../theme/'; import { GlobalStyles } from '../../../theme/GlobalStyles'; # FormField The FormField component displays a single field in a form. ## Importing ```javascript import { FormField } from 'amazon-chime-sdk-component-library-react'; ``` ## Example ### Input Field With layout `stack` and `informational` text. {}} layout="stack" errorText="This is some error text" error={false} infoText="This is some informational text" /> ```jsx {}} layout="stack" errorText="This is some error text" error={false} infoText="This is some informational text" /> ``` With layout `horizontal` and `error` text. {}} layout="horizontal" errorText="This is some error text" error={true} infoText="This is some informational text" /> ```jsx {}} layout="horizontal" errorText="This is some error text" error={true} infoText="This is some informational text" /> ``` ### Select Field {}} value="react" label="Select a framework" layout="stack" errorText="This is some error text" error={false} infoText="This is some informational text" /> ```jsx {}} value="react" label="Select a framework" layout="stack" errorText="This is some error text" error={false} infoText="This is some informational text" /> ``` ### Textarea Field {}} layout="horizontal" errorText="This is some error text" error={false} infoText="This is some informational text" /> ```jsx {}} layout="horizontal" errorText="This is some error text" error={false} infoText="This is some informational text" /> ``` ### Checkbox Field {}} css="margin-right: 1rem" /> {}} /> ```jsx {}} /> {}} /> ``` ### Radio Group Field {}} value="vue" label="Select from the following" errorText="This is some error text" error infoText="This is some informational text" /> ```jsx {}} value="vue" label="Select from the following" errorText="This is some error text" error infoText="This is some informational text" /> ``` ## Props