using components in DataTable cells #1686
-
My understanding is that svelte doesn't support passing components around as props. This means that we cannot add components into cells of the For that I have 2 questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, there is currently a way to add anything within DataTable cells via the named slot Docs: https://carbon-components-svelte.onrender.com/components/DataTable#slotted-cells A current limitation is the presence of slotted content will not remove the cell's padding, but with css |
Beta Was this translation helpful? Give feedback.
Hello, there is currently a way to add anything within DataTable cells via the named slot
cell
.Docs: https://carbon-components-svelte.onrender.com/components/DataTable#slotted-cells
Example: https://svelte.dev/repl/d5ad7e17e80c4637856e5026a656c0a6?version=3.56.0
A current limitation is the presence of slotted content will not remove the cell's padding, but with css
:has
it should be achievable. Note that:has
isn't yet supported in Firefox.