Skip to content

RFC: Updates to Form API for Kirigami

James Graham requested to merge work/nvrwhere/form_api into master

Disclaimer The expectation is not for this to be merged into the Kirigami-Addons repo but to become the basis for the initial merge into Kirigami itself.

Coming from the discussion here teams/vdg/issues#42

With that out the way this should be seen as an initial set of suggestions from myself which can be discussed and built upon. I'm well aware that some will have opinions on things that either I have no experience with or don't matter to me so feel free to chime in I'm looking for others to cover my blind spots.

Changes

Naming

Not much here but just to establish a convention. I've removed the name card from everything except the FormCard itself (which didn't turn out to be much) with the idea that sometime in the future we may want to move away from cards and this will make that easier.

In effect this is a set of Form components that happen to use a card layout as our design choice.

Leading/Trailing Padding

Basically removed in favour of using the delegate's spacing parameter, following the convention from the main Kirigami/QQC2 ItemDelegate styling we've moved to. This reduces API and I think we should space evenly by default and if people want something different they'll have to do something custom.

FormGroup

Basically standardises a pattern I've used a lot to hopefully make usage easier. It handles the title or spacing if no title automatically.

This also feels like it represents an opportunity to detach the card styling from the API more. The card effectively become just a styling component here. We could actually go harder and make the card private with the group being the entry point instead.

Other

This is obviously just a start point if anyone has any other thoughts I'm happy to work on them.

Questions I can think of:

  • Do we want to ditch Leading and Trailing like main Kirigami/QQC2 has and make people use customs for that
  • How much access do we want to give to the internal components for styling? Again should we make people go custom if they want more control.

@teams/vdg @teams/usability @carlschwan @devinlin @ngraham

Edited by James Graham

Merge request reports