Comments (4)
Thoughts:
-
The default renderer is just that - the default. Making a custom renderer with its own particular rules for wrapping/sectioning/etc doesn't require much code. The table renderer, for example, recognizes a :stacked field key which, combined with a nil :label, makes the field display full-width without any label. I actually use the table renderer in most of my own projects, although it does require some custom CSS to make it look nice.
-
You're right in that there's room for improvement in being able to customize the default renderer. Adding hooks of some kind is a good idea.
Perhaps some generic attributes could be distilled out and attached to fields during prep, before rendering (there's actually a prep-field multimethod). The renderer could then check those attributes to determine how to lay things out. E.g.,
- :presentational - whether the field actually collects input or is merely decorative/instructional
- :labeled - whether to display and/or allocate space for a label
- :fieldset-separator
from formative.
Sorry, just went for a short walk and about 30 seconds in to it realised that those sets I mentioned are in the renderers not core. And so are subject to extension and I shouldn't be whinging about those things since I can easily enough do this myself.
I withdraw my question until I attempt to solve it with the tools you've already provided :-)
from formative.
No worries, I appreciate hearing this kind of feedback. In addition to helping make the defaults better/more flexible, it will help shape the documentation - I plan on writing a guide on how to tune/extend Formative.
from formative.
Closing this, although there may be future changes that address the issues raised.
from formative.
Related Issues (20)
- Horizontal Bootstrap 3 Form Layout HOT 2
- dommy is outdated HOT 12
- Is this project dead? HOT 6
- Preventing XSS with Formative HOT 1
- Drop cljx HOT 2
- clojure.spec integration for validation
- Not possible to retain the state of a checkbox on fallback
- Add doc reg. attributes with data prefix will be rendered.
- Add doc/tests for how the input attribute types would be rendered.
- How to keep the docstring and readme in sync? HOT 1
- clojure.core/format is gone HOT 1
- Protocolize the renderer
- Enhance the bootstrap renderer to render check boxes and radio inputs vertically/horizontally based on some option
- formative.dom/show-problems ignores :id of a field
- Make render-problems configurable
- `required` DOM attribute HOT 1
- fixing bootstrap3-horizontal HOT 2
- No credit card field? HOT 1
- It would be nice to have a form builder like ngFormBuilder from Form.io HOT 2
- Can't upload file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formative.