-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and Add
form
package docs (#228)
* update FormField doc * update FormSubmit doc * Add new FormSwitch doc * update useTextInput doc
- Loading branch information
Showing
4 changed files
with
84 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Form.Switch (FormSwitch) | ||
|
||
Provides Switch functionality to be used in Forms, it is simply a compound component of the wrapper [FormField](./FormField.md) and controller [SwitchListItem](../../react-native/docs/SwitchListItem.md) combined for easy of use so you don't need to roll your own. | ||
|
||
## Usage | ||
|
||
```jsx {1-3, 8} | ||
import { Form, FormSwitch } from '@react-native-ama/forms'; | ||
|
||
<Form onSubmit={handleSubmit} ref={ref}> | ||
<FormSwitch | ||
label={<Text style={styles.switchText}>I'm a switch</Text>} | ||
style={styles.switchListItem} | ||
value={isSwitchOn} | ||
onValueChange={toggleSwitch} | ||
/> | ||
</Form>; | ||
``` | ||
## Props | ||
FormSwitch accepts all [SwitchListItem](../../react-native/docs/SwitchListItem.mdx#Props) Props |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters