Facethome

Facet

Copy-in UI components for roblox-ts, composed from Lattice UI and Vela.

facet-rbxts · v0.4.0 · pre-1.0

Facet gives you UI components for roblox-ts as source files, not as a package. You run one command, and a button.tsx appears in your project with its imports resolved and the theme wired up.

The file is yours from then on. Edit it, cut it down, rename it. Facet never updates it, so nothing overwrites your changes.

The hard parts live in real dependencies, not in the copied file:

  • Lattice UI handles behavior: focus, layering, presence, controlled state and asChild.
  • Vela handles styling. It compiles className into Roblox properties, so a component holds no Color3 or UDim2 of its own.

What you own is the short composition of the two.

Facet publishes a CLI and two small packages. facet-rbxts is the CLI. It fetches components from a hosted registry, so new components don’t need a CLI release. @facet-ui/react-variants is the cva equivalent every component imports. @facet-ui/theme supplies the semantic tokens as a Vela config preset.

The whole model
# One command, and a file appears in your project.
npx facet-rbxts init
npx facet-rbxts add button
# src/shared/ui/button.tsx is now yours — edit it, rename it, delete half of it.
# There is no upgrade that will overwrite it, because there is no upgrade.
Source, not a dependency
The registry is fetched at runtime and copied in. The only Facet code you install is fv() and the theme preset.
Behavior from Lattice, styling from Vela
A Facet component is a Lattice primitive wearing Vela classes. The hard parts stay in packages that are dependencies.
Roles, never ramp steps
Components name bg-primary, never bg-zinc-900. Switching the theme base rethemes every copied file without editing one.

Components

What the registry holds today.

Button
Six variants, four sizes, two recipes — and the one thing asChild does not carry across.
Checkbox
A box that toggles between checked, unchecked and indeterminate.
Label
A line of form-label text. One recipe, no variants.
Radio group
A set of dials where exactly one is checked.
Slider
A draggable thumb on a track, for picking a number in a range.
Switch
An on/off toggle: a track and a thumb that slides between its edges.
Text field
A single-line text input with a label, description and error message.
Textarea
A multi-line text box that grows a line at a time between a minimum and maximum row count.
Toggle group
A row of pressable buttons where one or several can be on.
Dialog
A modal dialog. Needs a provider above your app, and draws its panel inside the primitive's content.
Accordion
Stacked sections that open and close, with a one-pixel rule between items.
Alert
Three parts, one recipe object, and a variant repeated on every part that draws.
Avatar
A circular user image with a text fallback while it loads or if it fails.
Badge
A status pill in four variants, exactly as wide as its label.
Card
A bordered surface with a header, content and footer, in six flat parts.
Kbd
A key cap in a monospace face, as wide as the key name it holds.
Progress
A bar that fills to a value, or sweeps when the end is unknown.
Scroll area
A scrolling viewport with a drawn scrollbar, sized by its parent.
Separator
A one-pixel horizontal or vertical divider.
Skeleton
A muted placeholder block that stands in for content while it loads.
Tabs
A row of triggers that switches between panels. Always pass defaultValue.

Guides

Own the code you copied.

Reference

Every command, field, and token.

Every preview here is the real component.

The frames on the component pages render the actual registry source, lowered by the actual Vela compiler against the actual @facet-ui/theme tokens — the same file facet add would copy into your project, not a web imitation of it. Flip the site's light/dark toggle and the frame reloads a different build, because Facet resolves its colors at compile time and a build carries exactly one mode.

What a preview is not is Roblox. Loom reimplements Roblox layout; it does not run the engine. Studio is still the only place a component is really confirmed.

Scope and status →