Skip to content

Components

Components are reusable native UI you publish to the store and share across apps. With #[kiki::component], a struct becomes a component the OS can resolve, version, and deduplicate — every app using the same version shares one on-disk copy.

The macro

rust
use kiki::prelude::*;

#[kiki::component]
struct Waveform {
    // props / state
}

The macro generates the component implementation and store metadata. Once published, any app can depend on it by URL.

Why components are first-class

In a normal app model, every app bundles its own copy of every widget. On Kiki, a component is a shared, content-addressed artifact:

Three apps, one copy. Update a shared component and every app benefits; storage doesn't balloon with duplicates.

Versioning

Components are versioned. Apps depend on a specific version by URL:

text
kiki://registry.kiki-os.com/components/waveform@1.0.0

Apps on the same version share a copy; apps on different versions keep their own. Bumping a version is a new artifact, resolved independently.

Components vs. schemas

  • A schema defines a data type — the shape of a Track.
  • A component defines UI — how a Track is rendered and interacted with.

They often travel together. Both are published to the store and deduplicated, but they answer different questions: "what is this data?" versus "how do I show it?"

Publish a component the same way as any artifact — see Publishing.

Kiki OS, Desktop & SDK are open source. See Licensing.