Components

Col

A themed native col primitive.

Props

Native attributes and event handlers are forwarded to the underlying col element unless handled by the component.

PropTypeDefaultDescription
class string '' Tailwind classes merged with the theme and variants.
element HTMLTableColElement | null null Bindable reference to the underlying DOM element.
inTransition TransitionProps undefined Overrides the opening transition.
isVisible boolean true Bindable visibility state.
outTransition TransitionProps undefined Overrides the closing transition.
theme Theme global theme Optional local theme override.
transition TransitionProps [noopTransition, {}] A Svelte transition function and its options.
variants string[] [] Local variant names or theme references such as button.base.

Default usage

Import Col from sveltewind/components. This example shows its default styling in a usable context.

Plan Starter
+page.svelte
Loading...

Use Col inside Colgroup. Column width and background styling work here; put cell padding and text alignment on Th or Td.

Examples

Theme variants

Every variant available for Col in the built-in themes is shown below.

narrow — Apply the narrow variant.

Plan Starter
+page.svelte
Loading...

wide — Apply the wide variant.

Plan Starter
+page.svelte
Loading...

compact — Apply the compact variant.

Plan Starter
+page.svelte
Loading...

Class overrides

Apply bg-primary-500/10 locally.

Plan Starter
+page.svelte
Loading...

Props and behavior

Change span while retaining the default component styling.

Plan Starter
+page.svelte
Loading...

Content and values

Provide different text, child content, or definitions inside the required parent context.

Your project content Starter
+page.svelte
Loading...