Giter Club home page Giter Club logo

Comments (4)

sohkai avatar sohkai commented on August 26, 2024

After taking a look around, I don't think we need to provide our own Form component.

AFAIK, the design language we're leading with in our own apps has all forms inside the sidepanel (as forms are "actionable"). In these sidebars, there's no additional styling needed to signify there's a form; placing input fields is enough. All a form provides is a state container and some validation logic for these inputs.

I'm a fan of formik, in comparison to other form helpers like react-form and formsy, because of its simplicity and familiar API. It's closely based on the native form and input components and allows you to easily plug in your own custom inputs (rather than forcing you to adhere to their own API or make vendor-specific custom inputs). Our own input components, like those in #67, will work transparently with formik.

I don't see much point in re-exporting it from this package; we can just include formik (or even another form implementation) whenever an app needs a form in its sidepanel. For other app developers, we can add a suggestion in a "tips and tricks" wiki or app tutorial later.

Thoughts @bpierre?

from ui.

bpierre avatar bpierre commented on August 26, 2024

Agree, <form> is behavioral and shouldn’t be provided by Aragon UI if possible.

Our own input components, like those in #67, will work transparently with formik.

formik sounds good! I never tried it, but I remember having some difficulties to make styled components work with react-formal on a project.

If formik becomes our recommended solution to manage forms, maybe we should rename our Field component to something else (e.g. FieldBlock, FieldSection)?

from ui.

sohkai avatar sohkai commented on August 26, 2024

If formik becomes our recommended solution to manage forms, maybe we should rename our Field component to something else (e.g. FieldBlock, FieldSection)?

Maybe LabelledField? The other two sound too "style-derived". Names are hard D:

from ui.

sohkai avatar sohkai commented on August 26, 2024

Closing this, as we're not providing our own form element. Renaming can happen later, if we see the need to recommend formik.

from ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.