diff --git a/guide/animation/animatable-modifiers.md b/guide/animation/animatable-modifiers.md
index 213425d..220f14b 100644
--- a/guide/animation/animatable-modifiers.md
+++ b/guide/animation/animatable-modifiers.md
@@ -4,10 +4,14 @@
This section is incomplete.
:::
-### See also
+## See also
- `ElementaryUI.View.opacity(_:)`
- `ElementaryUI.View.offset(x:y:)`
- `ElementaryUI.View.rotationEffect(_:anchor:)`
+- `ElementaryUI.View.scaleEffect(_:anchor:)`
+- `ElementaryUI.View.blur(radius:)`
+- `ElementaryUI.View.saturation(_:)`
+- `ElementaryUI.View.brightness(_:)`
diff --git a/guide/animation/animate-layout-and-css.md b/guide/animation/animate-layout-and-css.md
index 1118a34..53a364f 100644
--- a/guide/animation/animate-layout-and-css.md
+++ b/guide/animation/animate-layout-and-css.md
@@ -1,11 +1,11 @@
# Animate changes to layout and CSS values
-ElementaryUI comes with a _**FLIP**_ animation system that enables automatic
+ElementaryUI comes with a **FLIP** animation system that enables automatic
animation of essentially any visible change to your view's layout or appearance.
**FLIP** (First, Last, Invert, Play) is a technique that captures the geometry or appearance of an element before and after a change, then animates the difference. A view can opt-in to FLIP handling with modifiers, and any [transaction with an animation](transactions-and-animations.md#transactions) will be animated accordingly.
-### Animate layout containers
+## Animate layout containers
You can enable layout FLIP-handling on any [HTML element](../dom-interaction/html-elements.md) by applying the `ElementaryUI.View.animateContainerLayout(animateContainerSize:)` modifier.
diff --git a/guide/animation/custom-animations.md b/guide/animation/custom-animations.md
index 1a5aab2..8eac7ec 100644
--- a/guide/animation/custom-animations.md
+++ b/guide/animation/custom-animations.md
@@ -4,7 +4,7 @@
This section is incomplete.
:::
-### See also
+## See also
- `ElementaryUI.Animatable`
- `ElementaryUI.CustomAnimation`
diff --git a/guide/animation/phase-animator.md b/guide/animation/phase-animator.md
index 83f13f9..9b63ac6 100644
--- a/guide/animation/phase-animator.md
+++ b/guide/animation/phase-animator.md
@@ -26,6 +26,6 @@ Here, `.phaseAnimator` animates an existing view. Each click adds a heart and ma
## Choosing animations
-Use the `animation` closure to choose an `ElementaryUI.Animation` for each phase, including the return to the first phase.
+Use the `animation` closure to choose an `ElementaryUI.Animation` for the transition into each phase, including the return to the first phase.
Omit the closure to use the default animation, or return `nil` for a step without animation.
diff --git a/guide/animation/transitions.md b/guide/animation/transitions.md
index 574197a..9e6d58a 100644
--- a/guide/animation/transitions.md
+++ b/guide/animation/transitions.md
@@ -4,7 +4,7 @@
This section is incomplete.
:::
-### See also
+## See also
- `ElementaryUI.Transition`
- `ElementaryUI.View.transition(_:animation:)`
diff --git a/guide/dom-interaction/handling-events.md b/guide/dom-interaction/handling-events.md
index 3cdb745..cc01ee9 100644
--- a/guide/dom-interaction/handling-events.md
+++ b/guide/dom-interaction/handling-events.md
@@ -6,6 +6,15 @@ ElementaryUI provides on*Event* modifiers to handle DOM events like clicks, key
This section is incomplete.
:::
+## Available events
+
+- `ElementaryUI.View.onClick(_:)`
+- `ElementaryUI.View.onMouseDown(_:)`
+- `ElementaryUI.View.onMouseMove(_:)`
+- `ElementaryUI.View.onMouseUp(_:)`
+- `ElementaryUI.View.onKeyDown(_:)`
+- `ElementaryUI.View.onInput(_:)`
+
## Example
Use `ElementaryUI.View.onMouseMove(_:)` to track mouse movement:
diff --git a/guide/dom-interaction/html-elements.md b/guide/dom-interaction/html-elements.md
index cc5edd7..d8975be 100644
--- a/guide/dom-interaction/html-elements.md
+++ b/guide/dom-interaction/html-elements.md
@@ -17,13 +17,13 @@ Build up your HTML using the provided lower-case types like `div`, `p`, `button`
```swift
@View
struct MyView {
- var body: some View {
- div {
- h1 { "Title" }
- p { "Paragraph text" }
- button { "Click me" }
+ var body: some View {
+ div {
+ h1 { "Title" }
+ p { "Paragraph text" }
+ button { "Click me" }
+ }
}
- }
}
```
@@ -33,14 +33,14 @@ HTML attributes like `class`, `style`, and `id` are typically set via the elemen
```swift
div(.class("container"), .id("main")) {
- p(.style(["color": "crimson"])) {
- "Styled text"
- }
- input(.type(.text), .placeholder("Enter something"))
+ p(.style(["color": "crimson"])) {
+ "Styled text"
+ }
+ input(.type(.text), .placeholder("Enter something"))
}
```
-Attributes can also be altered by using the modifier syntax, this allows for easy handling of conditional attributes.
+Attributes can also be altered by using the modifier syntax, which allows for easy handling of conditional attributes.
```swift
div {
diff --git a/guide/dom-interaction/input-bindings.md b/guide/dom-interaction/input-bindings.md
index 6023dec..68d3902 100644
--- a/guide/dom-interaction/input-bindings.md
+++ b/guide/dom-interaction/input-bindings.md
@@ -4,8 +4,8 @@
This section is incomplete.
:::
-### See also
+## See also
- `ElementaryUI.View.bindValue(_:)`
- `ElementaryUI.View.bindChecked(_:)`
-- [Controlling Focus](/guide/dom-interaction/controlling-focus)
+- [Controlling Focus](controlling-focus.md)
diff --git a/guide/essentials/application.md b/guide/essentials/application.md
index ff38f84..9f54c13 100644
--- a/guide/essentials/application.md
+++ b/guide/essentials/application.md
@@ -9,18 +9,18 @@ Mounting an application means **attaching its rendered output to the DOM**. Afte
```swift
@main
struct MyApp {
- static func main() {
- Application(ContentView())
- .mount(in: .body)
- }
+ static func main() {
+ Application(ContentView())
+ .mount(in: .body)
+ }
}
```
-The `ElementaryUI.Application.mount(in:)` supports arbitrary CSS selectors. You can mount an application into any parent element.
+The `ElementaryUI.Application.mount(in:)` method supports arbitrary CSS selectors. You can mount an application into any parent element.
```swift
Application(ContentView())
- .mount(in: "#app")
+ .mount(in: "#app")
```
## Multiple applications
@@ -30,13 +30,13 @@ You can create and mount multiple applications on the same page. This is useful
```swift
@main
struct IslandsApp {
- static func main() {
- Application(Navigation())
- .mount(in: "#nav-container")
+ static func main() {
+ Application(Navigation())
+ .mount(in: "#nav-container")
- Application(CommentsSection())
- .mount(in: "#comments-island")
- }
+ Application(CommentsSection())
+ .mount(in: "#comments-island")
+ }
}
```
diff --git a/guide/essentials/environment.md b/guide/essentials/environment.md
index cc673a8..8259126 100644
--- a/guide/essentials/environment.md
+++ b/guide/essentials/environment.md
@@ -9,7 +9,7 @@ This sets up a typed environment key with a default value.
```swift
extension EnvironmentValues {
- @Entry var themeColor: String = "blue"
+ @Entry var themeColor: String = "blue"
}
```
@@ -17,7 +17,7 @@ You can then provide a value using the `ElementaryUI.View.environment(_:_:)` mod
```swift
MyView()
- .environment(#Key(\.themeColor), "rebeccapurple")
+ .environment(#Key(\.themeColor), "rebeccapurple")
```
::: info NOTE
@@ -26,47 +26,47 @@ Since key paths cannot be used in Embedded Swift, you must wrap them with the `E
## Using environment values in a view
-Access environment values in your `ElementaryUI.View` using the `ElementaryUI.Environment` property wrapper.
+Access environment values in your `ElementaryUI.View` using the [`Environment`](https://swiftpackageindex.com/elementary-swift/elementary-ui/documentation/elementaryui/environment-swift.struct) property wrapper.
```swift
@View
struct Greeting {
- @Environment(#Key(\.themeColor)) var color
+ @Environment(#Key(\.themeColor)) var color
- var body: some View {
- p(.style(["color": color])) { "Hello" }
- }
+ var body: some View {
+ p(.style(["color": color])) { "Hello" }
+ }
}
```
::: info NOTE
-`ElementaryUI.Environment` will only work in types annotated with the `ElementaryUI.@View` macro.
+[`Environment`](https://swiftpackageindex.com/elementary-swift/elementary-ui/documentation/elementaryui/environment-swift.struct) will only work in types annotated with the `ElementaryUI.@View` macro.
:::
## Reactive objects
-You can also pass [reactive objects](./state-and-reactivity.md#reactive) directly in the environment. The object's type acts as the environment key.
+You can also pass [reactive objects](state-and-reactivity.md#reactive) directly in the environment. The object's type acts as the environment key.
```swift
@Reactive
final class UserProfile {
- var name: String = "Anonymous"
+ var name: String = "Anonymous"
}
// Providing the object
let profile = UserProfile()
ContentView()
- .environment(profile)
+ .environment(profile)
// Reading the object in a sub view
@View
struct ProfileHeader {
- @Environment(UserProfile.self) var profile
+ @Environment(UserProfile.self) var profile
- var body: some View {
- p {
- "User: \(profile.name)"
+ var body: some View {
+ p {
+ "User: \(profile.name)"
+ }
}
- }
}
```
diff --git a/guide/essentials/lifecycle-events.md b/guide/essentials/lifecycle-events.md
index 441591a..7d0c3ca 100644
--- a/guide/essentials/lifecycle-events.md
+++ b/guide/essentials/lifecycle-events.md
@@ -9,28 +9,28 @@ Use the `ElementaryUI.View.onAppear(_:)` modifier to run an action when a view i
```swift
@View
struct MyView {
- var body: some View {
- div { "Hello" }
- .onAppear {
- print("View appeared!")
- }
- }
+ var body: some View {
+ div { "Hello" }
+ .onAppear {
+ print("View appeared!")
+ }
+ }
}
```
## `onDisappear`
-Use the `ElementaryUI.View.onDisappear(_:)` modifier to run an action when a view is removed from hierarchy.
+Use the `ElementaryUI.View.onDisappear(_:)` modifier to run an action when a view is removed from the hierarchy.
```swift
@View
struct MyView {
- var body: some View {
- div { "Goodbye" }
- .onDisappear {
- print("View disappeared!")
- }
- }
+ var body: some View {
+ div { "Goodbye" }
+ .onDisappear {
+ print("View disappeared!")
+ }
+ }
}
```
@@ -41,15 +41,15 @@ The `ElementaryUI.View.onChange(of:initial:_:)` modifier triggers an action when
```swift
@View
struct CounterView {
- @State var count = 0
+ @State var count = 0
- var body: some View {
- button { "Increment" }
- .onClick { count += 1 }
- .onChange(of: count) {
- print("Count is now \(count)")
- }
- }
+ var body: some View {
+ button { "Increment" }
+ .onClick { count += 1 }
+ .onChange(of: count) {
+ print("Count is now \(count)")
+ }
+ }
}
```
@@ -60,19 +60,19 @@ Use the `ElementaryUI.View.task(_:)` modifier to run an asynchronous operation w
```swift
@View
struct MyView {
- @State var data: String?
+ @State var data: String?
- var body: some View {
- div {
- if let data = data {
- data
- } else {
- "Loading..."
- }
- }
- .task {
- data = await fetchData()
+ var body: some View {
+ div {
+ if let data = data {
+ data
+ } else {
+ "Loading..."
+ }
+ }
+ .task {
+ data = await fetchData()
+ }
}
- }
}
```
diff --git a/guide/essentials/list-rendering.md b/guide/essentials/list-rendering.md
index 97aacd2..42cd3bb 100644
--- a/guide/essentials/list-rendering.md
+++ b/guide/essentials/list-rendering.md
@@ -2,7 +2,7 @@
## `ForEach`
-Use `ElementaryUI.ForEach` when you need a stable id for your list items (reordering, insertions, animations). You can either use elements that implement `Identifiable`, or the `ElementaryUI.ForEach.init(_:id:content:)` initializer that takes an `id` closure returning any `Hashable` value.
+Use `ForEach` when you need a stable id for your list items (reordering, insertions, animations). You can either use elements that implement `Identifiable`, or the `ForEach(_:id:content:)` initializer that takes an `id` closure returning any `Hashable` value.
<<< @/swift/Sources/Snippets/ListStrings.swift#snippet
diff --git a/guide/essentials/state-and-reactivity.md b/guide/essentials/state-and-reactivity.md
index 26412f4..7b2a82c 100644
--- a/guide/essentials/state-and-reactivity.md
+++ b/guide/essentials/state-and-reactivity.md
@@ -12,15 +12,15 @@ Use the `ElementaryUI.State` property wrapper to declare local, mutable state fo