Component Library - Krate Docs
You're viewing an older version ().
Krate Docs

The @krate/components UI kit.

#Component Library

@krate/components is a shadcn/ui-style set of accessible UI components built on the Krate runtime. To recolour them, override --krate-primary — see Theming Components.

import { Button, Card, CardGrid, Badge, Aside, Steps, Tabs, Tooltip } from '@krate/components';

#Layout & content

ComponentDescription
CardCard container with title and children
CardGridResponsive grid of cards
LinkCardCard that renders as a link
LinkButtonButton that renders as a link
Button<button> with variants, sizes, and asChild
BadgeSmall status/label pill (variants + sizes)
CodeInline/code block with highlighting
AsideCallout / aside box
AlertInline alert with title/description and variants
FileTreeFile tree display (FileTree.Item/FileTree.Folder)
StepsOrdered steps (Steps.Step) with numbered indicators
TabsTabbed panels (Tabs.List/Tabs.Trigger/Tabs.Content)
TableAccessible table (Table.Header/Table.Body/Table.Row/Table.Head/Table.Cell/Table.Caption/Table.Footer)
BreadcrumbBreadcrumb trail (Breadcrumb.List/Breadcrumb.Item/Breadcrumb.Link/Breadcrumb.Page/Breadcrumb.Separator)
PaginationPrev/next + page links (pair with paginationRange)
SkeletonCSS shimmer placeholder

#Form controls

ComponentDescription
CheckboxCheckbox input
RadioGroupGrouped radio inputs
SwitchToggle switch
SliderRange slider
Select / NativeSelectSearchable select / native <select>
InputText input
TextareaMulti-line text input
LabelForm label
FormForm container (Form.Field/Form.Input/Form.Textarea/Form.Submit)
OTPFieldOne-time-password input
PasswordToggleFieldPassword input with visibility toggle
Toggle / ToggleGroupToggle button(s)

#Overlays & navigation

ComponentDescription
AccordionCollapsible sections
CollapsibleCollapsible container
DialogModal dialog
AlertDialogConfirmation dialog
PopoverFloating popover
SheetEdge-anchored dialog/drawer (Sheet.Trigger/Sheet.Content/Sheet.Close/Sheet.Title/Sheet.Description)
CommandFilterable command list / palette
HoverCardCard revealed on hover
DropdownMenuMenu triggered by a button
ContextMenuRight-click menu
MenuBarHorizontal menu bar
NavigationMenuNavigation menu
TooltipHover tooltip
ToastToast notifications

#Feedback & display

ComponentDescription
ProgressProgress indicator
AvatarAvatar image/fallback
SeparatorHorizontal/vertical divider
AspectRatioFixed aspect-ratio box
ScrollAreaStyled scroll container
VisuallyHiddenAccessible hidden content
ToolbarToolbar of controls

#Zero-JS compound components

The interactive components use Krate's compiler-erased CSS signals and a namespaced part API, so they ship no client JavaScript. Compose them with dotted parts and literal values:

<Accordion defaultValue="q1">
  <Accordion.Item>
    <Accordion.Trigger value="q1">Question</Accordion.Trigger>
    <Accordion.Content value="q1">Answer</Accordion.Content>
  </Accordion.Item>
</Accordion>

This applies to Tabs, Accordion/AccordionMultiple, Collapsible, RadioGroup, ToggleGroup/ToggleGroupMultiple, DropdownMenu, Popover, Dialog, AlertDialog, and Sheet. See CSS Scopes for the model.

Switch, Checkbox, Progress, Select, Tooltip, and HoverCard are built on native elements or pure CSS and need no signals at all.

Every compound component is used namespaced — Breadcrumb.List, Table.Row, Steps.Step, Form.Field, FileTree.Folder, Tabs.Trigger, Dialog.Content, and so on. The flat exports (BreadcrumbList, TableRow, …) still work as deprecated aliases.

For data-driven option sets (options known only at runtime), use the native <Select options={…}/> component rather than a scope component.

Last updated: 2026-10-16

Contributors: Noinkin