# Hecrj/composable-forms | Help with custom fields and custom views

**URL:** <https://discourse.elm-lang.org/t/hecrj-composable-forms-help-with-custom-fields-and-custom-views/4375>\
**Category:** Learn\
**Created:** [September 25, 2019, 3:00pm UTC](https://discourse.elm-lang.org/t/hecrj-composable-forms-help-with-custom-fields-and-custom-views/4375 "2019-09-25T15:00:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![derrickbeining](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/derrickbeining/32/5078_2.png) [@derrickbeining](https://discourse.elm-lang.org/u/derrickbeining)\
**Post date:** [September 25, 2019, 3:00pm UTC](https://discourse.elm-lang.org/t/hecrj-composable-forms-help-with-custom-fields-and-custom-views/4375/1 "2019-09-25T15:00:28Z")

</div>

This is question is primarily directed at @hecrj but anyone else who has insight, please feel free to chime in.

Would you mind helping me understand the recommended way to extend `composable-forms`? I want to write custom view code (I’m using [Bulma.io](http://Bulma.io) for css components) and want to be able to add a date-picker field type. I started creating a `Form.View.CustomConfig msg element` but then noticed the note at the top of docs for the `Form.View` module, which says:

> Note: If you are implementing your own custom fields using Form.Base then you cannot use this module. You should use Form.Base.fill to write custom view code. Take a look at the source code of this module for inspiration.

Do I basically have to reimplement the `Form` and `Form.View` modules using my own custom `Field` type using `Form.Base`? It seems like there should be an easier way to extend this library with an additional field type and to use my own view code. Am I missing something or is this the recommended path for what I’m trying to do?

---

<div class="post-metadata">

**Author:** ![hecrj](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/hecrj/32/855_2.png) [@hecrj](https://discourse.elm-lang.org/u/hecrj)\
**Post date:** [September 25, 2019, 4:49pm UTC](https://discourse.elm-lang.org/t/hecrj-composable-forms-help-with-custom-fields-and-custom-views/4375/2 "2019-09-25T16:49:32Z")

</div>

> [@derrickbeining](#):
>
> Do I basically have to reimplement the `Form` and `Form.View` modules using my own custom `Field` type using `Form.Base` ?

Yes, you are right. `Form` and `Form.View` are meant to be introductory modules that can be used to satisfy simple use cases.

Once you are familiar with the library, I recommend developing your own `Form` and `Form.View` modules so you can satisfy any special needs that you may have now and in the future without being tied to a particular set of fields or a specific rendering strategy. This is why every field has its own module and should be easily reusable.

> [@derrickbeining](#):
>
> It seems like there should be an easier way to extend this library with an additional field type and to use my own view code.

Yes, this would be ideal.

As I have mentioned on Slack a couple of times, I think a `Form.Advanced` module with a `customField` type variable could work. However, I am not sure if we should encourage users to use such a solution, as it can potentially force them to implement “empty views” for fields that they may not really need.

I also think a `Form.View.Advanced` module to help users build their own custom renderer is an approach that is worth exploring.

I have not had the time yet to experiment with these approaches, but I am always glad to receive contributions and suggestions. Any efforts toward this goal will be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [October 5, 2019, 4:49pm UTC](https://discourse.elm-lang.org/t/hecrj-composable-forms-help-with-custom-fields-and-custom-views/4375/3 "2019-10-05T16:49:36Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
