Code Block
File Tree Tabs
Several example files in one block: the tabs stand in a column on the left, like in an editor, and a radio group switches them without a single line of JavaScript.
What you can change
- the list of files through files
- the folder caption through root
- the initially open file through activeIndex
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/codeblock-015?lang=en&theme=dark
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, zero dependencies, its own palette in the local --vibeui-codeblock-015-* variables. Server component: the state is held by a native radio group, and the right panel is selected by the :has(input[value=...]:checked) selector keyed to the file index, so the selectors do not depend on names and survive any list. The layout is computed from the block's own width: below 30rem the tabs sit in a row on top, beyond that they move into a column on the left — the rules sit on the inner [data-part="shell"], because a container query does not apply to the container itself. The radio buttons are hidden with clip-path rather than display: none so that they stay in the keyboard tab order.
Tags
- code
- tabs
- files
- no-js
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…