great-monkey-66557
12/14/2024, 2:12 PMbrief-egg-61061
12/14/2024, 2:12 PMbrief-egg-61061
12/14/2024, 2:13 PMgroup
field to split them. However, the exact approach depends on the specific flow you're working with. Let me explain based on the information from the knowledge sources: 1. UI Node Groups: According to the [Ory documentation on UI concepts](https://www.ory.sh/docs/kratos/concepts/ui-user-interface), UI nodes are grouped using the group
key based on the source that generated the node. These groups can include "password", "oidc", "link", "profile", and a "default" group (which typically contains the CSRF token). 2. Using Groups: You can use the node group to filter, re-arrange, or render the nodes differently. The documentation states: "You can use the node group to filter out items, re-arrange them, render them differently - up to you!" 3. Filtering Nodes: In the examples provided for various flows (login, registration, verification, recovery), the filterNodesByGroups
function from the @ory/integrations/ui
package is used to select specific groups of nodes to render. For example: javascript filterNodesByGroups({ nodes: flow.ui.nodes, groups: ["default", "password"], })
This filters the nodes to include only those in the "default" and "password" groups. 4. Rendering Forms: The filtered nodes are then typically mapped to form elements within a single <form>
element. Each node is rendered as an appropriate input element based on its type. 5. Multiple Forms: While the examples generally show a single form, there's an interesting note in the [Github issue about incorrect UI node grouping](https://github.com/ory/kratos/issues/3980). It mentions that for some flows (like verification), the group can be used to create multiple forms that work as expected. However, this doesn't seem to be the case for all flows. In conclusion, while you can use the group
field to organize and filter UI nodes, the standard approach seems to be rendering them within a single form element. If you need to split them into separate forms, you might need to do so manually based on the groups, but be aware that this might not work as expected for all flow types. For the most accurate and up-to-date information on handling complex form scenarios, you might want to consult the [Ory Kratos documentation](https://www.ory.sh/docs/kratos) or reach out to the Ory community for specific use cases.