Data Grid

Density Switch

A grid with a density switch: compact, regular and roomy change the padding, the type size and the row height at once, and the roomy setting reveals a note.

What you can change

  • the line under the toolbar through caption
  • the initial density through density: compact, regular or roomy
  • the panel heading through heading and the switch caption through densityLegend

A link for your AI agent: preview, code and instructions.

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.
AI
1Pick it here

put this on the home page as the hero:

https://vibeui.ru/c/datagrid-027?lang=en&theme=dark

2Paste into the chat
3Get it in your project

Not sure where to paste it? Step-by-step guide

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

Loading…

For developers

The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.

Technical notes

The component is self-contained: one file, no dependencies, the palette in --vibeui-datagrid-027-*. A client component: useState holds the mode, which goes into data-density on the root; three variables — the padding, the type size and the leading — are overridden by a single selector per mode, so no new rules for the cells are needed. Density here is not only about padding: in the roomy mode a second line with a note is shown, which the compact mode does not have — otherwise "roomy" is just air. The switch is assembled from radio buttons inside a fieldset: this is a choice of one out of three, not three independent buttons. The current state is duplicated in text with role=status. The theme comes from the surrounding color-scheme through light-dark(): by default the table lays no panel under itself, it sits directly on the page background and darkens along with it.

Tags

  • datagrid
  • density
  • settings
  • table
Component source

The same file your agent installs. Here in case you would rather copy it by hand.

Loading…