---
title: "Svelte Kit Components (shadcn-svelte)"
description: "Common form components, the confirm dialog, shadcn-svelte primitives, icons, toasts and app shell components in the Svelte kit, with a small usage example."
---
# Components
## Overview
You'll find the components in `resources/js/components`, split into these folders:
| Folder | What it holds |
| --- | --- |
| `components/common/` | The kit's own form kit: `Common*` inputs, buttons, tooltip, icon and `ConfirmDialog` |
| `components/ui/` | shadcn-svelte primitives built on bits-ui (`button`, `dialog`, `select`, `sidebar`, …) |
| `components/` | App shell and feature components (`AppHead`, `AppSidebar`, `AppHeader`, `UserMenuContent`, `ErrorStatus`, …) |
When you build a page, reach for the `Common*` components before anything else. They handle the label, the `id`, the `aria-*` attributes and the error message, which keeps your pages short and makes them all look the same.
::: tip
If a component is only used by one page, put it in a `Partials/` folder next to that page (for example `pages/tenants/Partials/DomainModal.svelte`) rather than in `components/`.
:::
## Common form components
Every file listed here sits in `components/common/`.
| Component | Purpose |
| --- | --- |
| `CommonInput` | Text-like input (`type` defaults to `'text'`) |
| `CommonPassword` | Password input with a show/hide toggle |
| `CommonTextarea` | Textarea with `rows` (default `3`) and `maxlength` |
| `CommonSelect` | shadcn-svelte `Select` with a label; exports the `SelectOption` type |
| `CommonRadio` | Radio group built from `SelectOption[]` |
| `CommonCheckbox` | Checkbox with label; binds `checked` |
| `CommonLabel` | Label with required asterisk, "Optional" tag and hint text |
| `CommonError` | Error message in a `role="alert"` paragraph; renders nothing when empty |
| `CommonButton` | `Button` primitive with a `loading` spinner state |
| `CommonButtonRow` | Save / Discard bar for edit forms |
| `CommonTooltip` | Tooltip that passes trigger props to its `children` snippet |
| `ConfirmDialog` | Global confirm modal, opened with `useConfirmDialog()` (see below) |
A few things all the input components have in common:
- They accept `label`, `error`, `required` and `disabled`. If you leave out the `id`, they make one up.
- Any other attributes (`autofocus`, `tabindex`, `data-test`, …) go straight to the underlying element.
- Inside an Inertia `