Tweak docs

This commit is contained in:
Ben Croker 2025-03-13 13:06:10 -06:00
parent 1cb3d0118a
commit 0ada59177b
No known key found for this signature in database
GPG Key ID: 09D799816F1CF332
4 changed files with 4 additions and 28 deletions

View File

@ -534,24 +534,4 @@ This toggles the values of all signals containing `form.` (to either `true` or `
</button>
</div>
## A Quick Overview
Using [`data-*`](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) attributes, you can introduce reactive state to your frontend and access it anywhere in the DOM and in your backend. You can set up events that trigger requests to backend endpoints that respond with HTML fragment and signal updates.
- Bind element values to signals: `data-bind-foo`
- Set the text content of an element to an expression.: `data-text="$foo"`
- Create a computed signal: `data-computed-foo="$bar + 1"`
- Show or hide an element using an expression: `data-show="$foo"`
- Modify the classes on an element: `data-class-bold="$foo == 1"`
- Bind an expression to an HTML attribute: `data-attr-disabled="$foo == ''"`
- Merge signals into the signals: `data-signals-foo=""`
- Execute an expression on an event: `data-on-click="@get(/endpoint)"`
- Use signals to track in flight backend requests: `data-indicator-fetching`
- Replace the URL: `data-replace-url="'/page1'"`
- Persist all signals in local storage: `data-persist`
- Create a reference to an element: `data-ref-alert`
- Check for intersection with the viewport: `data-intersect="alert('visible')"`
- Scroll programmatically: `data-scroll-into-view`
- Interact with the [View Transition API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API): `data-view-transition="slide"`
View the [attribute plugins reference](/reference/attribute_plugins).

View File

@ -10,10 +10,6 @@ You should use `ctx` sparingly, and only when you can't achieve the desired beha
The current element being processed.
### `ctx.plugin`
The current plugin being processed.
### `ctx.signals`
The signals root object that contains functions for accessing and modifying signals. Signals can be accessed using the `signal` method. The following is the equivalent of an expression containing only `$foo`.

View File

@ -1,4 +1,4 @@
# Datastar API Reference
# Overview
- [Attribute Plugins](#attribute-plugins)
- [Action Plugins](#action-plugins)
@ -95,7 +95,7 @@ View the [SSE events reference](/reference/sse_events).
Officially supported SDKs for generating Datastar-specific SSE events:
- [Clojure](/reference/sdks#clojure)
- [dotnet](/reference/sdks#dotnet)
- [.NET](/reference/sdks#net)
- [Go](/reference/sdks#go)
- [Haskell](/reference/sdks#haskell)
- [Java](/reference/sdks#java)

View File

@ -9,9 +9,9 @@ If you'd like to contribute an SDK, please follow the [Contribution Guidelines](
Clojure [SDK](https://github.com/starfederation/datastar/tree/main/sdk/clojure) and [examples](https://github.com/starfederation/datastar/tree/main/examples/clojure).
_Author: [Jeremy Schoffen](https://github.com/JeremS)_
## dotnet
## .NET
dotnet [SDK](https://github.com/starfederation/datastar/tree/main/sdk/dotnet) and [examples](https://github.com/starfederation/datastar/tree/main/examples/dotnet).
.NET [SDK](https://github.com/starfederation/datastar/tree/main/sdk/dotnet) and [examples](https://github.com/starfederation/datastar/tree/main/examples/dotnet).
_Author: [Greg H](https://github.com/SpiralOSS)_
## Go