NSH / OMARCHY
Omarchy components for Native Shell apps, in Rust and TSX.
Built on nsh-base. Guided by Omarchy Style.
One nshm · Rust and TSX · MIT licensed
Try the components
The TSX gallery, running in your browser on NSH's web backend: the nsh-omarchy crate in WebAssembly, the app in JavaScript. Open gallery ↗ · View example source
Every control a desktop app needs.
Each one is a single Rust component: Rust calls its constructor, TSX imports the same component. The API reference lists every prop, shorthand and event.
Actions
- Button
- IconButton
- ButtonGroup
- Toggle
- ToggleGroup
- Link
Choices
- Checkbox
- Switch
- RadioGroup + Radio
- Slider
- Progress
Fields
- Input
- Textarea
- NumberInput
- OtpInput
- Select
- Combobox
- Calendar
- DatePicker
- ColorPicker
- Field
Navigation
- Tabs + Tab
- Sidebar + SidebarSection + SidebarItem
- Accordion + AccordionItem
- Collapsible
- Pagination
- Menu
- ContextMenu
- MenuItem
- MenuSeparator
- MenuLabel
- TitleBar
Overlays
- Dialog
- AlertDialog
- Sheet
- Popover
- HoverCard
- Tooltip
- Toaster
- toast()
- confirm()
Data
- Table (+ TableHeader, TableBody, TableRow, TableHead, TableCell)
- DataTable
- ListItem
- Tree
- Scrollbar
- ResizablePanelGroup + ResizablePanel
- list() (Rust)
Display
- Card
- Panel
- Separator
- Badge
- Keycap
- Shortcut
- Avatar
- EmptyState
- Icon
- Heading
- Title
- Body
- Caption
- Code
- Markdown
Charts
- LineChart
- AreaChart
- BarChart
- PieChart
Theme
- Omarchy (TSX)
- Theme
- follow_system()
- on_theme_change() (Rust)
Built on nsh-base.
Designed for Omarchy.
Omarchy is more than a palette: square corners, one accent, foreground-tinted state fills, a visible focus border and compact desktop type.
The colors follow the Omarchy theme the system uses and switch live when it changes. Without Omarchy, it draws Tokyo Night or Flexoki Light.
- Native Shell — the platform
- One app in Rust, TSX or both, drawn with each platform's own views on one Rust engine: macOS, Linux, Windows, iOS, Android and the web.
- nsh-base — the behavior
- Focus, keyboard, popups and accessibility, with no look of its own. nsh-omarchy is the presentation on top of it.
- nshm — one package for both languages
- The library is one Rust crate. A Rust app depends on it; a TSX app installs it with
nsh addand imports it from"nsh-omarchy". - Omarchy Style — the design language
- Square geometry, outlined actions and keyboard-first controls, read from the system's Omarchy palette.
Add it to your app.
In an NSH app's directory, add the nshm. It lists the module in nsh.json, and a Rust app also gets the crate in Cargo.toml.
nsh add nsh-omarchyImport the components from "nsh-omarchy". Props and events are the Rust names in camelCase.
import { mount, signal, View } from "nsh";
import { Body, Button, Omarchy, Panel, Switch, Toaster, toast } from "nsh-omarchy";
function App() {
// Draw with the system's Omarchy theme, and follow it as it changes.
Omarchy.followSystem();
const notify = signal(true);
const saved = signal(0);
const save = () => {
saved.set(saved() + 1);
toast({ title: "Settings saved" });
};
return (
<View class="flex-1 gap-4 p-6 bg-background">
<Panel title="Settings">
<Switch label="Notifications" checked={notify()} onChange={({ checked }) => notify.set(checked)} />
<Button label="Save" variant="primary" onPress={save} />
</Panel>
<Body>{`Saved ${saved()} times`}</Body>
<Toaster />
</View>
);
}
mount(() => <App />);nsh add puts the crate in Cargo.toml, or declare it yourself: nsh-omarchy = "0.1". A constructor takes the required content; the rest are builders.
use nsh_core::prelude::*;
use nsh_omarchy::{self as om, tokens};
#[component]
pub fn App() -> impl IntoElement {
// Draw with the system's Omarchy theme, and follow it as it changes.
om::init();
let notify = signal(true);
let saved = signal(0_u32);
view()
.flex_1()
.p(px(tokens::SPACE_6))
.gap(px(tokens::SPACE_4))
.bg(move || tokens::background())
.child(
om::panel("Settings")
.child(
om::switch("Notifications")
.checked(move || notify.get())
.on_change(move |on: &bool| notify.set(*on)),
)
.child(om::button("Save").primary().on_press(move || {
saved.update(|n| *n += 1);
om::toast(om::Toast::new("Settings saved"));
})),
)
.child(om::body(move || format!("Saved {} times", saved.get())))
.child(om::toaster())
}Read the API reference · Read the README · crates.io
nsh-omarchy is free and MIT licensed. If it helps you, please sponsor its development.