Closed KevM closed 3 months ago
I was looking for a way to do this, the proposed implementation looks really good, can't wait for it to be merged.
I was looking for a way to do this, the proposed implementation looks really good, can't wait for it to be merged.
I bet @maaslalani will get to it soon. I believe they are catching up from some time off.
Hey @KevM, yes this looks great! Will take a look.
I fixed the lint issue by using their suggestion.
Hey @KevM, thanks so much for this! This will be great in the meantime before we swap out the entire implementation for lipgloss.Table
which should keep a similar API of WithStyleFunc
.
This change ports a customization from lipgloss's table to bubbles' table.
Option WithStyleFunc
This option lets the user set a style selection func during table creation.
This func allows the user to customize the style that will appear for each row and col.
Example
It is tricky to commit a demo due to the examples for bubbles being in the bubbletea repository but this diff to the table example creates the result below where the Mexican row is customized to include the flag colors of Mexico.
Example Diff
Why
I am using the table component and wish to customize the cell look based on the column and the content of the value being displayed. It would be nice to have a struct representing the Cell data as a placeholder for this sort of thing but that would be a much bigger and breaking change.
Cavets
Selected styling seems to be overridden by my customization. This is what the selected Mexico row looks like: