Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom table header / table items content? #354

Open
divStar opened this issue Aug 22, 2022 · 3 comments
Open

Custom table header / table items content? #354

divStar opened this issue Aug 22, 2022 · 3 comments

Comments

@divStar
Copy link

divStar commented Aug 22, 2022

Hi there! The UI framework is very pretty, very easy to use (I am using it with a modern SvelteKit project at the moment at home) and honestly I am liking it so far 👍 .

However: I am currently working on a calendar component, because the existing ones do not meet my needs. I e.g. want to put additional data into each cell (e.g. a list of TODOs or a customly drawn line in various colors, showing off projects, that I have worked on on that date).

Going by the Table docs, there currently seems to be no way to add anything besides a string or a number to each table cell (and header), right? I'd probably need to add a component.

Are there plans to extend the functionality to the Table component?

@illright
Copy link
Owner

Hey, thanks for the kind words.

There is a way to add a component to the table, actually. Look into the named slots on the table. They receive slot props to help you identify the cell, and you can render whichever content you see fit

@divStar
Copy link
Author

divStar commented Sep 12, 2022

I somehow couldn't make it. What I wanted to do is e.g. have a table with the first row containing week day names and the first column contain the actual week number and then the contents be something like the day from the date (e.g. 31 from the 31st of January) and then a custom element displaying additional information beneath it.

Sadly it seemed neigh impossible to provide the data and rows in a manner, that would end up displaying the data as I wanted it, so I ended up creating the table (grid) myself using some of the variables and styles from this UI framework:
grafik

It'd still be much nicer if I could've reused the Table component of the framework (I do not really care that much about the styling being 100% the same as in the screenshot, I just wish there was a way to display that bar + text there). However: I was not able to use the information headers and cells information provided by the Table docs.

@illright
Copy link
Owner

I didn't exactly understand what prevented you from accomplishing your goal. Would you like to elaborate on why your implementation didn't work out with the Table component as it is and what can we do to remedy it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants