This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from tabler/form-shorthand-props
Form components, features and fixes
- Loading branch information
Showing
18 changed files
with
283 additions
and
66 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 |
---|---|---|
@@ -1 +1,7 @@ | ||
|
||
```jsx | ||
<Form onSubmit={(event) => console.log(event.target.name + 'clicked')}> | ||
<Form.Input name='username' label='Username' placeholder='Enter Username' /> | ||
<Button type='submit' value='Submit' /> | ||
</Form> | ||
``` |
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
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 |
---|---|---|
@@ -1,13 +1,39 @@ | ||
### Icon input | ||
```jsx | ||
<Form.Input name='username' placeholder='Username' /> | ||
``` | ||
|
||
#### Input Label | ||
Render an input wrapped in a Form.Group with a Label | ||
|
||
```jsx | ||
<Form.Input label='username' placeholder='Username' /> | ||
``` | ||
|
||
is the same as | ||
|
||
```jsx | ||
<Form.Group> | ||
<Form.Label>Username</Form.Label> | ||
<Form.Input placeholder="Username" /> | ||
</Form.Group> | ||
``` | ||
|
||
#### Input Icons | ||
|
||
```jsx | ||
<Form.Group label="Input Icon"> | ||
<Form.Input icon="user" placeholder="Username" /> | ||
</Form.Group> | ||
``` | ||
|
||
#### Append the Icon | ||
|
||
```jsx | ||
<Form.Group label="Input Icon"> | ||
<Form.Input | ||
icon="search" | ||
placeholder="Search for..." | ||
position="append" | ||
className={"mb-3"} | ||
/> | ||
<Form.Input icon="user" placeholder="Username" /> | ||
</Form.Group> | ||
``` |
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,20 @@ | ||
```jsx | ||
<Form.InputGroup append={<Button | ||
RootComponent="a" | ||
color="primary" | ||
href="http://www.google.com" | ||
>Go! | ||
</Button>}> | ||
<Form.Input placeholder="Search for..." /> | ||
</Form.InputGroup> | ||
``` | ||
|
||
```jsx | ||
<Form.InputGroup inputProps={{placeholder: "Search for..."}} append={<Button | ||
RootComponent="a" | ||
color="primary" | ||
href="http://www.google.com" | ||
>Go! | ||
</Button>} /> | ||
``` | ||
|
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,14 @@ | ||
```jsx | ||
<Form.InputGroup> | ||
<Form.Input placeholder="Search for..." /> | ||
<Form.InputGroupAppend> | ||
<Button | ||
RootComponent="a" | ||
color="primary" | ||
href="http://www.google.com" | ||
> | ||
Go! | ||
</Button> | ||
</Form.InputGroupAppend> | ||
</Form.InputGroup> | ||
``` |
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,14 @@ | ||
```jsx | ||
<Form.InputGroup> | ||
<Form.InputGroupPrepend> | ||
<Button | ||
RootComponent="a" | ||
color="primary" | ||
href="http://www.google.com" | ||
> | ||
Go! | ||
</Button> | ||
</Form.InputGroupPrepend> | ||
<Form.Input placeholder="Search for..." /> | ||
</Form.InputGroup> | ||
``` |
Oops, something went wrong.