Skip to content

Commit 14bcbc5

Browse files
stevekwon211claude
andcommitted
docs(v0.24.1): property docs for every component + Properties section in the site
A Slint maintainer reviewed v0.24 and flagged that no component exposed property docs — a real gap. Fixed across the catalog in one pass. - Add inline `//` doc comments above every in / in-out / out / callback in all 43 components + 8 blocks. 181 inserted (20 already had docs from manual passes covering Button + the v0.24 menu family). - scripts/build-docs.mjs: parseProps() extracts each declaration with its immediately-preceding doc-comment block; page() renders a Properties section (name + kind tag + Slint type + description) after Usage; TOC gains an entry when present. - Single source of truth — docs live next to the .slint declaration, so the per-component Properties section can never drift from the component. No behavior change in the registry components themselves; .slint comments are no-ops. WASM bundle unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 15b7b94 commit 14bcbc5

56 files changed

Lines changed: 286 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ node /path/to/slintcn/bin/slintcn.mjs add button card input dialog
8181
| **v0.22.1** | **Responsive + polish** — mobile nav drawer for the docs, demo fills the window (no letterbox, no resize flicker), Popover/ContextMenu layout fix, Firefox first-click focus ||
8282
| **v0.23** | **Blocks expansion** — Team (members + roles), Profile (account form), Stats (metrics + traffic bars) → 8 blocks total ||
8383
| **v0.24** | **Menu family** — DropdownMenu (click), HoverCard (hover), Menubar (per-trigger popups), NavigationMenu (active-state nav) → 43 components ||
84+
| **v0.24.1** | **Property docs** — every `in` / `in-out` / `out` / callback has a one-line description; docs site surfaces them in a per-component Properties section ||
8485
| **v1.0** | Game HUD registry expansion — hotbar, reticle, full keycap hints | later |
8586

8687
SaaS-first is a **wedge**, not a ceiling. Once tokens + motion + hover semantics

docs/ROADMAP.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# slintcn roadmap
22

3-
## Planned (v0.23+)
3+
## v0.24.1 — property docs (current)
4+
5+
A Slint maintainer reviewed the v0.24 docs and pointed out that no component
6+
exposed property docs — a real gap. Fix it across the catalog in one pass.
7+
8+
- [x] Inline `//` doc comment above every `in` / `in-out` / `out` property and
9+
`callback` in all 43 components and 8 blocks (181 inserted; 20 already
10+
had docs from manual passes).
11+
- [x] `scripts/build-docs.mjs` parses those comments via `propsOf(item)` and
12+
renders a **Properties** section on each docs page — name, kind tag
13+
(in / in-out / out / callback), Slint type, one-line description.
14+
- [x] TOC ("On this page") gains a Properties entry when the section is present.
15+
- [x] Single source of truth — docs live next to the `.slint` declaration; no
16+
separate metadata file to drift.
17+
18+
## Planned (v0.25+)
419

520
The distribution system (CLI · registry · docs · adoption mode) is at parity
621
with shadcn and ahead in places. The remaining gap is purely **component
@@ -70,7 +85,7 @@ heavy, separate R&D track; the Game/HUD layer is the long-term differentiator.
7085
7186
---
7287

73-
## v0.24 — menu family (current)
88+
## v0.24 — menu family
7489

7590
PopupWindow + the verified preferred-* exposure pattern (from Tooltip/Select/
7691
Popover/ContextMenu) reused for four new overlay/nav primitives:

examples/showcase/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "slintcn-showcase"
3-
version = "0.24.0"
3+
version = "0.24.1"
44
edition = "2021"
55
publish = false
66

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "slintcn",
3-
"version": "0.24.0",
3+
"version": "0.24.1",
44
"description": "Beautiful copy-paste Slint components — shadcn for native UI",
55
"keywords": [
66
"slint",

registry/default/blocks/login.slint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ import { Separator, SeparatorOrientation } from "../components/separator.slint";
77

88
// Minimal centered login block — leaner than SignIn (no remember/forgot row).
99
export component Login inherits Card {
10+
// Two-way bound to the email field.
1011
in-out property <string> email;
12+
// Two-way bound to the password field.
1113
in-out property <string> password;
14+
// Fired on the primary action.
1215
callback submit();
16+
// Fired on the SSO button.
1317
callback sso();
1418

1519
width: 340px;

registry/default/blocks/pricing.slint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { Separator, SeparatorOrientation } from "../components/separator.slint";
77
// Three-tier pricing block. `chosen` (0..2) highlights a plan; `pick(int)`
88
// fires on a CTA. Plan copy is inline — edit freely once installed.
99
export component Pricing inherits Rectangle {
10+
// Two-way; index of the highlighted tier.
1011
in-out property <int> chosen: 1;
12+
// Fired when a tier's CTA is pressed; argument is the tier index.
1113
callback pick(int);
1214

1315
background: transparent;

registry/default/blocks/profile.slint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ import { Separator, SeparatorOrientation } from "../components/separator.slint";
1111
// Save / Cancel. Built from Card + Avatar + Input + Textarea + Button. Bind the
1212
// fields and handle `save()` / `cancel()`.
1313
export component Profile inherits Rectangle {
14+
// Two-way bound to the name field.
1415
in-out property <string> display-name: "Sofia Davis";
16+
// Two-way bound to the email field.
1517
in-out property <string> email: "sofia@acme.dev";
18+
// Two-way bound to the bio textarea.
1619
in-out property <string> bio: "Product designer. Building tools for makers.";
20+
// Fired on Save changes.
1721
callback save();
22+
// Fired on Cancel.
1823
callback cancel();
1924

2025
background: transparent;

registry/default/blocks/settings.slint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ import { Button, ButtonVariant } from "../components/button.slint";
99
// Settings panel block — Tabs over a Card body (Account / Notifications).
1010
// Self-contained tab state; bind the fields + handle `save()`.
1111
export component Settings inherits Rectangle {
12+
// Two-way; active tab (0 = Account, 1 = Notifications).
1213
in-out property <int> tab: 0;
14+
// Two-way bound to the name field.
1315
in-out property <string> display-name;
16+
// Two-way bound to the email field.
1417
in-out property <string> email;
18+
// Two-way; product-news email toggle.
1519
in-out property <bool> notify-product: true;
20+
// Two-way; security-alert email toggle.
1621
in-out property <bool> notify-security: true;
22+
// Fired on the Save button.
1723
callback save();
1824

1925
background: transparent;

registry/default/blocks/sign-in.slint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ import { Button, ButtonVariant } from "../components/button.slint";
88
// Sign-in card block — Card + Label + Input + Checkbox + Button.
99
// Bind email/password and handle the submit / forgot / create callbacks.
1010
export component SignIn inherits Card {
11+
// Two-way bound to the email field.
1112
in-out property <string> email;
13+
// Two-way bound to the password field.
1214
in-out property <string> password;
15+
// Two-way 'remember me' checkbox state.
1316
in-out property <bool> remember: true;
17+
// Fired on the submit button.
1418
callback submit();
19+
// Fired on the 'forgot password' link.
1520
callback forgot();
21+
// Fired on the 'create account' link.
1622
callback create-account();
1723

1824
width: 380px;

registry/default/blocks/stats.slint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ export struct StatMetric { label: string, value: string, delta: string, up: bool
1111
export struct TrafficSource { label: string, percent: float, value: string }
1212

1313
export component Stats inherits Rectangle {
14+
// Top-row metric cards.
1415
in property <[StatMetric]> metrics: [
1516
{ label: "Revenue", value: "$ 42,580", delta: "+12.4%", up: true },
1617
{ label: "Subscriptions", value: "2,340", delta: "+8.1%", up: true },
1718
{ label: "Active now", value: "1,284", delta: "+3.1%", up: true },
1819
{ label: "Churn", value: "1.8%", delta: "−0.4%", up: false },
1920
];
21+
// Traffic-by-source bars under the metrics.
2022
in property <[TrafficSource]> sources: [
2123
{ label: "Direct", percent: 48, value: "12,480" },
2224
{ label: "Organic", percent: 31, value: "8,060" },

0 commit comments

Comments
 (0)