Hey team! need help! i need to create a UI like a ...
# kobweb
e
Hey team! need help! i need to create a UI like a List of Users. Which componente should i use? a Columns and Row inside?
also im not good at design an css styles? where i can learn more? thanks
r
If you want a vertical layout, go with
Column
. If you want a horizontal layout,
Row
should be your go-to. So I think you have the right idea there. As an Android engineer, I also am on the CSS learning curve. This has been a good resource for me: https://www.w3schools.com/
s
but keep in mind that there is no LazyColumn yet. So depending on how much data you have you need to consider pagination and probably splitting the data. There is already a prototype implementation for a web LazyColumn here https://gitlab.com/opensavvy/ui/compose-lazy-html , but it currently has some recomposition bugs. (#opensavvy)
🫡 1
r
Ah--good point.
s
also for css/js/html docs prefer mdn
e
Cool!! thanks both!
d
(@CLOVIS FYI re: your lazy column implementation project, see @S.’s comment if you weren't aware)
@Eduardo Ruesta in general I would start getting in the habit of trying to figure out how things work in the web world, as in googling "html css list of elements" and looking at some of the results to see if any look good to you
That being said,
Row
and
Column
Kobweb primitives can be pretty good for this.
e
Thanks a lot @David Herman!!
d
You're quite welcome
e
is Any way to convert for example Css code into kobweb style. For example: i have this CSS styile:
Copy code
<style>
#customers {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#customers td, #customers th {
  border: 1px solid #ddd;
  padding: 8px;
}

#customers tr:nth-child(even){background-color: #f2f2f2;}

#customers tr:hover {background-color: #ddd;}

#customers th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #04AA6D;
  color: white;
}
</style>
how do i know this
td
or
th
thing to use in a modifier
s
e
wowww!! like it
r
That looks like a really useful tool, @S.
d
how do i know this
td
or
th
thing to use in a modifier
Generally looks something like this:
Copy code
val CustomerTableStyle = CssStyle {
  cssRule("td") { ... }
  cssRule("th") { ... }
  cssRule("tr:hover") { ... }
}

Table(CustomerTableStyle.toAttrs() {
  ...
}