Skip to content

Commit

Permalink
Merge pull request #47 from nvanonim/master
Browse files Browse the repository at this point in the history
Add input fields no result
  • Loading branch information
falghi authored Sep 1, 2020
2 parents 6903b43 + 9b05895 commit 8a43aaf
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions docusaurus/docs/form-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: form-fields
title: Form Fields
---

import {Input} from "jasper-ui"

Form fields are used in forms where input from user is required. They are part of the django form fields implemented on our web. Typically used for registration, login, and signup.

## Dropdown
Expand Down Expand Up @@ -32,3 +34,131 @@ choices={["Finance", "Academy", "Competition"]}
label="Departments"
name="DropdownInput"
/>

## Text Input

### Usage

Text input field is a commonly-defined single-line text field that a user can enter text into. Usually used for username in registration form.

### Code

```jsx
<Input.Text
name="name"
placeholder="text placeholder"
/>
```

<!-- ### Result
<Input.Text name="input-name" placeholder="text placeholder"/> -->

## Radio Input

### Usage

We add Radio input field to display many options with only one radio can be selected at the same time.

### Code

The name parameter must be the same to be detected as one Radio Input.

```jsx
<Input.Radio name="name" value="One">
One
</Input.Radio>
<Input.Radio name="name" value="Two">
Two
</Input.Radio>
<Input.Radio name="name" value="Three">
Three
</Input.Radio>
```

<!-- ### Result
<Input.Radio name="name" value="One">
One
</Input.Radio>
<Input.Radio name="name" value="Two">
Two
</Input.Radio>
<Input.Radio name="name" value="Three">
Three
</Input.Radio> -->

## Number Input

### Usage

Number input define a field for entering a number. Usually used to write down a price, or count.

### Code

```jsx
<Input.Number
name="input-name"
placeholder="number placeholder"
/>
```

<!-- ### Result
<Input.Number name="input-name" placeholder="number placeholder" /> -->

## TextArea Input

### Usage

TextArea input is multi-line text field that usually used to collect user inputs like comments or reviews.

### Code

```jsx
<Input.TextArea
name="input-name"
placeholder="placeholder"
/>
```

<!-- ### Result
<Input.TextArea name="input-name" placeholder="placeholder" /> -->

## Phone Input

### Usage

We implement phone input field similiar to number input with a phone span. As the name said, it is used for a phone number input in a form.

### Code

```jsx
<Input.Phone
name="input-name"
placeholder="phone placeholder"
/>
```

<!-- ### Result
<Input.Phone name="input-name" placeholder="phone placeholder" /> -->

## Checkbox Input

### Usage

Checkbox input is used to display one or more options with the user and the user can select one or more from the options.

### Code

```jsx
<Input.Checkbox name="input-name">
Hello
</Input.Checkbox>
```

<!-- ### Result
<Input.Checkbox name="input-name">Hello</Input.Checkbox> -->

0 comments on commit 8a43aaf

Please sign in to comment.