https://kotlinlang.org logo
#fritz2
Title
# fritz2
j

Jonathan Mandel

09/19/2023, 6:21 PM
Hi. I'm attempting to use the fritz2 headless components in my web app. I am tripping over basic problems. If you've solved these, please let me know. First, at the top of the documentation page for each headless element, there is a working example. Where can I see the code for these examples? I suspect that seeing how they did this would answer many of my questions. Second, when I attempt to follow the examples, I end up with unresolved references for things that should be defined as part of the dsl. For example:
Copy code
import dev.fritz2.headless.components.*
import dev.fritz2.headless.foundation.*
popOver{
...
popOverPanel {
placement = Placement.Bottom // Placement unresolved
distance = 20 // distance unresolved
}
}
``````
j

Jilles van Gurp

10/26/2023, 2:07 PM
A bit late to respond. The code samples in the documentation aren't always correct indeed. A workaround is to look at the source code for the demos directly in github. Check the headless-demo directory in there. It has all the demos that are also on the website. And it includes the full tailwind classes as well, which is helpful if you want working code.
j

Jonathan Mandel

11/06/2023, 11:49 PM
Thanks. This is helpful. The code on Github has definitely made it easier for me to use the headless components quickly.
j

Jilles van Gurp

11/07/2023, 9:12 AM
@Christian Hausknecht this seems a big issue with the documentation. I might have a potential solution for you in the form of my little side project https://github.com/jillesvangurp/kotlin4example I wrote that to do the documentation for my kt-search library. Makes it really easy to mix code examples and markdown. Something like that would probably be helpful.
3 Views