Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added "Customizing options" section #5

Merged
merged 7 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 @@ -45,4 +45,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 |
Loading