Skip to content

Commit

Permalink
Merge pull request #5 from wawandco/TL-3
Browse files Browse the repository at this point in the history
docs: added "Customizing options" section
  • Loading branch information
paganotoni authored Jun 14, 2024
2 parents 08e2797 + 8e7be4e commit 7f39837
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

```

#### Customizing
### Customizing

Customizing the form helpers is done by passing different instances of `tailush.Option` to the `FormFn` and `FormForFn` functions. The following example shows a set of options that can be passed to the helpers.

Expand All @@ -55,4 +55,19 @@ Customizing the form helpers is done by passing different instances of `tailush.
...
```

#### Customizing options

The following options are available for the form helpers:

| Option ⚙️ | Component ⚒️ | Default classes ✏️ |
|------------------------------------|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tailush.UseLabelClass()` | `<%= f.Label() %>` | block text-sm font-medium text-gray-700 |
| `tailush.UseInputClass()` | `<%= f.InputTag() %>` | border border-gray-300 rounded-md py-1.5 px-3 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 text-sm font-medium text-gray-700 |
| `tailush.UseCheckboxClass()` | `<%= f.CheckboxTag() %>` | TBD |
| `tailush.UseRadioClass()` | `<%= f.RadioButtonTag() %>` | TBD |
| `tailush.UseFileClass()` | `<%= f.FileTag() %>` | TBD |
| `tailush.UseTextAreaClass()` | `<%= f.TextAreaTag() %>` | border border-gray-300 rounded-md py-1.5 px-3 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 w-full |
| `tailush.UseSelectClass()` | `<%= f.SelectTag() %>` | border border-gray-300 rounded-md py-1.5 px-3 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 w-full py-2 mt-1 text-base sm:text-sm |
| `tailush.UseDateInputClass()` | `<%= f.DateTimeTag() %>` | border border-gray-300 rounded-md py-1.5 px-3 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 text-sm font-medium text-gray-700 |
| `tailush.UseFieldContainerClass()` | Not implemented yet | TBD |
| `tailush.UseErrorClass()` | Not implemented yet | TBD |

0 comments on commit 7f39837

Please sign in to comment.