Giter Site home page Giter Site logo

Comments (8)

ljharb avatar ljharb commented on August 21, 2024

Correct, it's not exposed on the main entry point.

You can do require('forms/lib/tag'), but it's not really intended to be consumed outside the module.

from forms.

SheaBelsky avatar SheaBelsky commented on August 21, 2024

I suppose my followup question is this: Is there a way to implement section headers or separators for different parts of the same form? The tag functionality didn't work as I thought it might, since it's treated as a form element and not a separate entity. Is there a better way to natively create just a plain div in the middle of different inputs?

from forms.

voxpelli avatar voxpelli commented on August 21, 2024

I achieved such a div through a custom HTML field/widget, only way to do it I think.

Would like to wrap up all of the custom fields I've created at work and make a PR of it so that we can improve the workflow for creating custom fields and widgets, but so far unfortunately haven't had time yet. Is that something that would be of interest?

from forms.

SheaBelsky avatar SheaBelsky commented on August 21, 2024

That would be great, or at least a PR to show how you would create such a widget. I'm at a loss as to how to do it.

from forms.

ljharb avatar ljharb commented on August 21, 2024

Yes, a custom widget would do it.

@voxpelli As far as PRring custom fields into this module, that would depend on the specific module. I'm happy to review a PR but I can't promise any of them would make it in without reviewing them first.

from forms.

SheaBelsky avatar SheaBelsky commented on August 21, 2024

@voxpelli Were you ever able to do a PR? Or could you post your code for the widget here? :)

from forms.

SheaBelsky avatar SheaBelsky commented on August 21, 2024

Sort of a hacky way of doing this, but it's better than nothing. I created a label widget that did not correspond to any other input element, and supplied the content I wanted.

Test_Tag: widgets.label({
    classes: ["form-section-header"],
    content: "User Information"
}),

From there, you can customize the appearance of the header however you want with the form-section-header CSS class. This is effectively what I needed. :)

from forms.

voxpelli avatar voxpelli commented on August 21, 2024

I finally got this released as the html field here: https://github.com/Sydsvenskan/node-forms-utils#fields

from forms.

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.